Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd linters to Makefile.common #4125
Comments
This comment has been minimized.
This comment has been minimized.
|
/cc @mjtrangoni |
This comment has been minimized.
This comment has been minimized.
|
Do we know what level of false positives we can expect? |
This comment has been minimized.
This comment has been minimized.
|
Good question, Maybe @mjtrangoni has some more experience with that. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil you are right, there are going to be many false positives. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, careful with linting, at least https://github.com/golang/lint's README.md says "In short, this tool is not, and will never be, trustworthy enough for its suggestions to be enforced automatically, for example as part of a build process.", and we've known that for a while :) We can still have targets for it of course, just not have them be part of CI checks. |
This comment has been minimized.
This comment has been minimized.
|
What I like about golint is that it e.g. ensures that exported functions and variables use CamelCase and have docstrings (i.e. it encourages Best Practices and idiomatic Go coding style). Issues like these are trivial to detect and fix during development but hard to fix after the new API is part of an official release (without breaking compatibility). Calling golint in a release manager's Makefile target would be enough to catch these issues before release (but who's going to fix them?). Integrating golint in CI has the big advantage that each contributor would have to fix the issues before they even enter the repo. This keeps the commit history shorter and distributes the workload from the release manager to each individual contributor. FWIW: At the moment prometheus master has 167 golint issues (132 of them in
Some examples:
|
SuperQ commentedApr 30, 2018
Proposal
Add golint and gometalinter as targets in Makefile.common.