-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add the golangci-lint GitHub action #6537
Conversation
Initially we enable only the gosec linter and only check G112 because that has been addressed in cert-manager#6534. Signed-off-by: Richard Wall <richard.wall@venafi.com>
/kind cleanup |
/hold until discussed with other maintainers. |
Hey, I am very happy that we are finally going to try this approach. As long as people interacting with the project are able to quickly figure out how to run the same checks locally (documentation or make command), I am totally OK having linters and checks outside of Prow. /lgtm |
I agree, combining GH with prow is no big deal. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maelvls The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Run golangci-lint as a GitHub action, to provide fast feedback to a PR author about various common mistakes that are found in their code.
Initially we enable only one linter and check only G112.
The idea is that other checks and linters can be enabled one-by-one in separate PRs.
Each PR will enable only one new check and fix any offending code.
This way, the PRs are easy to review
and easy to cherry-pick into previous release branches if the fixes are deemed important enough.
Eventually, when all standard linters and checks have been enabled, the non-standard file
.golangci-lint.*ci*.yaml
can be renamed to.golangci-lint.yaml
so that it developers can simply rungolangci-lint run .
locally (or via their editor / lsp-server) and get feedback before even creating a PR>The advantages of running golangci-lint via a GitHub Action vs running it via prow + make target, are:
The disadvantages are:
Instances of G112 have already been fixed in a another PR:
/kind cleanup