Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (54 loc) · 2.49 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
60 lines (54 loc) · 2.49 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
48
49
50
51
52
53
54
55
56
57
58
59
60
# Repo-wide hygiene gate. Run over the whole tree by `uv run poe pre-commit`,
# the first step of `uv run poe all`. Nothing installs an actual git hook --
# that stays a per-developer `pre-commit install` if you want it.
#
# Everything language-specific already has its own poe task backed by a version
# pinned in pyproject.toml's `lint` dependency group -- ruff, mypy, pyright,
# bandit, pip-audit, complexipy. Duplicating any of them here would mean a
# second, independently-pinned copy drifting from the one CI runs, so this file
# deliberately stays limited to the checks nothing else covers.
repos:
# General pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# --- whitespace -----------------------------------------------------
# .patch/.diff are excluded throughout: trailing whitespace inside a
# hunk is content, and git's "-- \n" signature separator is load-bearing.
# Rewriting either corrupts the patch.
- id: trailing-whitespace
exclude: ^.*\.(patch|diff)$
- id: end-of-file-fixer
exclude: ^.*\.(patch|diff)$
- id: mixed-line-ending
args: ['--fix=lf']
exclude: ^.*\.(patch|diff)$
# --- parseability of the files that configure everything else -------
- id: check-yaml
- id: check-toml
- id: check-json
# --- python ---------------------------------------------------------
- id: debug-statements
- id: name-tests-test
args: ['--pytest-test-first']
# tests/unit/fakes.py holds the shared test doubles. It cannot be a
# conftest.py -- pytest registers every conftest under the bare name
# 'conftest', so a second one would collide in sys.modules with
# tests/conftest.py, which the whole e2e suite imports by that name.
exclude: ^tests/unit/fakes\.py$
# --- scripts --------------------------------------------------------
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
# --- repo integrity -------------------------------------------------
- id: detect-private-key
- id: check-added-large-files
args: ['--maxkb=500', '--enforce-all']
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: forbid-submodules
# Configuration
# Minimum pre-commit version -- matches the floor pyproject.toml's `lint`
# dependency group pins.
minimum_pre_commit_version: '4.0.0'