-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (90 loc) · 3.39 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
103 lines (90 loc) · 3.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Pre-commit hooks for nemo-oo-agents
# All hooks use local system commands — no network access needed.
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
# Paths no hook should touch. CyberGym task artifacts are generated benchmark
# fixtures (PoC blobs, run logs) — whitespace/EOF fixing corrupts byte-exact
# reproducers, and linting generated output is meaningless.
exclude: ^examples/cybergym/task_artifacts/
repos:
- repo: local
hooks:
# Strip outputs from Jupyter notebooks
- id: nbstripout
name: nbstripout
entry: nbstripout
language: system
types: [jupyter]
# Python linting with ruff (fast, replaces flake8/isort/etc)
# Uses `uv run` so hooks work regardless of venv name or activation
# Staged-files pass: auto-fix and fast feedback during development
- id: ruff
name: ruff
entry: uv run ruff check --fix --exit-non-zero-on-fix
language: system
types_or: [python, jupyter]
- id: ruff-format
name: ruff-format
entry: uv run ruff format
language: system
types_or: [python, jupyter]
# Type checking with pyright (core library code only)
# Scoped to packages/ and src/ — experiments, agents, and util scripts
# have optional deps and loose typing that produce false positives.
- id: pyright
name: pyright
entry: uv run pyright
language: system
types_or: [python]
files: ^(src|packages)/
# All-files pass: mirrors CI exactly (ruff check . / ruff format --check .)
# Catches lint/format issues in the full project even if not in staged files.
- id: ruff-check-all
name: ruff-check-all
entry: uv run ruff check .
language: system
pass_filenames: false
always_run: true
# Project-wide format check — mirrors CI `ruff format --check .`
# Catches files that become unformatted in the full project (e.g. after rebase)
# even if they weren't staged in the current commit.
- id: ruff-format-check-all
name: ruff-format-check-all
entry: uv run ruff format --check .
language: system
pass_filenames: false
always_run: true
# General file hygiene
- id: trailing-whitespace
name: trailing-whitespace
entry: uv run python scripts/hooks/trailing_whitespace.py
language: system
types: [text]
- id: end-of-file-fixer
name: end-of-file-fixer
entry: uv run python scripts/hooks/end_of_file_fixer.py
language: system
types: [text]
exclude: frontend-react/dist/
- id: check-yaml
name: check-yaml
entry: uv run python scripts/hooks/check_yaml.py
language: system
types: [yaml]
- id: check-added-large-files
name: check-added-large-files
entry: uv run python scripts/hooks/check_large_files.py
language: system
types: [file]
exclude: uv\.lock$
- id: check-merge-conflict
name: check-merge-conflict
entry: uv run python scripts/hooks/check_merge_conflict.py
language: system
types: [text]
- id: check-spdx
name: check-spdx
entry: uv run python scripts/hooks/check_spdx.py
language: system
types: [python]
files: ^(src|packages)/