Shell
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

pre-commit-golang

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

Using these hooks

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

- repo: git://github.com/dnephin/pre-commit-golang
  sha: HEAD
  hooks:
    - id: go-fmt
    - id: go-vet
    - id: go-lint
    - id: validate-toml
    - id: no-go-testing
    - id: gometalinter
    - id: golangci-lint
    - id: go-critic

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
  • 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
  • gometalinter - run gometalinter --config gometalinter.json ./...
  • golangci-lint - run golangci-lint run ./..., requires golangci-lint
  • go-critic - run gocritic check-project ., requires go-critic