generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
62 lines (62 loc) · 2.47 KB
/
.pre-commit-config.yaml
File metadata and controls
62 lines (62 loc) · 2.47 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
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: "v8.28.0"
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: detect-private-key
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/bridgecrewio/checkov
rev: "3.2.457"
hooks:
- id: checkov
args: ["--config-file", ".config/.checkov.yml", "--quiet"]
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: "v1.99.5"
hooks:
- id: terraform_docs
args:
# Uses antonbabenko/pre-commit-terraform (supports monorepo with multiple modules)
# --hook-config: antonbabenko wrapper settings for file handling
- --hook-config=--add-to-existing-file=true # Update existing README.md files (requires BOTH <!-- BEGIN_TF_DOCS --> and <!-- END_TF_DOCS --> markers)
- --hook-config=--create-file-if-not-exist=false # Don't create new README.md files
# --args: terraform-docs binary arguments
- --args=--config=.config/.terraform-docs.yml # Use our terraform-docs config file
- --args=--lockfile=false # Ignore .terraform.lock.hcl, use versions.tf instead (fixes version mismatches)
- id: terraform_validate
args:
- --tf-init-args=-upgrade # Always upgrade to match versions.tf (source of truth)
- --hook-config=--retry-once-with-cleanup=true # If validation fails, delete corrupted .terraform dirs and retry
- --args=-no-color # Cleaner output
- id: terraform_fmt
- id: terraform_tflint
- repo: https://github.com/lycheeverse/lychee
rev: "v0.15.1"
hooks:
- id: lychee
name: Check links in staged markdown files
args: ["--config", ".config/lychee.toml", "--no-progress"]
types: [markdown]
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: "v0.14.0"
hooks:
- id: markdownlint-cli2
name: Lint staged markdown files
args: ["--config", ".config/.markdownlint-cli2.jsonc", "--fix"]
types: [markdown]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/pylint-dev/pylint
rev: v3.3.2
hooks:
- id: pylint
exclude: ^assets/packer/ # Exclude legacy packer scripts from linting