forked from dnephin/pre-commit-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-hooks.yaml
63 lines (63 loc) · 1.81 KB
/
.pre-commit-hooks.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
- id: go-fmt
name: 'go fmt'
entry: run-go-fmt.sh
files: '\.go$'
language: 'script'
description: "Runs `gofmt`, requires golang"
- id: go-vet
name: 'go vet'
entry: run-go-vet.sh
files: '\.go$'
language: 'script'
description: "Runs `go vet`, requires golang"
- id: go-lint
name: 'go lint'
entry: run-go-lint.sh
files: '\.go$'
language: 'script'
description: "Runs `golint`, requires https://github.com/golang/lint"
- id: validate-toml
name: 'validate toml'
entry: 'tomlv'
files: '\.toml$'
language: 'system'
description: >
Runs `tomlv`, requires https://github.com/BurntSushi/toml/tree/master/cmd/tomlv"
- id: 'no-go-testing'
name: "Check files aren't using go's testing package"
entry: 'testing\.T'
files: 'test_.*\.go$'
language: 'pygrep'
description: >
Checks that no files are using `testing.T`, if you want developers to use
a different testing framework
- id: gometalinter
name: 'gometalinter'
entry: run-gometalinter.sh
files: '\.go$'
language: 'script'
description: ""
- id: golangci-lint
name: 'golangci-lint'
entry: run-golangci-lint.sh
files: '\.go$'
language: 'script'
description: "Runs `golangci-lint`, requires https://github.com/golangci/golangci-lint"
- id: go-critic
name: 'go-critic'
entry: run-go-critic.sh
files: '\.go$'
language: 'script'
description: "Runs `go-critic`, requires https://github.com/go-critic/go-critic"
- id: go-unit-tests
name: 'go-unit-tests'
entry: run-go-unit-tests.sh
files: '\.go$'
language: 'script'
description: "Runs `go test`"
- id: go-build
name: 'go-build'
entry: run-go-build.sh
files: '\.go$'
language: 'script'
description: "Runs `go build`, requires golang"