You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Replace run_checks.sh with prek pre-commit hooks (#516)
* feat: Replace run_checks.sh with prek pre-commit hooks
- Add prek as dev dependency for faster, Rust-based pre-commit hooks
- Add .pre-commit-config.yaml with ruff, pyright, uv.lock check, and pytest hooks
- Rename ruff.yml workflow to prek.yml, now runs all hooks via prek
- pytest runs as manual hook locally but included in CI
- Delete run_checks.sh (superseded by prek hooks)
- Update CONTRIBUTING.md and AGENT.md with new workflow
* ci: Trigger prek workflow on PRs to any branch
This enables CI checks for stacked PRs that target non-main branches.
---------
Co-authored-by: Cursor Bot <bot@cursor.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,28 +10,32 @@ cd ART
10
10
Install the dependencies:
11
11
12
12
```bash
13
-
uv sync
13
+
uv sync --group dev
14
14
```
15
15
16
-
### Code Formatting and Linting
16
+
### Code Quality Checks (prek)
17
17
18
-
This project uses [ruff](https://github.com/astral-sh/ruff) for both code formatting and linting. Before submitting a pull request, please ensure your code passes all quality checks:
18
+
This project uses [prek](https://github.com/j178/prek) to run local checks (ruff, pyright, uv.lock sync, and unit tests). Before submitting a pull request, please ensure your code passes all quality checks:
19
19
20
20
```bash
21
-
#Run all code quality checks (formatting, linting, and dependency sync)
22
-
./scripts/run_checks.sh
21
+
#Install git hooks (optional but recommended)
22
+
uv run prek install
23
23
24
-
#Automatically fix any issues that can be fixed
25
-
./scripts/run_checks.sh --fix
24
+
#Run all checks against all files (formatting, linting, typecheck, uv.lock, tests)
25
+
uv run prek run --all-files
26
26
```
27
27
28
-
The `run_checks.sh` script will:
28
+
You can also run individual hooks:
29
29
30
-
1. Check code formatting with ruff
31
-
2. Check for linting issues with ruff
32
-
3. Verify that `uv.lock` is in sync with `pyproject.toml`
30
+
```bash
31
+
uv run prek run ruff
32
+
uv run prek run ruff-format
33
+
uv run prek run pyright
34
+
uv run prek run uv-lock-check
35
+
uv run prek run pytest
36
+
```
33
37
34
-
These checks are automatically run in CI for all pull requests. If your PR fails these checks, simply run `./scripts/run_checks.sh --fix`locally and commit the changes.
38
+
These checks are automatically run in CI for all pull requests. If your PR fails these checks, re-run the corresponding `prek` hook locally and commit any fixes.
0 commit comments