All Projects → go-critic → Go Critic

go-critic / Go Critic

Licence: mit
The most opinionated Go source code linter for code audit.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Critic

Tlint
Tighten linter for Laravel conventions
Stars: ✭ 274 (-68.69%)
Mutual labels:  linter, conventions, hacktoberfest
Editorconfig Checker
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 119 (-86.4%)
Mutual labels:  linter, hacktoberfest
Abaplint
Standalone linter for ABAP
Stars: ✭ 111 (-87.31%)
Mutual labels:  linter, hacktoberfest
go-namecheck
Source code analyzer that helps you to maintain variable/field naming conventions inside your project.
Stars: ✭ 37 (-95.77%)
Mutual labels:  conventions, linter
Rubberduck
Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
Stars: ✭ 1,287 (+47.09%)
Mutual labels:  linter, hacktoberfest
Doc8
Style checker for sphinx (or other) rst documentation.
Stars: ✭ 105 (-88%)
Mutual labels:  linter, hacktoberfest
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+258.74%)
Mutual labels:  linter, hacktoberfest
Pyflakes
A simple program which checks Python source files for errors
Stars: ✭ 991 (+13.26%)
Mutual labels:  linter, hacktoberfest
Coala Bears
Bears for coala
Stars: ✭ 276 (-68.46%)
Mutual labels:  linter, hacktoberfest
Isort
A Python utility / library to sort imports.
Stars: ✭ 4,377 (+400.23%)
Mutual labels:  linter, hacktoberfest
Verible
Verible is a suite of SystemVerilog developer tools, including a parser, style-linter, and formatter.
Stars: ✭ 384 (-56.11%)
Mutual labels:  linter, hacktoberfest
Commit Msg Linter
git commit message linter hook
Stars: ✭ 87 (-90.06%)
Mutual labels:  linter, conventions
Vscode Gremlins
Gremlins tracker for Visual Studio Code: reveals invisible whitespace and other annoying characters
Stars: ✭ 78 (-91.09%)
Mutual labels:  linter, hacktoberfest
Wemake Python Styleguide
The strictest and most opinionated python linter ever!
Stars: ✭ 1,714 (+95.89%)
Mutual labels:  linter, hacktoberfest
Psscriptanalyzer
Download ScriptAnalyzer from PowerShellGallery
Stars: ✭ 1,137 (+29.94%)
Mutual labels:  linter, hacktoberfest
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+193.6%)
Mutual labels:  linter, hacktoberfest
Scrutor
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
Stars: ✭ 1,915 (+118.86%)
Mutual labels:  conventions, hacktoberfest
Undercover
Actionable code coverage - detects untested code blocks in recent changes
Stars: ✭ 574 (-34.4%)
Mutual labels:  linter, hacktoberfest
Clusterlint
A best practices checker for Kubernetes clusters. 🤠
Stars: ✭ 409 (-53.26%)
Mutual labels:  linter, hacktoberfest
Super Linter
Combination of multiple linters to install as a GitHub Action
Stars: ✭ 7,445 (+750.86%)
Mutual labels:  linter, hacktoberfest

go-critic

Build Status Awesome Go Report Card coverage PRs Welcome

Highly extensible Go source code linter providing checks currently missing from other linters.

Logo

There is never too much static code analysis. Try it out.

Features

  • Almost 100 diagnostics that check for bugs, performance and style issues
  • Extensible without re-compilation with dynamic rules
  • Includes #opinionated checks with very strict and specific requirements
  • Self-documented: gocritic doc <checkname> gives a checker description

Documentation

The latest documentation is available at go-critic.github.io.

Installation

For most users, using go-critic under golangci-lint is enough.

Precompiled go-critic binaries can be found at releases page.

Instructions below show how to build go-critic from sources.

GO111MODULE=on go get -v -u github.com/go-critic/go-critic/cmd/gocritic

If the command above does not work, you can try cloning this repository under your GOPATH and run make gocritic.

Usage

Be sure gocritic executable is under your $PATH.

Usage of gocritic: gocritic [sub-command] [sub-command args...] Run gocritic without arguments to get help output.

Supported sub-commands:
	check - run linter over specified targets
		$ gocritic check -help
		$ gocritic check -v -enable='paramTypeCombine,unslice' strings bytes
		$ gocritic check -v -enable='#diagnostic' -disable='#experimental,#opinionated' ./...
	version - print linter version
		$ gocritic version
	doc - get installed checkers documentation
		$ gocritic doc -help
		$ gocritic doc
		$ gocritic doc checkerName

check sub-command examples:

# Runs all stable checkers on `fmt` package:
gocritic check fmt

# Run all stable checkers on `pkg1` and `pkg2`
gocritic check pkg1 pkg2

# Run all stable checkers on `fmt` package and configure rangeExprCopy checker
gocritic check [email protected] 128 fmt

# Runs specified checkers on `fmt` package:
gocritic check -enable elseif,paramName fmt

# Run all stable checkers on current dir and all its children recursively:
gocritic check ./...

# Like above, but without `appendAssign` check:
gocritic check -disable=appendAssign ./...

# Run all stable checkers on `foo.go` file:
gocritic check foo.go

# Run stable diagnostics over `strings` package:
gocritic check -enable='#diagnostic' -disable='#experimental' strings

# Run all stable and non-opinionated checks:
gocritic check -enableAll -disable='#experimental,#opinionated' ./src/...

To get a list of available checker parameters, run gocritic doc <checkerName>.

In place of a single name, tag can be used. Tag is a named checkers group.

Tags:

  • #diagnostic - kind of checks that detect various errors in code
  • #style - kind of checks that find style issues in code
  • #performance - kind of checks that detect potential performance issues in code
  • #experimental - check is under testing and development. Disabled by default
  • #opinionated - check can be unwanted for some people. Disabled by default
  • #security - kind of checks that find security issues in code

Contributing

This project aims to be contribution-friendly.

Our chats: English or Russian (Telegram website)

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].