default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: tests
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-toml
exclude: tests/fixtures/invalid_lock/uv\.lock
- id: check-yaml
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
- id: check-ast
- id: debug-statements
- id: check-docstring-first
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.7
hooks:
# Run the linter.
- id: ruff
name: lint
args: [--fix, --exit-non-zero-on-fix, --respect-gitignore]
exclude: ".*uv.lock|.*_static"
# Run the formatter.
- id: ruff-format
name: format
args: [--respect-gitignore]
exclude: ".*uv.lock|.*_static"
- repo: local
hooks:
- id: ty
name: typecheck
entry: uv run ty check
language: system
types: [python]
pass_filenames: false
always_run: true