The pre_commit.py module#
Summary#
Pre-commit rule family. |
|
The .pre-commit-config.yaml file exists. |
|
Ruff-pre-commit is configured. |
|
Zizmor is configured with –pedantic or –persona=pedantic. |
|
Codespell is configured. |
|
Ansys/pre-commit-hooks is configured. |
|
A pyright, mypy, or ty type-checking hook is configured. |
|
Check-merge-conflict is configured. |
|
Debug-statements is configured. |
|
Check-yaml is configured. |
|
Trailing-whitespace is configured. |
Description#
Pre-commit configuration checks.
This rule set validates the repository pre-commit configuration.
The checks cover:
The
.pre-commit-config.yamlfile existsThe
ruff-pre-commitandansys/pre-commit-hooksrepositories are configuredOptional hooks are configured:
zizmor(with pedantic mode),codespell, a type checker (pyright,mypyorty), and thecheck-merge-conflict,debug-statements,check-yamlandtrailing-whitespacehooks
A missing required item is reported as an ERROR. A missing optional hook is
reported as a RECOMMENDATION that explains the benefit of adding it. A
recommendation never fails the report.