precommit#
Check content of .pre-commit-config.yaml and related files.
- main(precommit: ModifiablePrecommit, has_notebooks: bool) None[source]#
- NOTEBOOK_HOOK_IDS = ('colab-toc-visible', 'fix-nbformat-version', 'remove-empty-tags', 'set-nb-cells', 'set-nb-display-name', 'strip-nb-whitespace')#
Hook IDs that were extracted from ComPWA/policy into ComPWA/nbhooks.
- migrate_notebook_hooks_to_nbhooks(precommit: ModifiablePrecommit, *, add_default_hooks: bool = False) None[source]#
Move notebook hooks from the ComPWA/policy repo entry to ComPWA/nbhooks.
The notebook hooks used to be served from ComPWA/policy itself, but they now live in ComPWA/nbhooks. Any notebook hook still listed under the ComPWA/policy repo is moved to a ComPWA/nbhooks repo entry. When
add_default_hooksis set, the default notebook hooks are added as well (this is what thecheck-dev-fileshook does for repositories that contain notebooks).
- get_local_hooks(config: PrecommitConfig) list[str][source]#
- get_non_functional_hooks(config: PrecommitConfig) list[str][source]#