forked from rossoctl/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
51 lines (48 loc) · 1.59 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
51 lines (48 loc) · 1.59 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
args: ['--maxkb=1024']
exclude: ^kagenti-operator/bin/
- id: check-yaml
# Exclude Helm templates as they contain Go template syntax
exclude: ^charts/.*/templates/.*\.yaml$
- id: check-json
- id: check-merge-conflict
- id: mixed-line-ending
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
files: ^charts/
- repo: local
hooks:
# Kagenti Operator hooks
- id: go-fmt
name: go-fmt
entry: bash -c 'cd kagenti-operator && go fmt ./...'
language: system
files: ^kagenti-operator/.*\.go$
pass_filenames: false
- id: go-vet
name: go-vet
entry: bash -c 'cd kagenti-operator && go vet ./...'
language: system
files: ^kagenti-operator/.*\.go$
pass_filenames: false
- id: go-mod-tidy
name: go-mod-tidy
entry: bash -c 'cd kagenti-operator && go mod tidy'
language: system
files: ^kagenti-operator/(go\.mod|go\.sum)$
pass_filenames: false
# Kubernetes YAML validation
- id: k8s-yaml-validate
name: validate k8s yamls
entry: bash -c 'find kagenti-operator/config -name "*.yaml" -not -path "*/samples/*" -exec kubectl --dry-run=client apply -f {} \;'
language: system
files: ^kagenti-operator/config/.*\.yaml$
pass_filenames: false