Go source code linter providing checks currently missing from other linters.
Provide as many useful checks as possible; We're prototyping and experimenting here.
When a specific check implementation is mature and proven useful, propose its integration into other linters.
If a good checker can't find a better home, it stays here.
We say yes! to most checks that feel right and can help someone.
You can use this tool to make whole codebase checks periodically.
There is never too much static code analysis. Try it out.
The latest documentation is available at go-critic.github.io.
go get -u github.com/go-critic/go-critic/...
gocritic executable is under your
Usage of gocritic:
gocritic [sub-command] [sub-command args...]
gocritic without arguments to get help output.
||Runs all stable checkers on fmt package|
||Run all stable checkers on pkg1 and pkg2|
||Runs specified checkers on fmt package|
||Run all stable checkers on entire GOROOT|
||Run all stable checkers on entire GOPATH|
||Run all stable checkers on all packages under GOPATH/src/foo|
check-project $GOPATH/xyzwon't work it you're using multiple paths under
This project aims to be contribution-friendly.
We're using an optimistic merging strategy most of the time. In short, this means that if your contribution has some flaws, we can still merge it and then fix them by ourselves. Experimental and work-in-progress checkers are isolated, so nothing bad will happen.
Code style is the same as in Go project, see CodeReviewComments.
See CONTRIBUTING.md for more details. It also describes how to develop a new checker for the linter.