Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 58 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,70 @@
ci:
# Don't run these in pre-commit.ci at all
skip: [lint, format]
skip: [lint, format, check-lint-strict, check-format-strict, check-package, check-readme, run-tests]

repos:
- repo: local
hooks:
# Auto-fixing hooks (run first) - runs on changed files only
- id: lint
name: Lint
entry: just lint
name: Lint (auto-fix)
entry: bash -c 'uv run ruff check --fix --select I "$@" && uv run ruff check --fix "$@"' --
language: system
pass_filenames: false
pass_filenames: true
types: [python]
stages: [pre-commit]
verbose: true

- id: format
name: Format
entry: just format
name: Format (auto-fix)
entry: uv run ruff format
language: system
pass_filenames: true
types: [python]
stages: [pre-commit]
verbose: true

# Validation hooks - runs on changed files only
- id: check-lint-strict
name: Check Lint (CI match)
entry: bash -c 'uv run ruff check --select I "$@" && uv run ruff check "$@"' --
language: system
pass_filenames: true
types: [python]
stages: [pre-commit]
verbose: true

- id: check-format-strict
name: Check Format (CI match)
entry: uv run ruff format --check
language: system
pass_filenames: true
types: [python]
stages: [pre-commit]
verbose: true

# Global checks (must run on whole project/env)
- id: check-package
name: Check Package (CI match)
entry: uv pip check
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command 'uv pip check' differs from the CI command which uses 'uv run pip check' (via 'just run pip check' in justfile line 62). The pre-commit hook should use 'uv run pip check' to match CI behavior exactly.

Suggested change
entry: uv pip check
entry: uv run pip check

Copilot uses AI. Check for mistakes.
language: system
pass_filenames: false
stages: [pre-commit]
verbose: true

- id: check-readme
name: Check README (CI match)
entry: uv run -m readme_renderer ./README.md -o /tmp/README.html
language: system
pass_filenames: false
stages: [pre-commit]
verbose: true

# Optional: Run tests with coverage (manual stage only)
- id: run-tests
name: Run Tests with Coverage
entry: uv run pytest --cov-append
language: system
pass_filenames: false
stages: [manual]
verbose: true
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ max-line-length = 100
sphinx = true

[tool.ruff]
force-exclude = true
line-length = 99

exclude = [
"**/migrations/*.py",
"**/migrations/**",
]

[tool.ruff.format]
exclude = ["**/migrations/**"]

[tool.ruff.lint]
extend-ignore = [
"E501",
Expand Down
Loading