Alexander Hess
db119ea776
- change references to temporary branches (e.g., "release-*" and "publish") to point to the 'main' branch - add --branch=BRANCH_NAME option to the nox session so that one can pass in a target branch to make all references point to - run "fix-branch-references" as the first pre-commit hook as it fails the fastest - bug fix: allow dots in branch references (e.g., "release-0.1.0")
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
default_stages: [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-fix-branch-references
|
|
name: Check for wrong branch references
|
|
entry: poetry run nox -s fix-branch-references --
|
|
language: system
|
|
stages: [commit]
|
|
types: [text]
|
|
- id: local-format
|
|
name: Format the source files
|
|
entry: poetry run nox -s format --
|
|
language: system
|
|
stages: [commit]
|
|
types: [python]
|
|
- id: local-lint
|
|
name: Lint the source files
|
|
entry: poetry run nox -s lint --
|
|
language: system
|
|
stages: [commit]
|
|
types: [python]
|
|
- id: local-test-suite
|
|
name: Run the entire test suite
|
|
entry: poetry run nox -s test-suite --
|
|
language: system
|
|
stages: [merge-commit]
|
|
types: [text]
|
|
# 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
|
|
rev: v3.2.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: [commit] # overwrite the default
|
|
- id: mixed-line-ending
|
|
args: [--fix=no]
|
|
- id: no-commit-to-branch
|
|
args: [--branch, main]
|
|
- id: trailing-whitespace
|
|
stages: [commit] # overwrite the default
|