-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
189 lines (183 loc) · 4.7 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
189 lines (183 loc) · 4.7 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
hooks:
- id: terraform_fmt
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
files: ^modules/
exclude: (tests/fixtures/|tools/lockfile/|^fast)
- repo: local
hooks:
- id: cff-readme
name: Regenerate README.md with tfdoc.py
entry: tools/pre-commit-tfdoc.sh
language: python
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
# types: [terraform]
files: ^(modules|fast).*(tf|README.md)$
pass_filenames: true
require_serial: true
- id: licenese
name: Check license presence and other boilerplate checks
language: python
entry: tools/check_boilerplate.py
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
pass_filenames: true
args:
- --scan-files
- id: tflint-fast
name: Checking FAST code with tflint
entry: tools/tflint-fast.py
language: python
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
pass_filenames: true
require_serial: true
- id: versions
name: Align Terraform/OpenTofu provider versions
language: python
additional_dependencies:
- click
files: (versions.tf|^default-versions.tf|versions.tofu|default-versions.tofu)$
pass_filenames: false
entry: tools/versions.py --quiet
- id: check-names
name: Check name lengths for FAST
language: python
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
pass_filenames: false
files: ^fast
entry: tools/check_names.py --prefix-length=10 --failed-only fast/stages
- id: check-yaml-schema
name: Check schema for YAML files
language: python
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
pass_filenames: false
files: ^(fast|modules)
entry: tools/check_yaml_schema.py modules fast
- id: check-schema-docs
name: Check Markdown generated from JSON schemas
language: python
additional_dependencies:
- click
pass_filenames: false
files: ^(fast|modules).*schema\.json$
entry: tools/check_schema_docs.py --no-show-summary modules fast
- id: check-links
name: Check links in markdown files
language: python
additional_dependencies:
- click
- ghapi
- iso8601
- marko
- requests
- yamale
- jsonschema
- BeautifulSoup4
entry: tools/check_links.py --no-show-summary --scan-files
- id: duplicate-diff
name: duplicate-diff
entry: python3 tools/duplicate-diff.py
language: python
language_version: python3
files: '.*(\.sh|\.tf|\.tftpl|\.tpl|\.yaml)$'
pass_filenames: true
require_serial: true
- repo: https://github.com/adrienverge/yamllint
rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # v1.37.0
hooks:
- id: yamllint
args: ["-c=.yamllint", "--no-warnings"]
exclude: |
(?x)^(
/templates/.*|
modules/cloud-config-container/.*|
.*/0-org-setup/assets/workflow-.*\.yaml
)$
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: "3.0.0"
hooks:
- id: script-must-have-extension
- id: shellcheck
- id: shfmt
exclude: ".*tpl"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
args:
- --allow-multiple-documents
exclude: |
(?x)^(
/templates/.*|
modules/cloud-config-container/.*|
.*/0-org-setup/assets/workflow-.*\.yaml
)$
- repo: https://github.com/google/yapf/
rev: v0.40.2
hooks:
- id: yapf
require_serial: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
exclude: (requirements.txt$|excalidraw$|package-lock\.json$|go\.sum$|^CHANGELOG.md$)