Show the size of the code each finished item names beside its S in score-outcomes

This commit is contained in:
2026-11-08 23:10:55 +01:00
parent 0a9a4dc159
commit 6176f72355
10 changed files with 150 additions and 42 deletions
-8
View File
@@ -1,6 +1,5 @@
"""The pure choices the preflight's steps act on."""
import pathlib
import re
from release_plan.release_standing import chunk_item, Cut, dated_cut, LastCut, ReadyToCut, ReviewDue, Unknown, Unplanned
from failure import Failure
@@ -82,10 +81,3 @@ def pulls_command(forge: Forge, branch: str) -> list[str]:
if forge == "gh":
return [*PULLS_LIST["gh"], "--head", branch, "--json", "number,url", "--template", "{{range .}}{{.number}}\t{{.url}}\n{{end}}"]
return [*PULLS_LIST["tea"], "--fields", "index,head,url", "--output", "tsv"]
def named_paths(text: str, tracked: list[str]) -> list[tuple[str, int]]:
"""Each backticked span in text, in order and once, that names a tracked file or folder, with how many of the tracked files it holds: 1 for a file."""
spans = dict.fromkeys(span.removesuffix("/") for span in re.findall(r"`([^`\s]+)`", text))
held = ((span, sum(path == span or path.startswith(f"{span}/") for path in tracked)) for span in spans)
return [(span, count) for span, count in held if count]