This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
66 lines (62 loc) · 1.87 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Lints should have the "manual" stage set - this flags them to run in the CI
# pipeline.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-executables-have-shebangs
stages: [commit, manual]
exclude: ^vendor/
- id: check-json
stages: [commit, manual]
- id: check-yaml
stages: [commit, manual]
- id: check-merge-conflict
stages: [commit, manual]
- id: mixed-line-ending
args: ["--fix=no"]
stages: [commit, manual]
- id: no-commit-to-branch
args: ["--branch", "master", "--branch", "development"]
stages: [commit, manual]
- repo: https://github.com/domodwyer/pre-commit
rev: v1.5.0
hooks:
- id: go-test
stages: [commit, push]
types: [go]
exclude: \.pb.go$
args: ["-timeout=30s"]
- id: goimports
stages: [commit, push, manual]
types: [go]
exclude: \.pb.go$
args: ["-local=code.storageos.net"]
- id: todo-tagged-jira
stages: [push, manual]
types: [go]
args: ["--tag=CP"]
exclude: ^vendor/
- id: todo-branch-tags
stages: [post-checkout]
args: ["CP-[0-9]+"]
- id: branch-name-check
args: ['^((feature|bugfix)\/|release\/v[0-9]+\.[0-9]+\.[0-9]+)']
stages: [push]
- repo: https://github.com/golangci/golangci-lint
rev: v1.21.0
hooks:
- id: golangci-lint
args: [--new-from-rev=origin/master]
stages: [commit, push]
types: [go]
exclude: \.pb.go$
# A CI-only lint that runs golang-ci on all the code
- repo: local
hooks:
- id: golangci-lint
name: Run golang-ci lints on all code
stages: [manual]
language: system
entry: sh -c 'golangci-lint run --timeout=5m ./...'
pass_filenames: false