-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
175 lines (158 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
171
172
173
174
175
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# # Ansible lint roles
# - repo: https://github.com/zerodowntime/ansible-lint-roles-precommit-hook.git
# rev: v1.0.0
# hooks:
# - id: ansible-lint-roles
# files: /tasks/ # reflects tasks
# exclude: (roles.d) # I have own roles in `roles` dir and 3rd-party roles in `roles.d`
# args: [-c, .ansible-lint.yml]
# stages: [commit]
# Ansible lint playbooks
- repo: https://github.com/ansible/ansible-lint.git
rev: v5.3.2
hooks:
- id: ansible-lint
name: Ansible lint for playbooks
types: [text, yaml] # reflects yaml changes
files: /playbooks/ # we have all playbooks in 1 dir so we can contrain its path
args: [-c, .ansible-lint.yml]
pass_filenames: true
always_run: false
#stages: [manual] # I have it manually because in playbooks I use `lookup env pwd` which breaks my paths
stages: [commit]
# Ansible lint inventory
- repo: https://github.com/ansible/ansible-lint.git
rev: v5.3.2
hooks:
- id: ansible-lint
name: Ansible lint for inventory
types: [text, yaml] # reflects yaml changes
files: /inventory/
exclude: vault
args: [-c, .ansible-lint.yml]
pass_filenames: true
always_run: false
stages: [commit]
# - repo: https://github.com/ansible/ansible-lint.git
# rev: v4.2.0
# hooks:
# - id: ansible-lint
# name: ansible-lint-NG
# # always_run: true
# pass_filenames: false
# # files: \.(yaml|yml)$
# types: [text, yaml]
# # verbose: true
# args: [-c, .ansible-lint.yml]
# #entry: env ANSIBLE_LIBRARY=./library ansible-lint --force-color -p
# #entry: ansible-lint
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.20.0
# hooks:
# - id: yamllint
# files: \.(yaml|yml)$
# types: [file, yaml]
# entry: yamllint --strict -f parsable
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: detect-private-key
- id: fix-byte-order-marker
- id: check-yaml
exclude: templates/
#files: .*\.(yaml|yml)$
- id: requirements-txt-fixer
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix, lf]
# - id: check-executables-have-shebangs
# - id: debug-statements
# - id: flake8
# github.com/jumanjihouse/pre-commit-hooks
# markdownlint
# shellcheck
#
# github.com/Lucas-C/pre-commit-hooks-nodejs
# markdown-toc
#
# github.com/detailyang/pre-commit-shell
# shell-lint
#
# github.com/bemeurer/beautysh
# beautysh
#
# github.com/antonbabenko/pre-commit-terraform
# terraform_fmt # Rewrites all Terraform configuration files to a canonical format.
# terraform_docs # Inserts input and output documentation into README.md (using terraform-docs).
# terraform_docs_without_aggregate_type_defaults # Inserts input and output documentation into README.md (using terraform-docs).
# terraform_docs_replace # Overwrite content of README.md with terraform-docs.
# terraform_validate # Validates all Terraform configuration files.
# terraform_tflint # Validates all Terraform configuration files with TFLint.
# terragrunt_fmt # Rewrites all Terragrunt configuration files to a canonical format.
#
# github.com/openstack-dev/bashate
# bashate - This hook runs bashate for linting shell scripts
#
# github.com/codespell-project/codespell
# codespell - Checks for common misspellings in text files.
#
#- repo: https://github.com/openstack-dev/bashate
- repo: https://github.com/openstack/bashate
rev: 2.1.0
hooks:
- id: bashate
name: bashate
description: This hook runs bashate for linting shell scripts
entry: bashate
language: python
types: [shell]
verbose: true
- repo: https://github.com/milin/giticket
rev: v1.3
hooks:
- id: giticket
args: ["--regex=TOK-[0-9]", "--format={ticket} {commit_msg}"] # Optional
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier
- repo: https://github.com/zricethezav/gitleaks
rev: v8.2.7
hooks:
- id: gitleaks
args:
# - --config-path
# - .gitleaks.toml
- --verbose
- repo: https://github.com/gruntwork-io/pre-commit
# Pin to v0.1.11 because v0.1.12 broke terraform-fmt. It no longer persists formatting changes to disk.
# See: https://github.com/gruntwork-io/pre-commit/releases/tag/v0.1.12
rev: v0.1.17 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
hooks:
- id: terraform-fmt
- id: terraform-validate
- id: tflint #requires: tflint.hcl
#- id: shellcheck
- id: gofmt
- id: terragrunt-hclfmt
- repo: https://github.com/golangci/golangci-lint
rev: v1.54.0
hooks:
- id: golangci-lint
- repo: https://github.com/gruntwork-io/pre-commit
hooks:
- id: helmlint
rev: v0.1.9
- repo: https://github.com/norwoodj/helm-docs
hooks:
- id: helm-docs
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
rev: v1.3.0