-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
31 lines (29 loc) · 1.26 KB
/
.pre-commit-config.yaml
File metadata and controls
31 lines (29 loc) · 1.26 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
repos:
# Ruff: ultra-fast linter that replaces flake8, isort, pyupgrade, etc.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff
args: ["--fix"] # Auto-fixes issues when possible
# Pre-commit hooks: general file hygiene and safety checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict # Fails on unresolved merge conflicts
- id: end-of-file-fixer # Ensures one trailing newline
- id: trailing-whitespace # Removes trailing whitespace
- id: mixed-line-ending
args: [--fix=lf] # Enforces Unix-style LF endings
- id: check-added-large-files
args: ["--maxkb=1500"] # Blocks files >1500 KB
- id: detect-private-key # Prevents committing private keys
- id: debug-statements # Catches print() and breakpoint()
- id: check-yaml # Verifies valid YAML syntax
- id: check-toml # Verifies valid TOML syntax
- id: check-json # Verifies valid JSON syntax
# Commitizen: enforce Conventional Commits in commit messages
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.24.0
hooks:
- id: commitizen
stages: [commit-msg] # Runs only on commit message to validate format