rlsbl v0.92.0 /rlsbl.changelog.exemptions
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

ExemptionRule
FieldTypeDefault
namestr
predicateCallable[[str], bool]
reasonstr

#ExemptionStats

Counts of commits filtered by each exemption predicate.

#is_autogenerated

python
def is_autogenerated(sha: str) -> bool

Check 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

python
def is_changelog_path(path: str) -> bool

Return 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

python
def is_changelog_only_commit(sha: str) -> bool

Check 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/version
  • CHANGELOG.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

python
def register(self, name: str, predicate: Callable[[str], bool], reason: str) -> None

Add a rule. Order matters -- first match wins for stats.

#rules

python
def rules(self) -> list[ExemptionRule]

Return a copy of the rules list.

#check

python
def check(self, sha: str) -> tuple[bool, str | None]

Evaluate rules in order. Returns (exempt, reason) on first match.

#filter_commits

python
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

python
def create_default_registry() -> ExemptionRegistry

Create 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.