-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
95 lines (95 loc) · 2.43 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
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-xml
- id: check-yaml
args: [ '--allow-multiple-documents', '--unsafe' ]
exclude: |
(?x)^(
.*/templates/.*.yaml|
.*.template.yaml
)$
- id: check-toml
- id: check-json
- id: check-added-large-files
- id: check-case-conflict
- id: detect-aws-credentials
args: [ '--allow-missing-credentials' ]
- id: detect-private-key
- id: check-executables-have-shebangs
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.25
hooks:
# TODO enabled when tofu is supported
# - id: terraform-fmt
# - id: terraform-validate
- id: terragrunt-hclfmt
- id: tflint
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.97.3
hooks:
- id: terraform_trivy
args:
- --args=-s=CRITICAL
- --args=--ignorefile=__GIT_WORKING_DIR__/.trivyignore.yaml
- id: terraform_fmt
# - id: terrascan
# - id: tfupdate
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: forbid-binary
exclude: |
(?x)^(
.*.(png|jpg)
)$
- id: git-check
# TODO reenable when ruby3.0 is not required
# - id: markdownlint
- id: require-ascii
exclude: |
(?x)^(
.*.(lock)
)$
- id: shellcheck
- id: shfmt
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
entry: yamllint --strict
- repo: local
hooks:
- id: ansible-lint
name: Ansible-lint
description: |
This hook runs ansible-lint on selected ansible playbooks and roles.
Do not use https://github.com/ansible/ansible-lint.git default pre-commit b/c its autodetect feature
does not correctly detect plays and roles and it always traverse entire subdirectory
entry: ansible-lint --force-color
language: python
pass_filenames: true
always_run: false
files: |
(?x)^(
ansible\/[^/]*\/[^/]*yaml|
ansible/.*/roles/.*/tasks/.*(yaml|yml)|
k8s/(jenkins|istio)/(deploy|ensure|roles/.*/tasks).*.(yaml|yml)
)$
exclude: |
(?x)^(
.*/templates/.*.yaml|
.*.template.yaml
)$
additional_dependencies:
- .[community,yamllint]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: ruff # linter
args: [ --fix ]
- id: ruff-format # formatter