-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[all] Enable more linters on this repository #9109
Comments
I'd love to help with this. If ok, you can assign this to me. @mx-psi |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
I think it'd be great to add govulncheck as well. The good news is it passes on current
|
@lootek can you open a separate issue for this? I can list it on this meta issue once opened. Based on golangci/golangci-lint/issues/3094 it looks like this is not available on golangci-lint but we could run it separately if this is useful |
@mx-psi, Good point, thanks. It's done. Do you think it makes sense to add all the components listed one by one? Since the linter seems to be passing right now it should be straightforward. Or should I list them anyway? |
If it currently passes without errors I think it's fine to just enable it. |
Yeah, it's green. Though govulncheck runs against the current Go toolchain / std lib version so the question is which version do we use here in GH actions. I looked for that and it's not defined once but several times as 1.19.6 (and that'd be great) and many times as just 1.19 (with no clue if it's gonna take 1.19.0 or the highest available 1.19.x). |
Let's pin it to 1.19.6, that makes more sense to me |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@mx-psi I think this issue is finally ready to be closed :-) |
The opentelemetry-collector repository has two checks that are not enabled here. This is a meta issue to track these.
Linters
Errcheck
errcheck
linter on golangci-lint for all components that pass #9750Gocritic
gocritic
linter on golangci-lint #10465gocritic
in missing components #10466Depguard (for sync/atomic):
See more context at open-telemetry/opentelemetry-collector#5215.
Exhaustive
We also have an existing issue for checking coverage for all metric types that can be tackled with a linter:
Vulncheck
Possible additional work
Some more linters that could be enabled here (these are not in the core repo): deadcode, structcheck, unused, ineffassign, tenv, go-errorlint.
Approach
Fixing all errors at once is a lot of work, so I would suggest doing things in several steps:
The text was updated successfully, but these errors were encountered: