Merge 3a8d5865dd329295d7a62cb4aa58ea9fcd5c7195 into 553741557a57df44a46fb3ab72b6aafeaf945337

This commit is contained in:
Tony Lin 2026-10-28 21:54:34 -07:00 committed by GitHub
commit f6d6f78400
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

7
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format

View File

@ -6,6 +6,18 @@ Run all commands below from the repository root. See [README.md](README.md) for
Before committing, format the modified code and pass the corresponding checks.
### Pre-commit
Install [pre-commit](https://pre-commit.com/) and enable the Git hook in your local clone:
```bash
python -m pip install pre-commit
pre-commit install
pre-commit run --all-files # Optional: check the whole repository
```
The hook runs Ruff checks and formatting on staged Python files. If it changes a file, review and stage the changes before committing again. Each contributor must install the hook in their own clone.
### Python
Ruff is configured in [pyproject.toml](pyproject.toml).