Skip to content

Commit

Permalink
[chore][CODEOWNERS] Remove trailing whitespace (open-telemetry#37293)
Browse files Browse the repository at this point in the history
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
`githubgen` was adding trailing whitespaces to unmaintained components
that was unnecessary. This removes the trailing whitespaces.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#37292
  • Loading branch information
crobert-1 authored and chengchuanpeng committed Jan 26, 2025
1 parent 2ba14df commit 74db4ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,14 @@ testbed/mockdatasenders/mockdatadogagentexporter/ @open-telemetry
# List of distribution maintainers for OpenTelemetry Collector Contrib
#
#####################################################
reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/k8s.yaml @open-telemetry/collector-contrib-approvers

reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/k8s.yaml @open-telemetry/collector-contrib-approvers

## UNMAINTAINED components

exporter/kineticaexporter/ @open-telemetry/collector-contrib-approvers
exporter/opensearchexporter/ @open-telemetry/collector-contrib-approvers
extension/observer/ecstaskobserver/ @open-telemetry/collector-contrib-approvers
extension/storage/filestorage/ @open-telemetry/collector-contrib-approvers
exporter/kineticaexporter/ @open-telemetry/collector-contrib-approvers
exporter/opensearchexporter/ @open-telemetry/collector-contrib-approvers
extension/observer/ecstaskobserver/ @open-telemetry/collector-contrib-approvers
extension/storage/filestorage/ @open-telemetry/collector-contrib-approvers
10 changes: 8 additions & 2 deletions cmd/githubgen/codeowners.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ LOOP:
for stability := range m.Status.Stability {
if stability == unmaintainedStatus {
unmaintainedList += key + "/\n"
unmaintainedCodeowners += fmt.Sprintf("%s/%s @open-telemetry/collector-contrib-approvers \n", key, strings.Repeat(" ", data.maxLength-len(key)))
unmaintainedCodeowners += fmt.Sprintf("%s/%s @open-telemetry/collector-contrib-approvers\n", key, strings.Repeat(" ", data.maxLength-len(key)))
continue LOOP
}
if stability == "deprecated" && (m.Status.Codeowners == nil || len(m.Status.Codeowners.Active) == 0) {
Expand Down Expand Up @@ -176,7 +176,13 @@ LOOP:
for _, m := range dist.Maintainers {
maintainers = append(maintainers, fmt.Sprintf("@%s", m))
}
codeowners += fmt.Sprintf("reports/distributions/%s.yaml%s @open-telemetry/collector-contrib-approvers %s\n", dist.Name, strings.Repeat(" ", longestName-len(dist.Name)), strings.Join(maintainers, " "))

distribution := fmt.Sprintf("\nreports/distributions/%s.yaml%s @open-telemetry/collector-contrib-approvers", dist.Name, strings.Repeat(" ", longestName-len(dist.Name)))
if len(maintainers) > 0 {
distribution += fmt.Sprintf(" %s", strings.Join(maintainers, " "))
}

codeowners += distribution
}

err = os.WriteFile(filepath.Join(".github", "CODEOWNERS"), []byte(codeowners+unmaintainedCodeowners), 0o600)
Expand Down

0 comments on commit 74db4ec

Please sign in to comment.