Skip to content

API Reference

rhiza_hooks ships a console script per module, each a standalone module with a main() entry point. All but one are also published as pre-commit hooks — see the note below the table.

Module Entry point Purpose
check_bumpversion_config check-bumpversion-config Assert a bumpversion section exists where bump-my-version searches, and agrees with pyproject.toml
check_go_version check-go-version-consistency Assert the go.mod directives and .go-version agree
check_license_metadata check-license-metadata Reject a PEP 639 license expression declared alongside a License :: trove classifier
check_makefile_targets check-makefile-targets Verify required Makefile targets are present
check_managed_files check-managed-files Refuse edits to files listed in .rhiza/template.lock, which the next sync overwrites
check_python_version check-python-version-consistency Assert Python version is consistent across project files
check_rhiza_config check-rhiza-config Validate .rhiza/template.yml
check_rust_version check-rust-version-consistency Assert the pinned Rust toolchain is not older than the declared MSRV
check_template_bundles check-template-bundles Validate template-bundles.yml structure
check_workflow_make_targets check-workflow-make-targets Assert every make target a CI workflow runs is defined in the Makefile or its includes
check_workflow_names check-rhiza-workflow-names Enforce (RHIZA) prefix on GitHub Actions workflow names
render_precommit render-precommit Render a .pre-commit-config.yaml from fragments; checks for drift unless given --write
update_readme_help update-readme-help Embed make help output into README.md

render_precommit is the one module that is not a pre-commit hook. It renders a .pre-commit-config.yaml, and pre-commit reads that file once before any hook runs — so a render can only ever affect the next invocation. It belongs in the build step ahead of pre-commit, and ships here as a console script only.

Internal modules

These modules hold shared logic used by the hooks above. They have no main() entry point and are not part of the public CLI surface, but are documented here for contributors.

Module Purpose
_bundles_config Read the project's .rhiza/template.yml configuration
_bundles_fetch Load/fetch a template-bundles document (local, bytes, or remote) into a typed result
_bundles_validate Structural validation of a template-bundles document
_bumpversion_config Locate and parse the bumpversion config bump-my-version would read, in either format
_config_schema Canonical .rhiza/template.yml keys, aliases, and config normalization
_makefile Shared Makefile parsing: target extraction and include expansion
_managed Resolve the template-owned paths — .rhiza/template.lock's files: minus template.yml's exclude:
_repo Shared helpers (e.g. locating the repository root)
_version Shared dotted-numeric version parsing and comparison, used by the Rust and Go hooks
_yaml Shared helper for loading a YAML file into a top-level mapping