-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
169 lines (168 loc) · 4.85 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
# Copyright 2023 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
repos:
- repo: local
hooks:
- id: schema-chart
name: schema-chart
entry: make schema-chart
language: system
files: "^charts/cluster-api-runtime-extensions-nutanix/values.yaml$"
- id: go-generate
name: go-generate
entry: make go-generate
language: system
files: "(.*\\.go|go.mod|go.sum|go.mk)$"
pass_filenames: false
- id: golangci-lint
name: golangci-lint
entry: make lint
language: system
files: "(.*\\.go|go.mod|go.sum|go.mk)$"
pass_filenames: false
- id: chart-docs
name: chart-docs
entry: make chart-docs
language: system
files: "^charts/"
pass_filenames: false
- id: hugo-mod-tidy
name: hugo-mod-tidy
entry: bash -c "cd docs && hugo mod tidy"
language: system
files: "^docs/"
pass_filenames: false
- id: examples-sync
name: examples-sync
entry: make examples.sync
language: system
files: "^(hack/)?examples/"
pass_filenames: false
- id: apis-sync
name: apis-sync
entry: make apis.sync
language: system
files: "^(hack/third-party/|api/external/|make/apis.mk$)"
pass_filenames: false
- id: addons-sync
name: addons-sync
entry: make addons.sync
language: system
files: "^(hack/addons/|charts/cluster-api-runtime-extensions-nutanix/templates/.+/manifests/|make/addons.mk$)"
pass_filenames: false
- id: addons-repo-yaml
name: addons-repo-yaml
entry: make template-helm-repository
language: system
files: "hack/addons/helm-chart-bundler/repos.yaml"
pass_filenames: false
- id: check-devbox-lock
name: check-devbox-lock
entry: devbox install
language: system
files: "^devbox.(yaml|lock)$"
pass_filenames: false
- id: check-coredns-versions
name: check-coredns-versions
entry: make coredns.sync
language: system
files: "^api/versions/coredns.go$"
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-mod-tidy
exclude: ^docs/
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
stages: [pre-commit]
- id: check-yaml
args: ["-m", "--unsafe"]
stages: [pre-commit]
exclude: ^charts/.+/(templates|addons)/.+\.ya?ml$
- id: mixed-line-ending
args: ["-f", "lf"]
exclude: \.bat$
stages: [pre-commit]
- id: no-commit-to-branch
stages: [pre-commit]
- id: check-added-large-files
stages: [pre-commit]
exclude: ^pkg/handlers/cni/calico/manifests/tigera-operator-configmap.yaml$
- id: check-case-conflict
stages: [pre-commit]
- id: check-merge-conflict
stages: [pre-commit]
- id: check-executables-have-shebangs
stages: [pre-commit]
- id: check-symlinks
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
exclude: ^charts/cluster-api-runtime-extensions-nutanix/README.md$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint-system
stages: [pre-commit]
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- id: gitlint-ci
args: ["--commits", "origin/main..HEAD"]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shfmt
stages: [pre-commit]
args: ["-s", "-i", "2"]
- id: script-must-have-extension
stages: [pre-commit]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
stages: [pre-commit]
args: ["-e", "SC2211", "-x"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
stages: [pre-commit]
exclude: ^(CHANGELOG.md|charts/.+/README.md|.github/pull_request_template.md)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: License headers - Go
stages: [pre-commit]
files: "(.*\\.go|go.mod)$"
exclude: ^(api/external/|internal/test)
args:
- --license-filepath
- hack/license-header.txt
- --comment-style
- //
- --allow-past-years
- id: insert-license
name: License headers - YAML and Makefiles
stages: [pre-commit]
files: (^Makefile|\.(ya?ml|mk))$
exclude: ^(internal/test|pkg/handlers/.+/embedded|examples|charts/cluster-api-runtime-extensions-nutanix/(defaultclusterclasses|addons))/.+\.ya?ml|docs/static/helm/index\.yaml|charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml$
args:
- --license-filepath
- hack/license-header.txt
- --allow-past-years
- id: insert-license
name: License headers - Markdown
stages: [pre-commit]
files: \.md$
exclude: ^(CHANGELOG.md$|docs/|.github/pull_request_template.md$)
args:
- --license-filepath
- hack/license-header.txt
- --comment-style
- <!--|| -->
- --allow-past-years