Skip to content

Conversation

@paulojmdias
Copy link
Member

@paulojmdias paulojmdias commented Nov 12, 2025

Description

This PR enables the modernize linter.

Should only be merged when the following PRs are merged:

Example of a linter error:

WARN [runner/exclusion_paths] The pattern "third_party" match no issues
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "cachedBytes", Path: "pagefile.go", Linters: "unused"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "third_party", Linters: "gci, gofumpt"]
receiver/googlecloudspannerreceiver/config.go:97:2: slicescontains: Loop can be simplified using slices.Contains (modernize)
	for _, database := range instance.Databases {
	^
receiver/googlecloudspannerreceiver/internal/filter/testhelpers_test.go:40:6: rangeint: for loop can be modernized using range over int (modernize)
	for i := 0; i < 3; i++ {
	    ^
receiver/googlecloudspannerreceiver/internal/statsreader/timestampsgenerator_test.go:71:6: rangeint: for loop can be modernized using range over int (modernize)
	for i := 0; i < expectedAmountOfTimestamps; i++ {
	    ^
make: *** [lint] Error 1

Fixes #44364

songy23 pushed a commit that referenced this pull request Nov 12, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
bogdandrutu pushed a commit that referenced this pull request Nov 12, 2025
…44213)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
bogdandrutu pushed a commit that referenced this pull request Nov 12, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
bogdandrutu pushed a commit that referenced this pull request Nov 12, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
songy23 pushed a commit that referenced this pull request Nov 12, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
songy23 pushed a commit that referenced this pull request Nov 12, 2025
…44211)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
songy23 pushed a commit that referenced this pull request Nov 12, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
songy23 pushed a commit that referenced this pull request Nov 13, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This is part of the process to enable the
[modernize](#44199)
linter in CI and upgrade `golanglint` to the latest version.

There are no changes in the component behaviour.

```sh
WARN [runner/exclusion_paths] The pattern "third_party" match no issues
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "cachedBytes", Path: "pagefile.go", Linters: "unused"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "third_party", Linters: "gci, gofumpt"]
receiver/windowseventlogreceiver/factory_test.go:45:3: error-is-as: use assert.ErrorIs or assert.ErrorAs depending on the case (testifylint)
		assert.IsType(t, pipeline.ErrSignalNotSupported, err)
		^
make: *** [lint] Error 1
```

---------

Signed-off-by: Paulo Dias <[email protected]>
songy23 pushed a commit that referenced this pull request Nov 13, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
codeboten pushed a commit that referenced this pull request Nov 13, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This is part of the process to enable the
[modernize](#44199)
linter in CI and upgrade `golanglint` to the latest version.

There are no changes in the component behaviour.

```sh
WARN [runner/exclusion_paths] The pattern "third_party" match no issues
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "cachedBytes", Path: "pagefile.go", Linters: "unused"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "third_party", Linters: "gci, gofumpt"]
processor/resourcedetectionprocessor/config.go:50:2: deprecatedComment: `Deprecated: ` notices should be in a dedicated paragraph, separated from the rest (gocritic)
	// Deprecated: Please use detector's resource_attributes config instead
	^
make: *** [lint] Error 1
```

Signed-off-by: Paulo Dias <[email protected]>
codeboten pushed a commit that referenced this pull request Nov 13, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI which needs upgrade the `golanglint` to `v2.6.1`.

There are no changes in the component behaviour.

Signed-off-by: Paulo Dias <[email protected]>
codeboten pushed a commit that referenced this pull request Nov 13, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Run the `make modernize` tool.

https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

This is part of the process to enable the
[modernize](#44199)
linter in CI.

There are no changes in the component behaviour.

---------

Signed-off-by: Paulo Dias <[email protected]>
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the exceptions here have issues associate with them make sure they're eventually removed?

Co-authored-by: Alex Boten <[email protected]>
@codeboten codeboten merged commit 3395018 into open-telemetry:main Dec 18, 2025
189 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 18, 2025
@paulojmdias
Copy link
Member Author

Thank you @codeboten 🙏

@paulojmdias paulojmdias deleted the chore/enable_modernize_lint branch December 18, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add modernize to golint

4 participants