@@ -7,64 +7,154 @@ default_stages:
77 - manual
88
99repos :
10- - repo : https://github.com/reteps/dockerfmt
11- rev : v0.3.9
10+ # ---------------------------------------------------------------------------- #
11+ # 🔄 Pre-Commit Hooks #
12+ # ---------------------------------------------------------------------------- #
13+
14+ # ## Pre-commit First-Party Tools
15+ - repo : https://github.com/pre-commit/pre-commit-hooks
16+ rev : v6.0.0
1217 hooks :
13- - id : dockerfmt
14- args :
15- # optional: add additional arguments here
16- - --indent=2
17- - --write
18- stages : [pre-commit]
19- - repo : https://github.com/scop/pre-commit-shfmt
20- rev : v3.12.0-2 # Use the latest stable revision
18+ # ------------------------------- 🌳 Git Tools ------------------------------- #
19+ - id : check-merge-conflict
20+ name : " 🌳 git · Detect conflict markers"
21+ - id : forbid-new-submodules
22+ name : " 🌳 git · Prevent submodule creation"
23+ - id : no-commit-to-branch
24+ name : " 🌳 git · Protect main branches"
25+ args : ["--branch", "main", "--branch", "master"]
26+ - id : check-added-large-files
27+ name : " 🌳 git · Block large file commits"
28+ args : ["--maxkb=5000"]
29+ # ---------------------------- 📁 Filesystem Tools --------------------------- #
30+ - id : check-executables-have-shebangs
31+ name : " 📁 filesystem/⚙️ exec · Verify shebang presence"
32+ - id : check-shebang-scripts-are-executable
33+ name : " 📁 filesystem/⚙️ exec · Verify script permissions"
34+ - id : check-symlinks
35+ name : " 📁 filesystem/🔗 symlink · Check symlink validity"
36+ - id : destroyed-symlinks
37+ name : " 📁 filesystem/🔗 symlink · Detect broken symlinks"
38+ - id : requirements-txt-fixer
39+ name : " 📁 filesystem/📝 file · Validate requirements.txt"
40+ - id : trailing-whitespace
41+ name : " 📁 filesystem/📝 file · Validate empty whitespaces"
42+ # ----------------------------- 🔒 Security Tools ---------------------------- #
43+ - id : check-json
44+ name : " 📁 filesystem/🔧 config · Validate JSON file"
45+ - id : check-yaml
46+ name : " 📁 filesystem/🔧 config · Validate YAML file"
47+ - id : detect-aws-credentials
48+ name : " 🔒 security · Detect aws credentials"
49+ args :
50+ - --allow-missing-credentials
51+ - id : detect-private-key
52+ name : " 🔒 security · Detect private kayes"
53+
54+
55+ - repo : https://github.com/gitleaks/gitleaks
56+ rev : v8.29.0
57+ hooks :
58+ - id : gitleaks
59+ name : " 🔒 security · Detect hardcoded secrets"
60+
61+ # --------------------------- 🔍 Code Quality Tools -------------------------- #
62+
63+ # ## Writing Tools ###
64+ - repo : https://github.com/crate-ci/typos
65+ rev : v1.38.1
66+ hooks :
67+ - id : typos
68+ name : " ✏️ typos · Checking typos"
69+ args : [--force-exclude]
70+
71+
72+ # ## Python Tools ###
73+ - repo : https://github.com/astral-sh/ruff-pre-commit
74+ rev : v0.14.3
2175 hooks :
22- - id : shfmt
23- # Optional: Add arguments to shfmt if needed, e.g., to enable "simplify" mode
24- args : ["-s"]
25- stages : [pre-commit]
76+ - id : ruff-format
77+ name : " 🐍 python · Format python"
78+ - id : ruff-check
79+ name : " 🐍 python · Lint python"
80+
81+
82+ # ## Workflow Validation ###
83+ - repo : https://github.com/python-jsonschema/check-jsonschema
84+ rev : 0.35.0
85+ hooks :
86+ - id : check-github-workflows
87+ name : " 🐙 github-actions · Validate gh workflow files"
88+ args : ["--verbose"]
89+
90+ - repo : https://github.com/rhysd/actionlint
91+ rev : v1.7.8
92+ hooks :
93+ - id : actionlint
94+ name : " 🐙 github-actions · Lint gh workflow files"
95+ args : ["-shellcheck=enable=all"]
96+
97+
98+ # ## Markdown ###
2699 - repo : https://github.com/hukkin/mdformat
27- rev : 1.0.0 # Use the ref you want to point at
100+ rev : 1.0.0
28101 hooks :
29102 - id : mdformat
30- # Optionally add plugins
103+ name : " 📝 markdown · Format markdown "
31104 additional_dependencies :
32105 - mdformat-gfm
33- - mdformat-black
34- stages : [pre-commit]
106+ - mdformat-ruff
107+ - ruff
108+
35109 - repo : https://github.com/igorshubovych/markdownlint-cli
36110 rev : v0.45.0
37111 hooks :
38- - id : markdownlint
39- args : [--fix]
40- stages : [pre-commit]
41- - repo : https://github.com/astral-sh/ruff-pre-commit
42- rev : v0.14.3
112+ - id : markdownlint
113+ name : " 📝 markdown · Lint markdown"
114+ args : [--fix]
115+
116+
117+ # ## Docker Tools ###
118+ - repo : https://github.com/reteps/dockerfmt
119+ rev : v0.3.9
43120 hooks :
44- - id : ruff-format
45- stages : [pre-commit]
46- - id : ruff-check
47- - repo : https://github.com/rhysd/actionlint
48- rev : v1.7.7
121+ - id : dockerfmt
122+ name : " 🐳 docker · Format docker"
123+ args :
124+ - --indent=2
125+ - --write
126+
127+
128+ # ## Shell ###
129+ - repo : https://github.com/scop/pre-commit-shfmt
130+ rev : v3.12.0-2 # Use the latest stable revision
49131 hooks :
50- - id : actionlint
51- args : ["-shellcheck=enable=all"]
52- - repo : https://github.com/crate-ci/typos
53- rev : v1.38.1
132+ - id : shfmt
133+ name : " 🐚 shell · Format shell scripts"
134+ args : ["-s"]
135+
136+
137+ # --------------------------- ✍️ Git Commit Quality -------------------------- #
138+
139+ # ## Commit Message Standards ###
140+ - repo : https://github.com/commitizen-tools/commitizen
141+ rev : v4.1.0
54142 hooks :
55- - id : typos
56- args : [--force-exclude]
143+ - id : commitizen
144+ name : " 🌳 git · Validate commit message"
145+ additional_dependencies : [cz-conventional-gitmoji]
146+
57147 - repo : local
58148 hooks :
59- - id : signoff-commit
60- name : Sign-off Commit
61- entry : bash
62- args :
63- - -c
64- - |
65- if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" "$(git rev-parse --git-path COMMIT_EDITMSG)"; then
66- printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> "$(git rev-parse --git-path COMMIT_EDITMSG)"
67- fi
68- language : system
69- verbose : true
70- stages : [commit-msg]
149+ - id : signoff-commit
150+ name : Sign-off Commit
151+ entry : bash
152+ args :
153+ - -c
154+ - |
155+ if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" "$(git rev-parse --git-path COMMIT_EDITMSG)"; then
156+ printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> "$(git rev-parse --git-path COMMIT_EDITMSG)"
157+ fi
158+ language : system
159+ verbose : true
160+ stages : [commit-msg]
0 commit comments