Skip to content

Instantly share code, notes, and snippets.

@gardner
Created October 5, 2026 22:13
Show Gist options
  • Select an option

  • Save gardner/22f2fb13cf2103f7a0197437dfa71bc8 to your computer and use it in GitHub Desktop.

Select an option

Save gardner/22f2fb13cf2103f7a0197437dfa71bc8 to your computer and use it in GitHub Desktop.
.pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: file-length
name: Maximum 500 lines per Python source file
entry: uv run --locked python scripts/check_file_length.py
args: [--max-lines, "500"]
language: system
files: \.py$
exclude: (^|/)(tests?(/|\.py$)|test_[^/]*\.py$|[^/]*_test\.py$|conftest\.py$)
types: [python]
- id: ruff
name: Ruff lint and McCabe complexity
entry: uv run --locked ruff check --fix
language: system
types_or: [python, pyi]
files: ^(src|tests|scripts)/
- id: ruff-format
name: Ruff format
entry: uv run --locked ruff format
language: system
types_or: [python, pyi]
files: ^(src|tests|scripts)/
- id: pyright
name: Pyright type checking
entry: uv run --locked pyright
language: system
pass_filenames: false
files: ^(src/|tests/|scripts/|pyproject\.toml$|uv\.lock$)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment