go-checkstyle alternatives and similar packages
Based on the "Code Analysis" category.
Alternatively, view go-checkstyle alternatives based on common mentions on social networks and blogs.
-
Go Metalinter
DISCONTINUED. Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form. -
revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint -
go-cleanarch
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects. -
go-mod-outdated
Find outdated dependencies of your Go projects. go-mod-outdated provides a table view of the go list -u -m -json all command which lists all dependencies of a Go project and their available minor and patch updates. It also provides a way to filter indirect dependencies and dependencies without updates. -
goreturns
A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types -
usestdlibvars
A linter that detect the possibility to use variables/constants from the Go standard library. -
staticcheck
staticcheck is go vet on steroids, applying a ton of static analysis checks you might be used to from tools like ReSharper for C#. -
Golint online
Lints online Go source files on GitHub, Bitbucket and Google Project Hosting using the golint package. -
blanket
blanket is a tool that helps you catch functions which don't have direct unit tests in your Go packages.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of go-checkstyle or a related project?
README
go-checkstyle
checkstyle is a style check tool like java checkstyle. This tool inspired by java checkstyle, golint. The style refered to some points in Go Code Review Comments.
Install
go get github.com/qiniu/checkstyle/gocheckstyle
Run
gocheckstyle -config=.go_style dir1 dir2
Config
config is json file like the following:
{
"file_line": 500,
"func_line": 50,
"params_num":4,
"results_num":3,
"formated": true,
"pkg_name": true,
"camel_name":true,
"ignore":[
"a/*",
"b/*/c/*.go"
],
"fatal":[
"formated"
]
}
Add to makefile
check_go_style:
bash -c "mkdir -p checkstyle; cd checkstyle && export GOPATH=`pwd` && go get github.com/qiniu/checkstyle/gocheckstyle"
checkstyle/bin/gocheckstyle -config=.go_style dir1 dir2
Integrate with jenkins checkstyle plugin
excute in shell
mkdir -p checkstyle; cd checkstyle && export GOPATH=`pwd` && go get github.com/qiniu/checkstyle/gocheckstyle"
checkstyle/bin/gocheckstyle -reporter=xml -config=.go_style dir1 dir2 2>gostyle.xml
then add postbuild checkstyle file gostyle.xml
Run checkstyle with one or more filenames or directories. The output of this tool is a list of suggestions. If you need to force obey the rule, place it in fatal.
Checkstyle's difference with other tools
Checkstyle differs from gofmt. Gofmt reformats Go source code, whereas checkstyle prints out coding style suggestion.
Checkstyle differs from golint. Checkstyle check file line/function line/param number, could be configed by user.