Answer prose round 1: 0 🔴, 2 🟡; define work landing in landed_towards again and reword the docstrings

This commit is contained in:
2026-10-22 21:24:57 +02:00
parent aa8b12b896
commit a6fb79dabb
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -27,12 +27,12 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan
# larv-review --help points here rather than restating the rule, so the rule is written once.
def work_landed(release: tuple[int, int, int], shipped: list[Item], landed: tuple[int, int, int] | None) -> bool:
"""Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items. It has too when release is landed, the next release where work landed on the default branch."""
"""Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items. It has too when release equals landed: the default branch's next release, once work has landed towards it."""
return any(item.release == release for item in shipped) or release == landed
def landed_towards(found: list[Item], cut: LastCut) -> tuple[int, int, int] | None | Failure:
"""The next release on the default branch, once work has landed towards it; None where there is none, or work has not landed. `chunk_pick.next_release` tells the next release and whether work landed. found is the default branch's plan."""
"""The next release on the default branch, once work has landed towards it: once one or more changes are unreleased, as `chunk_pick.unreleased_changes` counts them. None where there is no next release, or no change is unreleased. found is the default branch's plan."""
upcoming = next_release(found, cut)
if isinstance(upcoming, Unknown):
return Failure("could not tell the next release: the default branch's todo.md history cannot be read")