-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
53 lines (51 loc) · 1.88 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
53 lines (51 loc) · 1.88 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '\.drawio$'
- id: check-yaml
exclude: 'charts/.*/templates/.*\.yaml$'
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-unit-tests
- id: go-build
- id: go-mod-tidy
- repo: local
hooks:
- 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 import formatting"; 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 linting"; fi'
language: system
pass_filenames: false
files: \.go$
- id: gosec
name: gosec (security scanner)
entry: bash -c 'command -v gosec >/dev/null 2>&1 && gosec ./... || echo "⚠️ gosec not installed, skipping security scan"'
language: system
pass_filenames: false
files: \.go$
- id: helm-unittest
name: helm-unittest (optional)
entry: bash -c 'if helm plugin list 2>/dev/null | grep -q unittest; then helm unittest charts/batch-gateway; else echo "helm-unittest not installed, skipping"; fi'
language: system
pass_filenames: false
files: 'charts/.*\.(yaml|tpl)$'