Answer prose round 1: 0 🔴, 3 🟡 (0 misread); name which round commits count, and plainer docstrings and README bullets
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""The later chunks that fixed code each chunk on a default branch shipped: its escaped defects.
|
||||
|
||||
A later chunk fixed code an earlier chunk shipped where one of its changes removes or rewrites lines that `git blame` traces to a commit the earlier chunk brought. Two kinds of change count: the chunk's whole change, where it ships a todo.md item marked `defect` or `security`; and a round commit of the chunk answering a 🔴 that a reviewer marked `[misread]`. Each later chunk counts at most once against each earlier chunk."""
|
||||
A later chunk fixed code an earlier chunk shipped where one of its changes removes or rewrites lines that `git blame` traces to a commit the earlier chunk brought. Two kinds of change count: the chunk's whole change, where it ships a todo.md item marked `defect` or `security`; and a round commit of the chunk whose title counts both a 🔴 and a misread finding. Each later chunk counts at most once against each earlier chunk."""
|
||||
import re
|
||||
import typing
|
||||
|
||||
@@ -28,7 +28,7 @@ class Traced(typing.NamedTuple):
|
||||
|
||||
|
||||
def fixing_changes(branch: Branch, shipped: list[tuple[Item, ...]]) -> list[FixingChange]:
|
||||
"""Each change that fixes a defect: the whole change of each chunk that ships a FIXES item, as shipped_by lists them, and each round commit answering a 🔴 a reviewer marked `[misread]`."""
|
||||
"""Each change that fixes a defect: the whole change of each chunk that ships a FIXES item, as shipped_by lists them, and each round commit whose title counts both a 🔴 and a misread finding."""
|
||||
changes = []
|
||||
for index, (chunk, items) in enumerate(zip(branch.chunks, shipped)):
|
||||
if chunk.before is not None and any(item.exempt in FIXES for item in items):
|
||||
@@ -46,7 +46,7 @@ def with_fixes(branch: Branch, shipped: list[tuple[Item, ...]], traced: list[Tra
|
||||
fixed: dict[int, set[int]] = {}
|
||||
for change in traced:
|
||||
for commit in change.commits:
|
||||
# Blame at a commit names only commits the branch's log holds; one it lacks counts against no chunk.
|
||||
# Blame at a commit on the branch should name only commits its log holds; any other counts against no chunk.
|
||||
if commit in branch.owner and branch.owner[commit] > change.chunk:
|
||||
fixed.setdefault(branch.owner[commit], set()).add(change.chunk)
|
||||
chunks = []
|
||||
@@ -57,7 +57,7 @@ def with_fixes(branch: Branch, shipped: list[tuple[Item, ...]], traced: list[Tra
|
||||
|
||||
|
||||
def removed_work(diff: str) -> dict[str, list[tuple[int, int]]]:
|
||||
"""The old lines of a chunk's work each hunk of a `git diff -U0` removes or rewrites, as removed reads them: outside the plan and the records."""
|
||||
"""What removed reads from a `git diff -U0`, less the paths in NOT_WORK: the plan and the records."""
|
||||
return {path: spans for path, spans in removed(diff).items() if path not in NOT_WORK}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user