Skip to content

Update linter#507

Merged
christos68k merged 7 commits intoopen-telemetry:mainfrom
rockdaboot:update-linter
Jun 11, 2025
Merged

Update linter#507
christos68k merged 7 commits intoopen-telemetry:mainfrom
rockdaboot:update-linter

Conversation

@rockdaboot
Copy link
Copy Markdown
Contributor

This PR does:

  • update golangci-lint required to rewrite parts of the config file
  • update the make target lint to use docker (building with go is no longer supported with v2)
  • use make lint in the CI to keep it in sync with local linting (less maintenance)
  • amend nolint directives as some linters are no longer available
  • trivial code code changes to pass linting

@rockdaboot rockdaboot self-assigned this Jun 5, 2025
@rockdaboot rockdaboot requested a review from a team as a code owner June 5, 2025 15:23
@rockdaboot rockdaboot requested a review from a team as a code owner June 5, 2025 15:23
@florianl
Copy link
Copy Markdown
Member

florianl commented Jun 5, 2025

Instead of ever changing various places, I would love if we can wait for a moment, until the minimum supported Go version is Go 1.24.
Starting with Go 1.24 we can just use/manage linters like tools in Go.

Example:

# Install the tool (one time action)
go get -tool honnef.co/go/tools/cmd/staticcheck@v0.5.1
# Use the tool
go tool staticcheck -checks=all ./...

This allows to slim and simplify things in a lot of places.

@rockdaboot
Copy link
Copy Markdown
Contributor Author

Instead of ever changing various places, I would love if we can wait for a moment, until the minimum supported Go version is Go 1.24. Starting with Go 1.24 we can just use/manage linters like tools in Go.

Example:

# Install the tool (one time action)
go get -tool honnef.co/go/tools/cmd/staticcheck@v0.5.1
# Use the tool
go tool staticcheck -checks=all ./...

This allows to slim and simplify things in a lot of places.

That possibly a good thing. But can we make this two steps? So get this PR in and whenever we switch to 1.24 and someone has the time, do what you suggest?

Comment thread Makefile Outdated
Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
Comment thread .golangci.yml Outdated
@christos68k christos68k merged commit 899cf28 into open-telemetry:main Jun 11, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants