-
Notifications
You must be signed in to change notification settings - Fork 5
/
.pre-commit-config.yaml
42 lines (38 loc) · 1.06 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
default_stages:
- commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- repo: local
hooks:
- id: local-go-fmt
name: 'go fmt'
entry: sh/gofmt.sh
language: 'script'
description: "Go Format"
- id: local-go-build-modtidy
name: 'go build & go mod tidy'
entry: sh/go-build-modtidy.sh
language: 'script'
description: "Go build & go mod tidy"
- id: local-go-imports
name: 'tidy imports'
entry: sh/goimports.sh
language: 'script'
description: "Go imports"
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.3.5
hooks:
- id: go-vet
exclude: _examples
- id: go-cyclo
exclude: _examples
args: [ "-over", "15", "-ignore", ".pb.go" ]
- id: golangci-lint
args: ["-e", "SA1019"]
- id: go-unit-tests
args: ["-race", "./..."]
stages: [ push ] # only run tests on push, not on commit