forked from ChelseaKR/queer-the-stacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
56 lines (53 loc) · 2.09 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
56 lines (53 loc) · 2.09 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
# Local pre-commit mirror of the CI gates that can run fast and staged-only:
# secret scan (gitleaks) + lint/format (ruff) + file hygiene + typecheck
# (mypy, BL-16). This does not replace `make verify` (test/a11y/eval still
# need the full local environment) — it just catches the cheapest failures
# before they reach CI.
#
# pip install pre-commit && pre-commit install
#
# Clears SEC-17 gate 1 (pre-commit gitleaks), CQ-12, and BL-16 (mypy hook).
# Revisions are pinned to full commit SHAs (tag noted alongside); bump
# deliberately via a reviewed PR.
#
# The mypy hook is a `language: system` local hook running the project venv's
# mypy (same interpreter, same installed deps, same pyproject config) — exact
# parity with `make typecheck`. A mirrors-mypy isolated env cannot see the
# project's dependencies, so `--strict` there would diverge from the real gate.
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: 83d9cd684c87d95d656c1458ef04895a7f1cbd8e # v8.30.1
hooks:
- id: gitleaks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # v0.15.20
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
hooks:
# Generated artifacts (docs/audits/) are excluded from the mutating
# hygiene hooks: they must stay byte-identical to their generators'
# output, or these hooks would fight `make test` / `make a11y`
# regeneration forever.
- id: end-of-file-fixer
exclude: ^docs/audits/
- id: trailing-whitespace
exclude: ^docs/audits/
- id: mixed-line-ending
args: ["--fix=lf"]
exclude: ^docs/audits/
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=2048"]
- repo: local
hooks:
- id: mypy
name: mypy --strict (project venv, gate parity)
entry: .venv/bin/python -m mypy
language: system
types: [python]
pass_filenames: false
require_serial: true