-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Umbrella Issue] Code style and linting errors cleanup #1176
Comments
HI @Adirio, Could you please provide what linter tool you are using and its report with the errors for each kind added here? Also, IHMO the first step would be adding the linter in the CI then, add its PR here and after that start to work to solve the issues faced. When all be fine the first PR to add the linter in the CI should pass and be merged. |
My IDE has an integrated linter and I've started from there. Adding linter to the CI is not recommended as lint errors are just style recommendations, sometimes they may not be followed due to any other reason and if it gets added to the CI process it would get blocked. |
What linter is your iDE using?
Linters are NOT just about style recommendations. See: https://github.com/golangci/awesome-go-linters
It has something that should not be merged and checked then, usually it should be done automatically by the CI in order to avoid it, otherwise, the same kind of issues/prs will still be required and the problem will be not solved. A commonly used linter aggregator for go is : https://github.com/golangci/golangci-lint. Also, it does not get too long to be executed which usually is the problem/reason for do not add linters in the CI and can be called used by a command line which makes easier its usage. I'd recommend you use this one since the project has the PR: #830 |
Quoted from golang/lint:
I'm not sure if my IDE is using golint as it is integrated in it (JetBrains' Golang) but the officail lint project suggests not to include it in CI. |
HI @Adirio, I made more than one suggestion in my above comment. Then, I will try to clarify better my POV here. I hope that it can help you achieve your goal as well. Regards the PR's: IHMO is great to work on fixing linter issues to improve the quality of the code, but, is required make clear what linter and its results as argumentation of the PR's in order to allow the reviewer check if it as well. Note that no make sense we have many PR's just to do the same as, for example, replace the capital letters to lower ones in the errors/messages. Also, how someone can understand the purpose of each task if has not the description over how to reproduce the same scenario and check if all is solved? How someone can collab with the tasks raised by you? See also, that the README page has a badge for: https://goreportcard.com/report/sigs.k8s.io/kubebuilder. May you like to use it to illustrate the motivation for the PR's. Regards add a specific linter in the CI I'd suggest we try to use golangci-lint and adopted it in the CI. Following the reasons.
@DirectXMan12 and @droot. Could we adopt this one? Any objection about doing a PR with it in the CI for we are able to check its errors and the progress of this task which @Adirio's purpose seems to solve all possible linter issues in the project? So, when it be finished means that this PR should pass in the CI. WDYT ? |
I'm not going to answer the "linter in CI" topic as I think that is a higher level decission that should be taken by the project mantainers who you already mentioned. This may actually be a good place to discuss it unless any other mean is proposed. About the other comments:
|
@camilamacedo86 I added the exact message and description from the linter in the four Issues that have a PR (and in their corresponding PRs too). Will do the same when I tackle the remaining ones. |
Hi @Adirio, How can we reproduce the issue and check the messages in order to verify your PRs? How can any contributor work on in the tasks whiteout the linter info? from the above msg:
I hope that the above questions can clarify the points. |
As you may see in the specific issues most of the modifications are related to CodeReviewComments or Effective Go. Most linters should hint this errors. In my case, Im using the linter hints from my IDE, which is not open source nor free so I can't suggest to download it. |
Your IDE uses a specific linter. So, in order to clarify my suggestion would be you check what linter is and add in the comment. It would be enough. |
It is builtin in the IDE, it is not an external plugin. The code of the IDE is not open source. The only documentation provided is:
|
HI, could you please assign the issue to you in order to avoid other dev get it since you gave a PR already one for this one? Also, devs will usually filter for the unassigned ones to know what they can do to contribute with. PS.: To do it just add a new comment with |
/assign |
This issue will track cleanup duties related to code style and linting errors. Each will be described in different issues and implemented in corresponding PR. Feel free to suggest more changes that should be applied under this category as comments and they will be added to the list. Keep the discussion related to a specific topic in their corresponding issues.
Error string formatting: Error string formatting #1177MergedUnused exported functions removal: Unused exported functions removal #1178MergedUnused parameters replacement by blank identifier: Unused parameters replacement by blank identifier #1179MergedPackage name as exported variable/type/function prefix removal: Package name as exported variable/type/function prefix removal #1181MergedUnification of receiver names: Unification of receiver names #1182MergedImports ordering: Imports ordering #1183Merged/kind cleanup
The text was updated successfully, but these errors were encountered: