ci/lint: prek commit gateway (ruff check/format + basedpyright)

Add prek.toml so git commit runs ruff-pre-commit (fix then format) and
pdm-based basedpyright. Document install/install-hook; clear type warnings
that made basedpyright exit non-zero under recommended mode.
This commit is contained in:
2026-07-18 14:10:04 +08:00
parent 39f9a7f636
commit 9b38a3b333
8 changed files with 60 additions and 37 deletions
+9 -1
View File
@@ -71,7 +71,15 @@ pdm run basedpyright .
pdm run pytest
```
CI fails if sources are not Ruff-formatted (`ruff format --check`). Run `pdm run ruff format .` before push.
**Commit gateway** ([prek](https://prek.j178.dev/)): runs ruff check + format and basedpyright on `git commit` so format is not forgotten.
```bash
uv tool install prek # once
prek install # once per clone (installs .git/hooks/pre-commit)
prek run --all-files # run all hooks on demand
```
Config: `prek.toml`. CI still runs the same checks in GitHub Actions.
## Basic usage