Simplify the pre-commit hooks
- run "format" and "lint" separately
=> remove the nox session "pre-commit"
- execute the entire "test-suite" before merges
+ rename "pre-merge" into "test-suite"
+ do not "format" and "lint" here any more
+ do not execute this before pushes
* allow branches with <100% test coverage to exist on GitHub
(they cannot be merged into 'main' until 100% coverage)
* GitHub Actions executes the test suite
This commit is contained in:
parent
ac5804174d
commit
4ee5a50fc6
2 changed files with 25 additions and 46 deletions
|
|
@ -4,9 +4,15 @@ repos:
|
|||
# Run the local formatting, linting, and testing tool chains.
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: local-pre-commit-checks
|
||||
name: Run code formatters and linters
|
||||
entry: poetry run nox -s pre-commit --
|
||||
- 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]
|
||||
|
|
@ -16,12 +22,12 @@ repos:
|
|||
language: system
|
||||
stages: [commit]
|
||||
types: [text]
|
||||
- id: local-pre-merge-checks
|
||||
- id: local-test-suite
|
||||
name: Run the entire test suite
|
||||
entry: poetry run nox -s pre-merge --
|
||||
entry: poetry run nox -s test-suite --
|
||||
language: system
|
||||
stages: [merge-commit, push]
|
||||
types: [python]
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue