forked from fluxninja/aperture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
170 lines (170 loc) · 5.54 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# If not configured otherwise, only run on commits
default_stages:
- commit
repos:
- repo: local
hooks:
- id: tools
name: "Install tools"
entry: "./scripts/precommit/install_tools.sh"
language: script
always_run: true
pass_filenames: false
description: "Install tools"
- id: proto
name: "Proto"
entry: "./scripts/precommit/generate_api.sh"
language: script
files: '\.proto$'
pass_filenames: false
description: "Protobuf generation"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
exclude: ^(manifests/charts/.*/README*)|\.*svg$|\.*dot|api/gen/.*|sdks/aperture-java/lib/core/src/main/java/com/fluxninja/generated/.*$
- id: end-of-file-fixer
exclude: ^(docs/|manifests/charts/.*/README*)|\.*svg$|\.*dot|api/gen/.*|sdks/aperture-java/lib/core/src/main/java/com/fluxninja/generated/.*$
- id: check-yaml
exclude: ^(manifests/charts/.*/(templates|files)/.*|playground/tanka/charts/.*)
args:
- "--allow-multiple-documents"
- id: check-added-large-files
exclude: ^(operator/config/crd/.*|docs/content/assets/.*)
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-json
- id: detect-private-key
# These certs are used for ValidatingWebhook, and used within a cluster,
# so it should be fine to have them in repo
exclude: ^certs/(ca.key|key.pem)$
- id: mixed-line-ending
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.17
hooks:
- id: shellcheck
exclude: ^(sdks/aperture-java/gradlew)$
- repo: https://github.com/fluxninja/pre-commit-hooks.git
rev: v0.0.3
hooks:
- id: circleci-validate
- repo: https://github.com/fluxninja/pre-commit-golang
rev: v1.0.0-fn
hooks:
- id: go-generate
- id: go-mod-tidy-repo
args:
- -compat=1.20
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
exclude: ^(docs/content/references/.*|manifests/charts/.*/README*|.github/.*/.*.md)
types_or:
[
sh,
shell,
bash,
zsh,
dockerfile,
makefile,
json,
java,
markdown,
jsonnet,
python3,
terraform,
mdx,
]
# local hooks
- repo: local
hooks:
- id: golangci-lint
name: Run golangci-lint
entry: ./scripts/golangci_lint.sh
language: script
pass_filenames: false
require_serial: false
types:
- go
stages:
- commit
args:
- --fix
- id: generate-helm-readme
name: "Helm Readme"
entry: "./scripts/precommit/generate_helm_readme.sh"
language: script
files: "values.yaml$"
pass_filenames: false
description: "Generate helm readme"
- id: generate-swagger
name: "Config Swagger"
entry: "./scripts/precommit/generate_swagger.sh"
language: script
files: '\.proto$|\.go$'
pass_filenames: false
description: "Generate swagger"
- id: generate-config-markdown
name: "Config Markdown"
entry: "./scripts/precommit/generate_config_markdown.sh"
language: script
files: '\.proto$|\.go$'
pass_filenames: false
description: "Generate config markdown"
- id: generate-blueprints
name: "Generate Blueprints"
entry: "./scripts/precommit/generate_blueprints.sh"
language: script
files: ^(blueprints)|\.proto$|^requirements.txt$
pass_filenames: false
description: "Generate Aperture libsonnet and blueprints"
- id: generate-doc-assets
name: "Documentation Assets"
entry: "./scripts/precommit/generate_doc_assets.sh"
language: script
files: ^(blueprints|docs)
pass_filenames: false
description: "Generate documentation assets"
- id: tanka-show
name: "Check tanka parses jsonnet"
language: script
entry: ./scripts/precommit/check_tanka_show.sh
pass_filenames: false
files: ^(playground/tanka/|blueprints)
types_or:
- jsonnet
- json
- yaml
- id: tanka-fmt
name: "Tanka fmt"
exclude: ^(playground/tanka/lib/apps/aperture-grafana/.*)
language: system
entry: tk
args:
- fmt
types:
- jsonnet
- id: helmlint
name: "Helm Lint"
description: Run helm lint, a linter for helm charts
entry: ./scripts/precommit/helmlint.sh
language: script
- id: check-operator-spec-changes
name: "Check Operator Spec Changes"
description: Checking if the Operator spec is changed
entry: ./scripts/precommit/check-operator-spec.sh
language: script
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
args:
- --ignore-words=./.codespellignore
exclude: ^(.*\.svg|yarn.lock|go.sum|.circleci/.*|docs/content/references/api/.*|api/gen/.*|sdks/aperture-java/lib/core/src/main/java/com/fluxninja/generated/.*)$