Name the four kinds of breach, the two level rules and the round title's spelling, and table the step-up rules

This commit is contained in:
2026-11-13 02:45:35 +01:00
parent 1f3349065a
commit e1ca619e96
7 changed files with 50 additions and 11 deletions
+5 -2
View File
@@ -29,8 +29,11 @@ def committed_file_breaches(directory: str) -> list[Breach]:
known = set(before.splitlines())
added = "\n".join(line for line in after.splitlines() if line not in known)
breaches += [dataclasses.replace(breach, marked=added) for breach in file_breaches(path, before, added, after)]
# The index copy and the work-tree copy of a file can breach the same way; the first stands.
return list({(breach.rule, breach.detail): breach for breach in reversed(breaches)}.values())[::-1]
# The work-tree copy and the index copy of a file can breach the same way; the first found, the work tree's, stands.
first: dict[tuple[str, str], Breach] = {}
for breach in breaches:
first.setdefault((breach.rule, breach.detail), breach)
return list(first.values())
def tracked_names(top: str) -> set[str]: