53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
repos:
|
|
- repo: local
|
|
hooks:
|
|
# Run the linter.
|
|
- id: ruff
|
|
name: ruff
|
|
language: system
|
|
exclude: __init__.py
|
|
types_or: [ python, pyi ]
|
|
entry: uv run ruff check .
|
|
args: [ --fix ]
|
|
# Run the formatter.
|
|
- id: ruff-format
|
|
name: ruff-format
|
|
language: system
|
|
entry: uv run ruff format
|
|
types_or: [ python, pyi ]
|
|
|
|
# Отсортировывает импорты в проекте
|
|
- id: isort
|
|
name: isort
|
|
language: system
|
|
exclude: __init__.py
|
|
entry: uv run isort
|
|
args: [ --profile, black, --filter-files ]
|
|
|
|
- id: mypy
|
|
name: mypy
|
|
entry: uv run mypy
|
|
require_serial: true
|
|
language: system
|
|
types: [ python ]
|
|
|
|
# Update README.md (before commit)
|
|
- id: update-readme
|
|
name: update-readme
|
|
language: system
|
|
entry: uv run python scripts/update_readme.py
|
|
pass_filenames: false
|
|
always_run: true
|
|
stages: [ pre-commit ]
|
|
|
|
# Clean Python cache
|
|
- id: clean-pycache
|
|
name: clean-pycache
|
|
language: system
|
|
entry: bash scripts/clean_cache.sh
|
|
pass_filenames: false
|
|
always_run: true
|
|
stages: [ pre-commit ]
|
|
|
|
|