update_readme_help¶
rhiza_hooks.update_readme_help
¶
Script to update README with Makefile help output.
This hook runs 'make help' and embeds the output into README.md between special marker comments.
Migrated from rhiza's local pre-commit hook that runs 'make readme'. This is a Python wrapper that provides the same functionality.
find_repo_root()
¶
Find the repository root directory.
Returns:
| Type | Description |
|---|---|
Path
|
Path to the repository root. |
Source code in src/rhiza_hooks/update_readme_help.py
get_make_help_output()
¶
Run 'make help' and capture the output.
Returns:
| Type | Description |
|---|---|
str | None
|
The output from 'make help', or None if the command fails. |
Source code in src/rhiza_hooks/update_readme_help.py
main(argv=None)
¶
Execute the script.
Source code in src/rhiza_hooks/update_readme_help.py
update_readme_with_help(readme_path, help_output)
¶
Update README.md with the make help output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
readme_path
|
Path
|
Path to the README.md file. |
required |
help_output
|
str
|
The output from 'make help'. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the file was modified, False otherwise. |