pull/2/head
golangci 6 years ago committed by GitHub
parent 69c6e15bd3
commit d0f5da9493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,2 +1,95 @@
# awesome-go-linters
A curated list of awesome Go linters
# Awesome Go Linters
A curated list of awesome Go linters. Sponsored by [GolangCI](https://golangci.com).
## Contents
## Cloud Linters
### Go focused
* [GolangCI](https://golangci.com/) - Open Source service for automated Github pull request code reviews. Free for Open Source.
* [Golint online](http://go-lint.appspot.com/) - Lints online Go source files on GitHub, Bitbucket and Google Project Hosting using the golint package.
* [GopherCI](https://gopherci.io/) - GopherCI helps you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other tests.
* [Go Report Card](https://goreportcard.com/) - Go repo report card.
### General Purpose
* [CodeClimate](https://codeclimate.com/) - The open and extensible static analysis platform.
* [CodeFactor](https://www.codefactor.io/) - Automated Code Analysis for repos on GitHub or BitBucket.
* [HoundCI](https://houndci.com/) - Code review tool for GitHub pull requests
* [QuantifiedCode](https://www.quantifiedcode.com/) - Automated code review & repair
* [Scrutinizer](https://scrutinizer-ci.com/) - A proprietery code quality checker that can be integrated with GitHub
* [SideCI](https://sideci.com/) - An automated code reviewing tool. Improving developers' productivity.
## Linters
### Code Formatting
* [gofmt](https://golang.org/cmd/gofmt/) - Gofmt formats Go programs. Must have for every project. Don't forget to use -s flag.
* [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Goimports does everything that gofmt does. Additionally it checks unused imports.
* [unindent](https://github.com/mvdan/unindent) - Report code that is unnecessarily indented
### Code Complexity
* [abcgo](https://github.com/droptheplot/abcgo) - ABC metrics for Go source code.
* [depth](https://github.com/360EntSecGroup-Skylar/goreporter/tree/feature-3.0/linters/depth) - Count the maxdepth of go functions. It's helpful to see if a function needs to be splitted into several smaller functions, for readability purpose.
* [gocyclo](https://github.com/alecthomas/gocyclo) - Computes and checks the cyclomatic complexity of functions.
* [nakedret](https://github.com/alexkohler/nakedret) - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
* [splint](https://github.com/stathat/splint) - It finds any functions that are too long or have too many parameters or results.
### Style and Patterns Checking
* [dupl](https://github.com/mibk/dupl) - Tool for code clone detection.
* [go-checkstyle](https://github.com/qiniu/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.
* [go-cleanarch](https://github.com/roblaszczak/go-cleanarch) - go-cleanarch was created to validate Clean Architecture rules, like a The Dependency Rule and interaction between packages in your Go projects.
* [goconst](https://github.com/jgautheron/goconst) - Find in Go repeated strings that could be replaced by a constant.
* [GoLint](https://github.com/golang/lint) - Golint is a linter for Go source code.
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) - gosimple is a linter for Go source code that specialises on simplifying code.
* [impi](https://github.com/pavius/impi) - Verify imports grouping and ordering.
* [interfacer](https://github.com/mvdan/interfacer) - Linter that suggests narrower interface types.
* [lll](https://github.com/walle/lll) - Line length linter, used to enforce line length in files.
* [misspell](https://github.com/client9/misspell) - Finds commonly misspelled English words
* [nofuncflags](https://github.com/fsamin/nofuncflags) - disallow boolean params to functions (flags).
* [unconvert](https://github.com/mdempsky/unconvert) - Remove unnecessary type conversions from Go source.
* [usedexports](https://github.com/jgautheron/usedexports) - Find in Go exported variables that could be unexported.
### Bugs
* [apicompat](https://github.com/bradleyfalzon/apicompat) - Checks recent changes to a Go project for backwards incompatible changes.
* [badtime](https://github.com/m3db/build-tools/tree/master/linters/badtime) - Badtime is a Golang linter that detects inappropriate usage of the time.Time struct.
* [durcheck](https://github.com/hypnoglow/durcheck) - durcheck is a very simple linter which detects potential bugs with time.Duration in a Go package.
* [enumlinter](https://github.com/THE108/enumlinter) - Enum linter for enumerated types in Go.
* [errcheck](https://github.com/kisielk/errcheck) - Errcheck is a program for checking for unchecked errors in Go programs.
* [gas](https://github.com/GoASTScanner/gas) - Inspects source code for security problems by scanning the Go AST.
* [go vet](https://golang.org/cmd/vet/) - Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string. Can check shadowing of variables, but must be enabled explicitly.
* [mulint](https://github.com/gnieto/mulint) - Go lint which detects recursive locks, which may lead to dead locks.
* [safesql](https://github.com/stripe/safesql) - Static analysis tool for Golang that protects against SQL injections.
* [scopelint](https://github.com/kyoh86/scopelint) - scopelint checks for unpinned variables in go programs.
* [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/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#.
### Unused code
* [deadcode](https://github.com/tsenart/deadcode) - Finds unused code.
* [ineffassign](https://github.com/gordonklaus/ineffassign) - Detect when assignments to existing variables are not used.
* [structcheck](https://github.com/opennota/check) - Find unused global variables and constants.
* [unparam](https://github.com/mvdan/unparam) - Report unused function parameters.
* [unused](https://github.com/dominikh/go-tools/tree/master/cmd/unused) - unused checks Go code for unused constants, variables, functions and types.
* [varcheck](https://github.com/opennota/check) - Find unused global variables and constants.
### Performance
* [aligncheck](https://github.com/opennota/check) - Warn about un-optimally aligned structures.
* [Copyfighter](https://github.com/jmhodges/copyfighter) - Statically analyzes Go code and reports functions that are passing large structs by value.
* [maligned](https://github.com/mdempsky/maligned) - Tool to detect Go structs that would take less memory if their fields were sorted.
* [prealloc](https://github.com/alexkohler/prealloc) - Find slice declarations that could potentially be preallocated.
### Reports
* [flen](https://github.com/lafolle/flen) - Get info on length of functions in a Go package.
* [GoReporter](https://github.com/360EntSecGroup-Skylar/goreporter) - A Golang tool that does static analysis, unit testing, code review and generate code quality report.
* [golinters](https://github.com/thomasheller/golinters) - golinters generates HTML reports about Go linters.
### Misc
* [go-outdated](https://github.com/firstrow/go-outdated) - Console application that displays outdated packages.
* [go-template-lint](https://github.com/sourcegraph/go-template-lint) - go-template-lint is a linter for Go text/template (and html/template) template files.
* [godox](https://github.com/766b/godox) - Find all TODO/FIXME comments.
* [lingo](https://github.com/s2gatev/lingo) - Set of specific checks.
* [megacheck](https://github.com/dominikh/go-tools/tree/master/cmd/megacheck) - megacheck runs staticcheck, gosimple and unused at once. Because it is able to reuse work, it will be faster than running each tool separately.
* [tarp](https://github.com/verygoodsoftwarenotvirus/tarp) - tarp finds functions and methods without direct unit tests in Go source code.
## Linters Helper Tools
* [Go Metalinter](https://github.com/alecthomas/gometalinter) - Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form.
* [lint](https://github.com/surullabs/lint) - Run linters as part of go test.
* [revgrep](https://github.com/bradleyfalzon/revgrep) - Filters output from static analysis tools, showing only recently changed lines of code
* [reviewdog](https://github.com/haya14busa/reviewdog) - "reviewdog" provides a way to post review comments to code hosting service, such as GitHub, automatically by integrating with any linter tools with ease.
* [zb](https://github.com/joshuarubin/zb) - speedup linting by caching gometalinter result.

Loading…
Cancel
Save