Add .ruff.toml, ty.toml, .coveragerc, .pytest.ini and .pre-commit-config.yaml, take .editorconfig, .gitignore and the CI workflow from the standard (keeping the repository's own CI steps, the byte-exact fixture attributes and the fixture ignore exceptions), and reduce pyproject.toml to metadata plus the setuptools build mapping. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B8cL4zN4XpaQF5cBtASzfq
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
# Install once with `pixi run hooks`. Ruff and ty run through pixi so hooks use
|
|
# exactly the same versions and settings as `pixi run check`.
|
|
# Test fixtures are deliberately messy inputs, so hooks leave them alone.
|
|
exclude: ^tests/fixtures/
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v6.0.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
args: [--maxkb=1000]
|
|
- id: check-merge-conflict
|
|
- id: check-toml
|
|
- id: check-yaml
|
|
exclude: ^src/.*\.ya?ml$
|
|
- id: end-of-file-fixer
|
|
exclude: \.(csv|tsv)$
|
|
- id: trailing-whitespace
|
|
exclude: \.(csv|tsv|md)$
|
|
- id: mixed-line-ending
|
|
args: [--fix=lf]
|
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
rev: 0.38.2
|
|
hooks:
|
|
- id: check-github-workflows
|
|
files: ^\.gitea/workflows/.+\.ya?ml$
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: ruff-format
|
|
name: ruff format
|
|
entry: pixi run ruff format
|
|
language: system
|
|
types_or: [python, pyi]
|
|
- id: ruff-check
|
|
name: ruff check
|
|
entry: pixi run ruff check --fix --exit-non-zero-on-fix
|
|
language: system
|
|
types_or: [python, pyi]
|
|
- id: ty
|
|
name: ty check
|
|
entry: pixi run ty check
|
|
language: system
|
|
types: [python]
|
|
pass_filenames: false
|