Name the next release's items without a Touches list, and warn of them in rank_todo.py --check
CI / tests (pull_request) Successful in 4m24s

This commit is contained in:
2026-11-27 20:50:24 +01:00
parent 541ad8988d
commit 3db4b77121
10 changed files with 106 additions and 8 deletions
+11
View File
@@ -17,6 +17,9 @@ import dataclasses
import re
from failure import Failure
from plan.todo_table import Item
from text_files.markdown_text import listed
from plan.release import Release, version
LABEL = "Touches:"
SMALL = " (small)"
@@ -146,3 +149,11 @@ def same_part(one: Part, other: Part) -> bool:
if spans[0] or spans[1]:
return True
return one.name == other.name or one.name.startswith(f"{other.name}.") or other.name.startswith(f"{one.name}.")
def unpredicted(found: list[Item], release: Release) -> str | None:
"""Which of release's items hold no `Touches:` list in their details, in found's order, as a clause such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``; None where each holds one. A list that cannot be read is not missing: `rank_todo.py --check` fails on that one. Nor is one its item's later edit made stale, so a list is written once."""
missing = [str(item.id) for item in found if item.release == release and predicted(item.detail) is None]
if not missing:
return None
return f"item{'s' if len(missing) > 1 else ''} {listed(missing, 'and')} of release {version(release)} ha{'ve' if len(missing) > 1 else 's'} no `{LABEL}` list"