-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Replace golint for golangci-lint #9037
Comments
@rikatz: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign I would like to work on this |
/assign |
great |
uhum, but first as Long is studying go I want him to run lint locally, and check and fix the errors :D so he can learn a bit on why the errors happens and what's the fix. Then we move to use golangci-lint-action and remove the prow job :D |
First run ;
and lots more |
nice. Now, there are some warnings that are valid and some that are not :) the majority here are non checked errors (like if err != nil) from a function.
==== Ricardo's personal opinion ==== I am one of those persons that likes to check the return of all errors. I'm a coward when we are talking about errors, always wondering that some non checked error or some non checked pointer may end up in a panic in a future :) But this is not a common sense (I guess...) and some people thinks that some errors can be ignored. The notable example, IIRC is the io.Close thing, that says that the error can be ignored as usually it is always nil. This is why I say it should make sense to ignore or not the error (look at the called function, when it can return an error or not) and if it does make sense to ignore that error, we should add the marker in the code ignoring golangci-lint in that part of the code :) |
This is going to be very focussed work for me because of me not being a go dev. If I have got it wrong, I would love to get advise/comments . |
@rikatz @tao12345666333 The demo video showed something interesting so I tried it here. Can you comment if the below check is valid or not ;
Only these few since v1.3.0 and none since v1.3.1 .... Does this seem valid ? I mean I can try to check the last 3 about |
Ah, interesting FAQ. Helpful and clear on what to do ; **Q. How to integrate golangci-lint into large project with thousands of issues We are sure that every project can easily integrate golangci-lint, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use GolangCI) to run golangci-lint with option --new-from-rev=HEAD |
/remove-help |
@rikatz @tao12345666333 this is ready for your comments because using the flag to only check tags after recent release shows no linting error |
Thanks, let me take a look |
Executing scripts hosted outside your repo without verification opens door to incidents like Codecov Bash Supply Chain Attack. Shameless plug: for a safer way to use golangci-lint, you can use use my self-contained workflow.yml (safer-golangci-lint) to download, verify SHA-256, and execute golangci-lint. It's easy-to-audit and use. It's used by fxamacker/cbor for over a year to make sure CI behavior doesn't change unless maintainers update the workflow or linter settings in their own repo. Cheers! |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
This issue is labeled with You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
/close This is fixed!! 🥳 |
@rikatz: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
golint is deprecated and frozen.
We should replace our CI for https://github.com/golangci/golangci-lint, check the flakes (and the real complains) and fix those
/kind bug
/triage accepted
/good-first-issue
/help
/priority important-soon
The text was updated successfully, but these errors were encountered: