Run the architecture and principles passes only in a release review before each cut
This commit is contained in:
+10
-2
@@ -6,6 +6,9 @@ from review_passes import PASSES
|
||||
|
||||
# The most rounds a pass takes per chunk, per `docs/decisions.md` → `review: a pass gets at most two rounds per chunk, …`. rule-hook's `round-cap` refuses a round commit that `past_cap` finds takes its pass past it, and `larv-review round-count` marks a pass that reached it.
|
||||
CAP = 2
|
||||
# The release review's passes take more, since they may refactor much: `skills/larv-review/SKILL.md` → "Release review".
|
||||
RELEASE_REVIEW_CAP = 5
|
||||
CAPS = {"architecture": RELEASE_REVIEW_CAP, "principles": RELEASE_REVIEW_CAP}
|
||||
ROUND = re.compile(r"^Answer (.+?) round ([0-9]+):", re.IGNORECASE)
|
||||
# What follows a round title's colon: the round's 🔴 and 🟡 counts, then how many of them a reviewer marked `[misread]`, a count that titles from before it lack, then `;` and its summary, if any.
|
||||
FINDINGS = re.compile(r" ([0-9]+) 🔴, ([0-9]+) 🟡(?: \(([0-9]+) misread\))?(?:;|$)")
|
||||
@@ -42,9 +45,14 @@ def lacks_counts(title: str) -> bool:
|
||||
|
||||
|
||||
def past_cap(title: str, earlier: list[str]) -> bool:
|
||||
"""Whether title is a round title that takes its pass past CAP, as round_counts counts title among the branch's earlier commit titles."""
|
||||
"""Whether title is a round title that takes its pass past its cap, as round_counts counts title among the branch's earlier commit titles."""
|
||||
named = ROUND.match(title)
|
||||
return named is not None and round_counts([*earlier, title])[named.group(1).lower()] > CAP
|
||||
return named is not None and round_counts([*earlier, title])[named.group(1).lower()] > cap(named.group(1).lower())
|
||||
|
||||
|
||||
def cap(name: str) -> int:
|
||||
"""The most rounds the pass named name takes per chunk."""
|
||||
return CAPS.get(name, CAP)
|
||||
|
||||
|
||||
def title_counts(title: str) -> Findings | None:
|
||||
|
||||
Reference in New Issue
Block a user