repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-merge-conflict - id: mixed-line-ending args: [--fix=lf] # Local Go hooks. dnephin go-vet runs `go vet` at the repo root, which reports # "no Go files" here (all code is under cmd/ and internal/), so vet ./... # instead. - repo: local hooks: - id: go-fmt name: go fmt entry: bash -c 'test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; }' language: system pass_filenames: false types: [go] - id: go-vet name: go vet entry: go vet ./... language: system pass_filenames: false types: [go] - id: go-test name: go test entry: go test ./... language: system pass_filenames: false types: [go]