# Pre-commit configuration # Run with: prek run (or prek run --all-files) default_language_version: python: python3.11 repos: # Ruff - official pre-commit hooks (faster than local) - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.14 hooks: - id: ruff-check args: [--fix] - id: ruff-format # prek builtin hooks - fast, no external deps - repo: builtin hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml exclude: ^dropkit/templates/ # Jinja2 templates aren't valid YAML - id: check-toml - id: check-merge-conflict - id: check-added-large-files # ty type checking (no official pre-commit hook, use local) - repo: local hooks: - id: ty-check name: ty type check entry: uv run ty check dropkit/ language: system types: [python] pass_filenames: false # Jinja2 template validation - repo: local hooks: - id: jinja2-check name: jinja2 template syntax entry: uv run python -c "import sys; from jinja2 import Template; [Template(open(f).read()) for f in sys.argv[1:]]" language: system files: ^dropkit/templates/.*\.yaml$ types: [file] # Shell script linting - repo: https://github.com/koalaman/shellcheck-precommit rev: v0.10.0 hooks: - id: shellcheck args: [--severity=error] # E2E lifecycle test (creates a real droplet, requires valid config) - repo: local hooks: - id: e2e-lifecycle name: E2E lifecycle test entry: ./tests/e2e/test_lifecycle.sh language: system pass_filenames: false always_run: true stages: [manual]