forked from GoogleCloudPlatform/cluster-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
131 lines (129 loc) · 3.97 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
# Copyright 2022 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
- id: terraform_validate
args:
- --hook-config=--retry-once-with-cleanup=true
- repo: local
hooks:
- id: terraform-readme
name: terraform-readme
entry: tools/autodoc/terraform_docs.sh
language: script
types: [terraform]
exclude: (\.terraform|pkg\/.*$)|(tools/validate_configs/golden_copies/.*)
pass_filenames: true
require_serial: true
- id: packer-readme
name: packer-readme
entry: tools/autodoc/terraform_docs.sh
language: script
files: ^.*\.pkr\.hcl$
exclude: (pkg\/.*$)|(tools/validate_configs/golden_copies/.*)
pass_filenames: true
require_serial: true
- id: duplicate-diff
name: duplicate-diff
entry: python3 tools/duplicate-diff.py
language: python
language_version: python3
files: '.*(\.sh|\.tf|\.tftpl|\.tpl)$'
pass_filenames: true
require_serial: true
- id: module-label-check
name: module-label-check
entry: python3 tools/label-check.py
language: python
language_version: python3
files: '.*\.tf$'
pass_filenames: false
require_serial: true
- id: addlicense
name: addlicense
language: system
entry: addlicense
args: ['-c', '"Google LLC"', '-l', 'apache']
exclude: docs/videos/healthcare-and-life-sciences/lysozyme-example/submit.sh
pass_filenames: true
- id: tests-metadata
name: tests-metadata
entry: python3 tools/cloud-build/daily-tests/validate_tests_metadata.py
language: python
language_version: python3
additional_dependencies: ['pyyaml']
files: 'tools/cloud-build/daily-tests/builds/.*\.yaml'
pass_filenames: false
require_serial: true
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-vet
- id: go-imports
- id: go-cyclo
args: [-over=13]
- id: go-unit-tests
- id: go-mod-tidy
# Disabled temporarily due to https://github.com/go-critic/go-critic/issues/1388
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v1.0.0-rc.1
# hooks:
# - id: go-critic
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.3
hooks:
- id: go-static-check
- repo: https://github.com/adrienverge/yamllint
rev: v1.34.0
hooks:
- id: yamllint
args: [-c=.yamllint, --no-warnings]
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.17
hooks:
- id: pymarkdown
# Rules at https://github.com/jackdewinter/pymarkdown/tree/main/docs/rules
# MD013 - Line length
# MD022 - Headers should be surrounded by blank lines
# MD033 - Inline HTML
# MD034 - Bare URL used
# MD041 - First line in file should be a top level header
# MD046 - Code block style
# MD024 - Multiple headings cannot contain the same content.
args: [--disable-rules, "MD013,MD022,MD033,MD034,MD041,MD046,MD024", scan]
- 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: v4.5.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
exclude: requirements.txt$|/js/|go.sum$
exclude: tools/validate_configs/golden_copies/.*