-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
56 lines (51 loc) · 2.39 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
56 lines (51 loc) · 2.39 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
fail_fast: true
repos:
# ── Standard file hygiene ─────────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: "notebooks/" # notebooks manage their own line endings
- id: check-yaml
- id: check-json
exclude: "notebooks/" # notebook JSON is managed by Jupyter
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=500"]
# Bundled molecule-library package data (M-STRUCT) is intentionally
# large and governed by its own <=10 MB budget test
# (test_*_library.py); keep the 500 KB guard for everything else.
exclude: "^quantui/data/"
- id: debug-statements # catch leftover breakpoint() / pdb calls
# ── Strip notebook outputs before commit ─────────────────────────────────
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
files: notebooks/
# ── Code formatting (black) ───────────────────────────────────────────────
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
files: ^(quantui|tests)/
# ── Linting (ruff — superset of flake8) ──────────────────────────────────
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
hooks:
- id: ruff
args: ["--fix"] # auto-fix safe issues (unused imports, etc.)
files: ^(quantui|tests)/
# ── Type checking (mypy) ─────────────────────────────────────────────────
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
stages: [pre-push]
files: ^quantui/ # type-check the package only, not tests
args: ["--ignore-missing-imports", "--no-error-summary"]
additional_dependencies:
- "numpy"
- "types-requests"