-
Notifications
You must be signed in to change notification settings - Fork 115
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
Suggestion: Implement Go linting #55
Comments
Derek add label: proposal |
@sargun thanks for writing up your proposal and for covering the points suggested in the contribution guide 👍 Linting and static code analysis is definitely something very widely used with OOP languages like Java and C# (sometimes with the Python community and PEPs), but I haven't encountered this much in the Go community. This is the first request for linting since the project started in 2016.
This question is placed in the wrong repo - if linting is to be introduced and followed / honoured then it needs to be part of the overall contribution process for the whole project. At this time I do not see linting as offering strong benefits but I may change my mind in the future if I see enough value for the cost to implement across the whole project. That said I tend to use a less strict linting implicitly through my IDE when making patches. |
I've seen linting used in the following projects to enforce Code "policy":
It's not so much of a request, as more of a codification of the practices of the project. |
well lucky me, if this is still in progress, might help with linter rules? I use this for projects and I have scraped countless linter rules from golangci-lint configs because sometimes some rules are the same but maintained by 2 different projects. We can always customize linter settings but I prefer one config for one org that everyone agrees, it is super easy to customize but metalinters are painful to customize so we use defaults of these rulesets (gocritic/revive/govet/staticcheck) https://gist.github.com/MrWormHole/250a8a1f78ca17c059b8ce075bbc28ec I can see from @sargun 's list
|
Brief summary including motivation/context:
This is more of a meta-issue. I'm curious as to whether there's any interest in adding a linter to the project. I tested
golangci-lint
, and it runs in 1.685 seconds. I used the following config:It showed the following output. Although most of these lint identifications aren't super important, some of them might catch places where the code could be simpler, or where the code might be ambiguous.
Any design changes
In the Dockerfile where we run the tests, we would have to install the linter, and run the linters.
Pros + Cons
Pros
Cons
Effort required up front
It would require that we take the current repo, fix, or ignore, the linter issues, and then add a linter configuration, as well as configuration to invoke the linter at CI time.
Effort required for CI/CD, release, ongoing maintenance
Basically keeping up to date the linter, and the linter configuration.
Migration strategy / backwards-compatibility
See the effort required up front.
The text was updated successfully, but these errors were encountered: