Reformat the pre-commit config
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 1m41s
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 1m41s
Also, drop the no longer needed stage overrides
This commit is contained in:
parent
792da0507f
commit
d8edd58fe6
1 changed files with 91 additions and 58 deletions
|
|
@ -1,60 +1,93 @@
|
||||||
default_install_hook_types: [pre-commit, pre-merge-commit] # used by a plain `pre-commit install`
|
# Hooks run by `git commit` and `git merge`,
|
||||||
default_stages: [pre-commit] # only used if a hook does not specify stages
|
# installed with `uv run nox -s init-project`
|
||||||
|
|
||||||
|
# Used by a plain `pre-commit install`
|
||||||
|
default_install_hook_types:
|
||||||
|
- pre-commit
|
||||||
|
- pre-merge-commit
|
||||||
|
|
||||||
|
# Used if a hook does not specify stages
|
||||||
|
default_stages:
|
||||||
|
- pre-commit
|
||||||
|
|
||||||
fail_fast: true
|
fail_fast: true
|
||||||
|
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
# Run the local formatting, linting, and testing tool chains.
|
|
||||||
- repo: local
|
# Format, lint, and test with the `nox` sessions
|
||||||
hooks:
|
- repo: local
|
||||||
- id: local-format
|
hooks:
|
||||||
name: Format the source files
|
|
||||||
entry: uv run nox -s format --
|
- id: local-format
|
||||||
language: system
|
name: Format the source files
|
||||||
stages: [pre-commit]
|
entry: uv run nox -s format --
|
||||||
types: [python]
|
language: system
|
||||||
- id: local-lint
|
stages: [pre-commit]
|
||||||
name: Lint the source files
|
types: [python]
|
||||||
entry: uv run nox -s lint --
|
|
||||||
language: system
|
- id: local-lint
|
||||||
stages: [pre-commit]
|
name: Lint the source files
|
||||||
types: [python]
|
entry: uv run nox -s lint --
|
||||||
- id: local-test
|
language: system
|
||||||
name: Run the test suite
|
stages: [pre-commit]
|
||||||
entry: uv run nox -s test
|
types: [python]
|
||||||
language: system
|
|
||||||
stages: [pre-merge-commit]
|
- id: local-test
|
||||||
pass_filenames: false
|
name: Run the test suite
|
||||||
always_run: true
|
entry: uv run nox -s test
|
||||||
- id: local-doctest
|
language: system
|
||||||
name: Run the doctests
|
stages: [pre-merge-commit]
|
||||||
entry: uv run nox -s doctest
|
pass_filenames: false # => No `--` at the end of the "entry"
|
||||||
language: system
|
always_run: true
|
||||||
stages: [pre-merge-commit]
|
|
||||||
pass_filenames: false
|
- id: local-doctest
|
||||||
always_run: true
|
name: Run the doctests
|
||||||
# Keep requirements.txt in sync with uv.lock
|
entry: uv run nox -s doctest
|
||||||
- repo: https://github.com/astral-sh/uv-pre-commit
|
language: system
|
||||||
rev: 0.13.10
|
stages: [pre-merge-commit]
|
||||||
hooks:
|
pass_filenames: false # => No `--` at the end of the "entry"
|
||||||
- id: uv-export
|
always_run: true
|
||||||
args: [--extra=research, --no-default-groups, --no-emit-project, --frozen, --quiet, --output-file=requirements.txt]
|
|
||||||
# Enable hooks provided by the pre-commit project to
|
# Keep requirements.txt in sync with uv.lock
|
||||||
# enforce rules that local tools could not that easily.
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
rev: 0.13.10
|
||||||
rev: v6.0.0
|
hooks:
|
||||||
hooks:
|
|
||||||
- id: check-added-large-files
|
- id: uv-export
|
||||||
args: [--maxkb=100]
|
args:
|
||||||
exclude: ^requirements\.txt$ # Large only because of the hashes
|
- --extra=research
|
||||||
- id: check-case-conflict
|
- --no-default-groups
|
||||||
- id: check-builtin-literals
|
- --no-emit-project
|
||||||
- id: check-merge-conflict
|
- --frozen
|
||||||
- id: check-toml
|
- --quiet
|
||||||
- id: check-yaml
|
- --output-file=requirements.txt
|
||||||
- id: end-of-file-fixer
|
|
||||||
stages: [pre-commit] # overwrite the default
|
# Generic checks that the "local" tools can not cover
|
||||||
- id: mixed-line-ending
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
args: [--fix=no]
|
rev: v6.0.0
|
||||||
- id: no-commit-to-branch
|
hooks:
|
||||||
args: [--branch, main]
|
|
||||||
- id: trailing-whitespace
|
- id: check-added-large-files
|
||||||
stages: [pre-commit] # overwrite the default
|
args: [--maxkb=100]
|
||||||
|
exclude: ^requirements\.txt$ # Large because of the hashes
|
||||||
|
|
||||||
|
- id: check-builtin-literals
|
||||||
|
|
||||||
|
- id: check-case-conflict
|
||||||
|
|
||||||
|
- id: check-merge-conflict
|
||||||
|
|
||||||
|
- id: check-toml
|
||||||
|
|
||||||
|
- id: check-yaml
|
||||||
|
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args: [--fix=no]
|
||||||
|
|
||||||
|
- id: no-commit-to-branch
|
||||||
|
args: [--branch, main]
|
||||||
|
|
||||||
|
- id: trailing-whitespace
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue