-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
63 lines (61 loc) · 1.99 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
63 lines (61 loc) · 1.99 KB
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
repos:
# general pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
exclude: 'charts/.*/templates/.*\.yaml$'
- id: check-json
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-case-conflict
# Go pre-commit hooks
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-mod-tidy
# Local Go hooks
- repo: local
hooks:
- id: go-build
name: go build
entry: bash -c 'go build $(go list ./... | grep -v /test/)'
language: system
pass_filenames: false
files: \.go$
- id: go-vet
name: go vet
entry: go vet ./...
language: system
pass_filenames: false
files: \.go$
- id: go-imports
name: goimports (optional)
entry: bash -c 'if command -v goimports >/dev/null 2>&1; then goimports -w .; else echo "goimports not installed, skipping"; fi'
language: system
pass_filenames: false
files: \.go$
- id: golangci-lint
name: golangci-lint (optional)
entry: bash -c 'if command -v golangci-lint >/dev/null 2>&1; then golangci-lint run --timeout=5m ./...; else echo "golangci-lint not installed, skipping"; fi'
language: system
pass_filenames: false
files: \.go$
- id: gosec
name: gosec (optional)
entry: bash -c 'if command -v gosec >/dev/null 2>&1; then gosec ./...; else echo "gosec not installed, skipping"; fi'
language: system
pass_filenames: false
files: \.go$
- id: release-notes-lint
name: release-note fragments
entry: ./hack/lint-release-notes.sh
language: system
pass_filenames: false
files: ^release-notes\.d/unreleased/.*\.md$