-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
47 lines (44 loc) · 1.94 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
47 lines (44 loc) · 1.94 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
# Pre-commit hook configuration
# Docs: https://pre-commit.com/
#
# Install:
# pip install pre-commit # or: poetry install --with lint
# pre-commit install # register the git hook
#
# Run manually against all files:
# pre-commit run --all-files
#
# Update hook revisions to latest:
# pre-commit autoupdate
default_language_version:
# Use the system 'python3' interpreter so pre-commit picks up the active
# Python in your PATH (or the project's virtualenv). This avoids failures
# when a specific patch-level interpreter like python3.11 is not installed.
python: python3
repos:
# ---------------------------------------------------------------------------
# General hygiene
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace # strip trailing whitespace
- id: end-of-file-fixer # ensure files end with a newline
- id: check-yaml # validate YAML syntax
- id: check-toml # validate TOML syntax
- id: check-json # validate JSON syntax
- id: check-merge-conflict # forbid merge-conflict markers
- id: check-added-large-files # warn on large committed files
args: ["--maxkb=1024"]
- id: debug-statements # catch leftover debugger imports
- id: mixed-line-ending
args: ["--fix=lf"]
# ---------------------------------------------------------------------------
# Ruff – fast Python linter (replaces flake8, isort, pyupgrade, …)
# ---------------------------------------------------------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.11
hooks:
- id: ruff # lint + auto-fix
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format # format (Black-compatible)