Git Product home page Git Product logo

go-critic's Introduction

go-critic

Build Status Awesome Go Report Card GoDoc coverage PRs Welcome

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

Logo

Project goals:

  • 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.

Documentation

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

Installation

go get -u github.com/go-critic/go-critic/...

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.

Examples:

Command Description
gocritic check-package fmt Runs all stable checkers on fmt package
gocritic check-package pkg1 pkg2 Run all stable checkers on pkg1 and pkg2
gocritic check-package -enable elseif,paramName fmt Runs specified checkers on fmt package
gocritic check-project $GOROOT/src Run all stable checkers on entire GOROOT
gocritic check-project $GOPATH/src Run all stable checkers on entire GOPATH
gocritic check-project $GOPATH/src/foo Run all stable checkers on all packages under GOPATH/src/foo

Note: check-project $GOPATH/xyz won't work it you're using multiple paths under GOPATH.

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.

go-critic's People

Contributors

adsouza avatar anikhasibul avatar atul9 avatar barbeque avatar breml avatar cristaloleg avatar dmirogin avatar ewgra avatar fexolm avatar greenhorse avatar kdar avatar ludweeg avatar nar1k avatar nexomichael avatar olshevskiy87 avatar quasilyte avatar uncleandy avatar weeellz avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.