2026-11-27 13:56:09 +01:00
|
|
|
default_stages: [pre-commit] # only used if a hook does not specify stages
|
2020-08-04 02:55:41 +02:00
|
|
|
fail_fast: true
|
|
|
|
|
repos:
|
|
|
|
|
# Run the local formatting, linting, and testing tool chains.
|
|
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
2020-08-10 16:55:35 +02:00
|
|
|
- id: local-format
|
|
|
|
|
name: Format the source files
|
2026-11-27 14:36:34 +01:00
|
|
|
entry: uv run nox -s format --
|
2020-08-10 16:55:35 +02:00
|
|
|
language: system
|
2026-11-27 13:56:09 +01:00
|
|
|
stages: [pre-commit]
|
2020-08-10 16:55:35 +02:00
|
|
|
types: [python]
|
|
|
|
|
- id: local-lint
|
|
|
|
|
name: Lint the source files
|
2026-11-27 14:36:34 +01:00
|
|
|
entry: uv run nox -s lint --
|
2020-08-04 02:55:41 +02:00
|
|
|
language: system
|
2026-11-27 13:56:09 +01:00
|
|
|
stages: [pre-commit]
|
2020-08-04 02:55:41 +02:00
|
|
|
types: [python]
|
2026-11-27 14:52:05 +01:00
|
|
|
- id: local-test
|
|
|
|
|
name: Run the test suite
|
|
|
|
|
entry: uv run nox -s test
|
2020-08-04 02:55:41 +02:00
|
|
|
language: system
|
2026-11-27 13:56:09 +01:00
|
|
|
stages: [pre-merge-commit]
|
2026-11-27 14:52:05 +01:00
|
|
|
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
|
2020-08-04 02:55:41 +02:00
|
|
|
# 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
|
2020-08-04 02:55:41 +02:00
|
|
|
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
|
2026-11-27 13:56:09 +01:00
|
|
|
stages: [pre-commit] # overwrite the default
|
2020-08-04 02:55:41 +02:00
|
|
|
- id: mixed-line-ending
|
|
|
|
|
args: [--fix=no]
|
|
|
|
|
- id: no-commit-to-branch
|
|
|
|
|
args: [--branch, main]
|
|
|
|
|
- id: trailing-whitespace
|
2026-11-27 13:56:09 +01:00
|
|
|
stages: [pre-commit] # overwrite the default
|