forked from domodwyer/pre-commit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-hooks.yaml
148 lines (133 loc) · 3.77 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
- id: todo-tags
name: 'TODOs have tags'
entry: todo-tags.py
types: [text]
language: 'script'
pass_filenames: true
minimum_pre_commit_version: 0.15.0
exclude: 'vendor/'
description: "Checks changes contain only TODOs with JIRA tags"
- id: todo-branch-tags
name: 'Outstanding TODOs for the current branch'
entry: run-find-branch-todos.sh
always_run: true
language: 'script'
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Prints any TODOs tagged with the ticket reference in the current branch name'
- id: branch-name-check
name: 'Branch name obeys the standardised format'
entry: run-branch-name-check.sh
always_run: true
pass_filenames: false
language: 'script'
minimum_pre_commit_version: 0.15.0
description: 'Checks branch names obeys the following regex'
- id: go-test
name: 'Go tests'
entry: run-go-test.sh
types: [go]
language: 'script'
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: "Runs `go test ./...` at the repo root"
- id: go-goimports
name: 'Check Go imports'
entry: run-go-imports.sh
types: [go]
language: 'script'
pass_filenames: true
minimum_pre_commit_version: 0.15.0
description: "Runs `goimports` on changed files"
require_serial: true
exclude: 'vendor/'
- id: go-dep-check
name: 'Dependencies are vendored (dep)'
entry: run-dep-check.sh
types: [go]
language: 'script'
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: "Runs `dep check`, ensuring all imports are vendored"
# A copy of
# https://github.com/golangci/golangci-lint/commit/09677d574ea6cd05141022aa90b88b6598bfa1a1
# without --fix forced on users.
- id: go-golangci-lint
name: 'Run golangci-lint'
description: Static analysis for Go code
entry: golangci-lint run
types: [go]
language: golang
pass_filenames: false
- id: rust-check
name: 'Cargo check'
entry: run-rust-check.sh
language: 'script'
files: Cargo\.toml|\.rs$
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Run cargo check against all features & targets'
- id: rust-clippy
name: 'Clippy lints'
entry: run-rust-clippy.sh
language: 'script'
files: Cargo\.toml|\.rs$
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Run clippy lints against rust code'
- id: rust-test
name: 'Cargo tests'
entry: run-rust-tests.sh
language: 'script'
files: Cargo\.toml|\.rs$
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Run cargo test in the repo root'
- id: rust-fmt
name: 'Cargo fmt'
entry: run-rust-fmt.sh
language: 'script'
files: \.rs$
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Run cargo fmt in the repo root'
- id: rust-doc
name: 'Cargo doc'
entry: run-rust-doc.sh
language: 'script'
files: \.rs$
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: 'Run cargo doc against public & private items'
- id: r-stylr
name: 'Format with stylr'
entry: run-r-stylr.R
language: 'script'
files: (?i)\.R$
pass_filenames: true
minimum_pre_commit_version: 0.15.0
description: 'Run stylr to format R code'
- id: r-lintr
name: 'Analyse with lintr'
entry: run-r-lintr.R
language: 'script'
files: (?i)\.R$
pass_filenames: true
minimum_pre_commit_version: 0.15.0
description: 'Run lintr against R code'
- id: buf-lint
name: 'Lint protobuf files'
entry: buf-lint.sh
types: [proto]
language: 'script'
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: "Runs buf lint at the repo root"
- id: buf-breaking
name: 'Check protobuf for breaking changes'
entry: buf-breaking.sh
types: [proto]
language: 'script'
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: "Runs buf breaking at the repo root"