-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
41 lines (36 loc) · 1.21 KB
/
.pre-commit-config.yaml
File metadata and controls
41 lines (36 loc) · 1.21 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
# Exclude specific directories from pre-commit checks
exclude: "docs/"
repos:
# Pre-commit hooks for general code quality checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml # Validate YAML files
- id: debug-statements # Detect debug statements (e.g., print, pdb)
- id: end-of-file-fixer # Ensure files end with a newline
- id: trailing-whitespace # Remove trailing whitespace
- id: check-builtin-literals # Check for unnecessary use of built-in literals
- id: mixed-line-ending # Fix mixed line endings
args:
- --fix=lf # Convert to LF line endings
# Sort imports automatically
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
- id: isort
# Format Python code with Black
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
# Lint Python code with Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.7
hooks:
- id: ruff
# Upgrade Python syntax to modern versions
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py39-plus] # Target Python 3.9+ syntax