-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[chore] add a few additional linters #25060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's catching issues: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/5793638328/job/15701770307?pr=25060
Yes, we still have quite a few PRs to merge. I might need to split this further. |
Thanks, @atoulme. This is super helpful! Does it mean that a struct declaration has to be separated from its methods? Let's discuss it in #24956 (comment)
+1 to all of them |
This one didn't give me any trouble, it looks like its defaults mostly make it check nothing. Might be worth to try to play with its settings a bit more. It looks like by default all it does is making sure init functions are first in a file. I think we could also mandate constants and vars to be up to the top. |
I think the default behavior is enough |
I think it's already enough people said "no" to this linter, so we can remove it |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
See #25060 for original request. This adds the decorder linter with default configuration, just ensuring init blocks are at the top of the file for now.
Closing as I have split this work in smaller PRs. |
See #25060 for original request. This adds the reassign linter, checking no package variables are reassigned.
See #25060 for original request. This adds the wastedassign linter with default configuration. It ensures no assignmnent is made to a variable and then not used.
See #25060 for original request. This adds the predeclared linter with an explicit carveout to ignore use of the `copy` reserved word as it is used by a package. Co-authored-by: Alex Boten <[email protected]>
Adds a few linters that seem to prove most useful: