chore: add pre-commit hook running ruff and mypy checks on staged files

Mirrors the fast static checks from CI (justfile lint + type-check):
ruff check, ruff format --check and mypy (gns3server package only,
matching the files = ["gns3server"] scope in pyproject.toml). Only
staged Python files are checked; pytest and pip check are left to CI.

Enable with: just install-hooks
This commit is contained in:
YueGuobin committed 2026-10-15 22:44:24 +08:00
1 parent 716edc3a6a
commit fa3dd827f9
2 files changed
+59

No files matched your search

+5
View File
@@ -9,6 +9,11 @@ install:
python -m pip install --upgrade pip
python -m pip install -e '.[ai-features,dev]'
# Install the git pre-commit hook (lint + type-check on staged files)
[group('dev')]
install-hooks:
git config core.hooksPath .githooks
# Apply ruff autofixes for the enforced rules
[group('dev')]
format: