velofy/.pre-commit-config.yaml

52 lines
1.4 KiB
YAML
Raw Normal View History

default_stages: [pre-commit] # only used if a hook does not specify stages
fail_fast: true
repos:
# Run the local formatting, linting, and testing tool chains.
- repo: local
hooks:
- id: local-format
name: Format the source files
2026-11-27 14:36:34 +01:00
entry: uv run nox -s format --
language: system
stages: [pre-commit]
types: [python]
- id: local-lint
name: Lint the source files
2026-11-27 14:36:34 +01:00
entry: uv run nox -s lint --
language: system
stages: [pre-commit]
types: [python]
- id: local-test
name: Run the test suite
entry: uv run nox -s test
language: system
stages: [pre-merge-commit]
pass_filenames: false
always_run: true
- id: local-doctest
name: Run the doctests
entry: uv run nox -s doctest
language: system
stages: [pre-merge-commit]
pass_filenames: false
always_run: true
# Enable hooks provided by the pre-commit project to
# enforce rules that local tools could not that easily.
- repo: https://github.com/pre-commit/pre-commit-hooks
2026-11-27 13:59:44 +01:00
rev: v6.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=100]
- id: check-case-conflict
- id: check-builtin-literals
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
stages: [pre-commit] # overwrite the default
- id: mixed-line-ending
args: [--fix=no]
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace
stages: [pre-commit] # overwrite the default