Answer principles round 2: 0 🔴, 1 🟡 (0 misread); say in rule-hook's refusal that the misread count is at most the findings, and move a stray assertion back
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ def round_counts(titles: list[str]) -> dict[str, int]:
|
|||||||
|
|
||||||
|
|
||||||
def lacks_counts(title: str) -> bool:
|
def lacks_counts(title: str) -> bool:
|
||||||
"""Whether title is a round title without all three counts after its colon."""
|
"""Whether title is a round title without all three counts after its colon, or with more misread findings than 🔴 and 🟡 findings."""
|
||||||
return ROUND.match(title) is not None and ((counts := title_counts(title)) is None or counts.misread is None)
|
return ROUND.match(title) is not None and ((counts := title_counts(title)) is None or counts.misread is None)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ RULES: dict[RuleName, Rule] = {
|
|||||||
"a git commit whose message opens `Answer <pass> round <n>:`",
|
"a git commit whose message opens `Answer <pass> round <n>:`",
|
||||||
),
|
),
|
||||||
"round-title-counts": Rule(
|
"round-title-counts": Rule(
|
||||||
"a larv-review round's commit title gives the counts of 🔴 and 🟡 findings the round reported, and how many of them a reviewer marked `[misread]`, such as `Answer stability round 1: 1 🔴, 2 🟡 (1 misread); flag a deleted test`, since score-outcomes counts them",
|
"a larv-review round's commit title gives the counts of 🔴 and 🟡 findings the round reported, and how many of them a reviewer marked `[misread]`, at most the two together, such as `Answer stability round 1: 1 🔴, 2 🟡 (1 misread); flag a deleted test`, since score-outcomes counts them",
|
||||||
"a git commit whose message opens `Answer <pass> round <n>:`",
|
"a git commit whose message opens `Answer <pass> round <n>:`",
|
||||||
),
|
),
|
||||||
"todo-rank-check": Rule(
|
"todo-rank-check": Rule(
|
||||||
@@ -132,7 +132,7 @@ def command_breaches(command: str, simples: list[Simple], home: str) -> list[Bre
|
|||||||
if any(past_cap(message) for message in commit.messages):
|
if any(past_cap(message) for message in commit.messages):
|
||||||
breaches.append(Breach("round-cap", f"the pass has had its {CAP} rounds; ask the human, and quote the yes in the override", commit.directory))
|
breaches.append(Breach("round-cap", f"the pass has had its {CAP} rounds; ask the human, and quote the yes in the override", commit.directory))
|
||||||
if any(lacks_counts(message) for message in commit.messages):
|
if any(lacks_counts(message) for message in commit.messages):
|
||||||
breaches.append(Breach("round-title-counts", "open the summary after the round's colon with `<k> 🔴, <m> 🟡 (<j> misread);`", commit.directory))
|
breaches.append(Breach("round-title-counts", "open the summary after the round's colon with `<k> 🔴, <m> 🟡 (<j> misread);`, where <j> is at most <k> + <m>", commit.directory))
|
||||||
return breaches
|
return breaches
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ class RoundFindings(unittest.TestCase):
|
|||||||
self.assertTrue(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡; fix"))
|
self.assertTrue(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡; fix"))
|
||||||
self.assertFalse(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡 (0 misread); fix"))
|
self.assertFalse(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡 (0 misread); fix"))
|
||||||
self.assertFalse(lacks_counts("Answer prose round 2: 0 🔴, 0 🟡 (0 misread)"))
|
self.assertFalse(lacks_counts("Answer prose round 2: 0 🔴, 0 🟡 (0 misread)"))
|
||||||
|
self.assertFalse(lacks_counts("Answer the question"))
|
||||||
|
|
||||||
def test_takes_a_title_counting_more_misread_findings_than_findings_as_lacking_its_counts(self):
|
def test_takes_a_title_counting_more_misread_findings_than_findings_as_lacking_its_counts(self):
|
||||||
self.assertTrue(lacks_counts("Answer stability round 1: 1 🔴, 2 🟡 (4 misread); fix"))
|
self.assertTrue(lacks_counts("Answer stability round 1: 1 🔴, 2 🟡 (4 misread); fix"))
|
||||||
self.assertFalse(lacks_counts("Answer stability round 1: 1 🔴, 2 🟡 (3 misread); fix"))
|
self.assertFalse(lacks_counts("Answer stability round 1: 1 🔴, 2 🟡 (3 misread); fix"))
|
||||||
self.assertIsNone(round_findings(["Answer stability round 1: 1 🔴, 2 🟡 (4 misread); fix"]))
|
self.assertIsNone(round_findings(["Answer stability round 1: 1 🔴, 2 🟡 (4 misread); fix"]))
|
||||||
self.assertFalse(lacks_counts("Answer the question"))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user