44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
|
|
repos:
|
||
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||
|
|
rev: v0.9.9 # Ruff version
|
||
|
|
hooks:
|
||
|
|
- id: ruff # Run the linter.
|
||
|
|
name: Run Linter Check (Ruff)
|
||
|
|
args: [ --fix, --unsafe-fixes ]
|
||
|
|
files: ^(instructor|tests|examples)/
|
||
|
|
- id: ruff-format # Run the formatter.
|
||
|
|
name: Run Formatter (Ruff)
|
||
|
|
|
||
|
|
- repo: local
|
||
|
|
hooks:
|
||
|
|
- id: uv-lock-check
|
||
|
|
name: Check uv.lock is up-to-date
|
||
|
|
entry: uv
|
||
|
|
args: [lock, --check]
|
||
|
|
language: system
|
||
|
|
files: ^(pyproject\.toml|uv\.lock)$
|
||
|
|
pass_filenames: false
|
||
|
|
|
||
|
|
- id: uv-sync-check
|
||
|
|
name: Verify dependencies can be installed
|
||
|
|
entry: uv
|
||
|
|
args: [sync, --check, --all-extras]
|
||
|
|
language: system
|
||
|
|
files: ^(pyproject\.toml|uv\.lock)$
|
||
|
|
pass_filenames: false
|
||
|
|
|
||
|
|
- id: uv-export-requirements
|
||
|
|
name: Export requirements.txt from pyproject.toml
|
||
|
|
entry: bash -c 'uv pip compile pyproject.toml -o requirements.txt && git add requirements.txt'
|
||
|
|
language: system
|
||
|
|
files: ^pyproject\.toml$
|
||
|
|
pass_filenames: false
|
||
|
|
|
||
|
|
- id: ty-check
|
||
|
|
name: Run Type Check (ty)
|
||
|
|
entry: uv
|
||
|
|
args: [run, --frozen, ty, check, instructor/]
|
||
|
|
language: system
|
||
|
|
files: ^instructor/
|
||
|
|
pass_filenames: false
|