Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""rule-hook's check of a round commit's counts against the round's report in the chunk's review folder."""
|
||||
from collections.abc import Mapping
|
||||
import pathlib
|
||||
|
||||
from rule_hook.rules import Breach
|
||||
@@ -10,7 +11,7 @@ from review_rules.round_titles import ROUND, round_prefix, title_counts
|
||||
from project_config.templates import Titles
|
||||
|
||||
|
||||
def round_report_breaches(commit: CommitCall, titles: Titles, home: pathlib.Path) -> list[Breach]:
|
||||
def round_report_breaches(commit: CommitCall, titles: Titles, home: pathlib.Path, env: Mapping[str, str]) -> list[Breach]:
|
||||
"""A breach for each round title whose counts differ from those its round's report gives. The round title is the commit title's summary, as `titles` cuts it. A title without all three counts is title_breaches' to refuse. A round whose report is missing or unreadable, or says BLOCK without a finding heading, goes through, as does every round where git cannot name the commit's checkout within 5 seconds."""
|
||||
summaries = [titles.summary(message.strip()) for message in commit.messages]
|
||||
rounds = [(named, counts) for summary in summaries if (named := ROUND.match(summary)) and (counts := title_counts(summary)) and counts.misread is not None]
|
||||
@@ -19,7 +20,7 @@ def round_report_breaches(commit: CommitCall, titles: Titles, home: pathlib.Path
|
||||
worktree = git("rev-parse", "--show-toplevel", cwd=commit.directory, timeout=5, guarded=True)
|
||||
if isinstance(worktree, Failure):
|
||||
return []
|
||||
folder = pathlib.Path(review_folder(str(home), worktree.strip()))
|
||||
folder = pathlib.Path(review_folder(str(home), env, worktree.strip()))
|
||||
breaches = []
|
||||
for named, counts in rounds:
|
||||
pass_, round_ = named.group(1).lower(), int(named.group(2))
|
||||
|
||||
Reference in New Issue
Block a user