pre-commit hooks fot golang
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 21 commits ahead of gabriel:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.pre-commit-hooks.yaml
README.md
run-go-build-plugin.sh
run-go-build.sh
run-go-fmt.sh
run-go-lint.sh
run-go-metalinter.sh
run-go-vet.sh
run-goimports.sh

README.md

pre-commit-golang

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

Using these hooks

In your project root dir add this to .pre-commit-config.yaml

-   repo: https://github.com/troian/pre-commit-golang
    sha: HEAD
    hooks:
    -   id: go-fmt
    -   id: go-build
    -   id: go-metalinter
        args:
        - --exclude=corefoundation.go
        - --deadline=60s
        - --vendor
        - --cyclo-over=20
        - --dupl-threshold=100
        - --disable=gotype

Available hooks

Metalinter

  • Runs on all files by default not just changed files (since the metalinter only operates on folders)
  • Use args to override default options