Skip to content

About

Hooks supporting the rhiza framework

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

🪝 Rhiza Hooks

Python pre-commit License: MIT CodeFactor Rhiza Coverage OpenSSF Scorecard

Custom pre-commit hooks for projects using Rhiza templates.

This repository extracts rhiza's local hooks into a standalone package, allowing rhiza and downstream projects to use them as an external hook repository.

🚀 Quick Start

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/Jebel-Quant/rhiza-hooks
    rev: v1.3.2  # Use the latest release
    hooks:
      # Migrated from rhiza
      - id: check-rhiza-workflow-names
      - id: update-readme-help
      # Additional utility hooks
      - id: check-rhiza-config
      - id: check-makefile-targets
      - id: check-python-version-consistency
      - id: check-rust-version-consistency
      - id: check-go-version-consistency
      - id: check-bumpversion-config
      - id: check-template-bundles
      # Template-ownership and CI-consistency hooks
      - id: check-managed-files
      - id: check-workflow-make-targets
      - id: check-license-metadata
      - id: check-test-layout

Then install the hooks:

pre-commit install

📋 Available Hooks

Hook Triggers on Autofixes? Exit code
check-rhiza-workflow-names .github/workflows/rhiza_*.yml ✅ rewrites a wrong name: 1 if any file was changed or has an error, else 0
update-readme-help Makefile ✅ rewrites README.md between markers 1 if README.md was changed, else 0 (never fails when make help is unavailable)
check-rhiza-config .rhiza/template.yml ❌ validates only 1 if invalid, else 0
check-makefile-targets Makefile, any *.mk ❌ warns only 0 by default (warn-only); 1 on missing targets only with --strict
check-python-version-consistency .python-version, pyproject.toml ❌ validates only 1 on mismatch, else 0
check-rust-version-consistency rust-toolchain, rust-toolchain.toml, Cargo.toml ❌ validates only 1 on mismatch, else 0
check-go-version-consistency .go-version, go.mod