Skip to main content

Module commit_scan

Module commit_scan 

Source
Expand description

Commit policy enforcement.

Loads a policies/commits.toml file and evaluates each commit in a range against the rules. Used by:

  • torii scan commits [--all] [--since N] (CLI)
  • pre-save hook (planned)
  • CI gates (future, server-side)

Schema (all keys optional):

forbid_trailers = [“regex”, …] require_trailers = [“regex”, …] forbid_subjects = [“regex”, …] author_email_matches = “regex” subject_max_length = 72 subject_min_length = 8 require_conventional = true

All regexes are case-insensitive by default.

Structs§

CompiledCommitPolicy
Compiled, ready-to-run policy.
Violation
One rule failure for one commit.

Functions§

default_policy_path
Default location of the commit policy file inside a repo.
scan_repo
Convenience: scan a range of commits with a loaded policy. since_oid = inclusive end of range (older). If None, walks all of HEAD.