Skip to content

Commit 6911b50

Browse files
committed
Sync pre-commit YAML configs
1 parent 77c8e72 commit 6911b50

2 files changed

Lines changed: 107 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: check-vcs-permalinks
10+
- id: check-symlinks
11+
- id: destroyed-symlinks
12+
- id: detect-private-key
13+
- id: check-merge-conflict
14+
15+
# ✅ Python code formatter
16+
- repo: https://github.com/psf/black
17+
rev: 23.9.1
18+
hooks:
19+
- id: black
20+
args: [--line-length=88]
21+
22+
# ✅ Import sorter (runs before Black)
23+
- repo: https://github.com/PyCQA/isort
24+
rev: 5.12.0
25+
hooks:
26+
- id: isort
27+
args: ["--profile=black"]
28+
29+
# ✅ Linter (flake8 for code quality)
30+
- repo: https://github.com/pycqa/flake8
31+
rev: 6.1.0
32+
hooks:
33+
- id: flake8
34+
args:
35+
- --max-line-length=88
36+
- --extend-ignore=E203,W503
37+
additional_dependencies:
38+
- flake8-bugbear
39+
- flake8-comprehensions
40+
- flake8-docstrings
41+
42+
# ✅ Type checking
43+
- repo: https://github.com/pre-commit/mirrors-mypy
44+
rev: v1.10.0
45+
hooks:
46+
- id: mypy
47+
args: ["--ignore-missing-imports", "--strict"]
48+
49+
# ✅ Security scanning (Bandit)
50+
- repo: https://github.com/PyCQA/bandit
51+
rev: 1.7.5
52+
hooks:
53+
- id: bandit
54+
args: ["-ll", "-r", "."]
55+
56+
# ✅ Detect secrets in code
57+
- repo: https://github.com/gitleaks/gitleaks
58+
rev: v8.21.0
59+
hooks:
60+
- id: gitleaks
61+
args: ["detect", "--verbose"]
62+
63+
# ✅ Static code analysis for Python (pylint optional)
64+
- repo: https://github.com/pycqa/pylint
65+
rev: v3.2.6
66+
hooks:
67+
- id: pylint
68+
args: ["--disable=C0114,C0115,C0116"] # disable docstring warnings
69+
additional_dependencies:
70+
- pylint-django
71+
- pylint-flask
72+
73+
# ✅ Spell checking for docs, code comments, configs
74+
- repo: https://github.com/codespell-project/codespell
75+
rev: v2.2.5
76+
hooks:
77+
- id: codespell
78+
files: ^.*\.(py|c|h|md|rst|yml|go|sh|sql|tf|yaml)$
79+
args: ["--ignore-words-list", "hist,nd,bu,maks,gir"]
80+
81+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
repos:
2+
- repo: https://github.com/terraform-docs/terraform-docs
3+
rev: "v0.16.0"
4+
hooks:
5+
- id: terraform-docs-go
6+
args: ["markdown", "table", "--output-file", "README.md", "./"]
7+
- repo: https://github.com/antonbabenko/pre-commit-terraform
8+
rev: "v1.74.1"
9+
hooks:
10+
- id: terraform_fmt
11+
- id: terraform_tflint
12+
- id: terraform_validate
13+
- id: terraform_tfsec
14+
- repo: https://github.com/codespell-project/codespell
15+
rev: v2.2.5
16+
hooks:
17+
- id: codespell
18+
files: ^.*\.(py|c|h|md|rst|yml|go|sh|sql|tf|yaml)$
19+
args: ["--ignore-words-list", "hist,nd"]
20+
- repo: https://github.com/gitleaks/gitleaks
21+
rev: v8.21.0
22+
hooks:
23+
- id: gitleaks
24+
args: ["detect", "--verbose"]
25+
26+

0 commit comments

Comments
 (0)