On this page
Centralized changelog exemption registry for commit filtering rules.
#rlsbl.changelog.exemptions
#rlsbl.changelog.exemptions
Centralized changelog exemption registry for commit filtering rules.
#ExemptionRule
| Field | Type | Default |
|---|---|---|
name | str | |
predicate | Callable[[str], bool] | |
reason | str |
#ExemptionStats
Counts of commits filtered by each exemption predicate.
#is_autogenerated
def is_autogenerated(sha: str) -> boolCheck if a commit has the Autogenerated: true trailer.
Returns True when the trailer is present with value true, False otherwise. Subprocess errors are treated as non-autogenerated.
#is_changelog_path
def is_changelog_path(path: str) -> boolReturn True if path is a changelog/release infrastructure file.
Recognised patterns (with optional leading directory prefix):
[prefix/].rlsbl/changes/...[prefix/].rlsbl/releases/...[prefix/].rlsbl/version[prefix/].rlsbl-monorepo/...[prefix/]CHANGELOG.md
#is_changelog_only_commit
def is_changelog_only_commit(sha: str) -> boolCheck if a commit only touches changelog/release infrastructure files.
Returns True when every file changed by the commit matches one of:
.rlsbl/changes/(any depth).rlsbl/releases/(any depth).rlsbl/versionCHANGELOG.md
For monorepo support, paths prefixed with a subdirectory are also accepted (e.g. python/.rlsbl/changes/unreleased.jsonl).
Subprocess errors or empty file lists are treated conservatively (returns False).
#ExemptionRegistry
Ordered registry of exemption rules for changelog commit filtering.
#register
def register(self, name: str, predicate: Callable[[str], bool], reason: str) -> NoneAdd a rule. Order matters -- first match wins for stats.
#rules
def rules(self) -> list[ExemptionRule]Return a copy of the rules list.
#check
def check(self, sha: str) -> tuple[bool, str | None]Evaluate rules in order. Returns (exempt, reason) on first match.
#filter_commits
def filter_commits(self, commits: list[str]) -> tuple[list[str], ExemptionStats]Batch filter. Returns (non_exempt_commits, stats).
Stats tracks per-rule counts. First matching rule wins for stats counting.
#create_default_registry
def create_default_registry() -> ExemptionRegistryCreate the default registry with autogenerated and changelog_only rules.
Order matters: autogenerated is checked first, then changelog_only. A commit matching both is counted as autogenerated only.