Git Product home page Git Product logo

pre-commit-golang's Introduction

pre-commit-golang

๐Ÿšจ Please see the project sunsetting announcement: Issues/98 ๐Ÿšจ


golang hooks for http://pre-commit.com/

Using these hooks

Add this to your .pre-commit-config.yaml

- repo: https://github.com/dnephin/pre-commit-golang
  rev: master
  hooks:
    - id: go-fmt
    - id: go-vet
    - id: go-lint
    - id: go-imports
    - id: go-cyclo
      args: [-over=15]
    - id: validate-toml
    - id: no-go-testing
    - id: golangci-lint
    - id: go-critic
    - id: go-unit-tests
    - id: go-build
    - id: go-mod-tidy

Available hooks

  • go-fmt - Runs gofmt, requires golang
  • go-vet - Runs go vet, requires golang
  • go-lint - Runs golint, requires https://github.com/golang/lint but is unmaintained & deprecated in favour of golangci-lint
  • go-imports - Runs goimports, requires golang.org/x/tools/cmd/goimports
  • go-cyclo - Runs gocyclo, require https://github.com/fzipp/gocyclo
  • validate-toml - Runs tomlv, requires https://github.com/BurntSushi/toml/tree/master/cmd/tomlv
  • no-go-testing - Checks that no files are using testing.T, if you want developers to use a different testing framework
  • golangci-lint - run golangci-lint run ./..., requires golangci-lint
  • go-critic - run gocritic check ./..., requires go-critic
  • go-unit-tests - run go test -tags=unit -timeout 30s -short -v
  • go-build - run go build, requires golang
  • go-mod-tidy - run go mod tidy -v, requires golang
  • go-mod-vendor - run go mod vendor, requires golang

pre-commit-golang's People

Contributors

abizer avatar akostibas avatar asottile avatar borisbabic avatar burik666 avatar callofdutyops avatar ccoveille avatar colinschoen avatar covertbert avatar davidpfarrell avatar dnephin avatar dtomasi avatar echarrod avatar flw-cn avatar giorgiop avatar ilovejs avatar j2gg0s avatar jasonfriedland avatar jerome1337 avatar jjaxu avatar jonyhy96 avatar korjavin avatar larsks avatar logikone avatar mckingho avatar michilu avatar ramonhpr avatar rumyantseva avatar vallieres avatar

Stargazers

 avatar

Watchers

 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.