Answer stability round 1: 0 🔴, 6 🟡 (0 misread); leave blank lines and empty files out of what a chunk touched, spell a name that holds a backtick as Markdown does, pin two mutants, and sort a chunk's IDs
This commit is contained in:
@@ -14,9 +14,10 @@ per file, as in
|
||||
- `bin/run.sh`: lines 10-20
|
||||
- `docs/new.md`
|
||||
|
||||
A path alone is the whole file, and (small) marks a part the item changes only a little. It names
|
||||
what the branch touched the same way, from the diff between the branch's merge base with the
|
||||
default branch and HEAD:
|
||||
A path alone is the whole file, and (small) marks a part the item changes only a little. A path or
|
||||
a name that holds a backtick takes a longer run of backticks with a space inside each end, as a
|
||||
Markdown code span does: `` ## The `foo` tool ``. It names what the branch touched the same way,
|
||||
from the diff between the branch's merge base with the default branch and HEAD:
|
||||
|
||||
- in a .py file, by Python's `ast` module: the innermost function or class a changed line lies in,
|
||||
named with those around it; a top-level assignment by the name it sets; `(module)` for any other
|
||||
@@ -28,14 +29,18 @@ default branch and HEAD:
|
||||
- a file the branch added or deleted, or changed without text hunks, as the path alone. A rename
|
||||
reads as a file deleted and one added.
|
||||
|
||||
It leaves out the plan and the project's records, which every chunk writes. It appends
|
||||
`## Chunk <IDs>, <UTC time>, at <commit>` with both lists to the record the project's config names
|
||||
as `touch-predictions`, in place of an entry the record already holds for the same items. Commit
|
||||
the record with the chunk. Where the config leaves the setting out, it says so and exits 0.
|
||||
A changed blank line names no part where the file has other changed lines, unless it lies inside a
|
||||
Python statement.
|
||||
|
||||
Exit 1, saying why, on any other arguments, when no config names the checkout, the plan or the
|
||||
record cannot be read or written, the plan holds no item <ID>, a `Touches:` list cannot be read, or
|
||||
git cannot name the merge base or the diff.
|
||||
It leaves out the plan and the project's records, which every chunk writes. It appends
|
||||
`## Chunk <IDs>, <UTC time>, at <commit>`, the IDs in rising order, with both lists to the record
|
||||
the project's config names as `touch-predictions`, in place of an entry the record already holds
|
||||
for the same items. Commit the record with the chunk. Where the config leaves the setting out, it
|
||||
says so and exits 0.
|
||||
|
||||
Exit 1, saying why: on any other arguments; when no config names the checkout; when the plan or
|
||||
the record cannot be read or written; when the plan holds no item <ID>; when a `Touches:` list
|
||||
cannot be read; or when git cannot name the merge base or the diff.
|
||||
"""
|
||||
import sys
|
||||
import time
|
||||
@@ -60,7 +65,7 @@ def main(argv: list[str]) -> int:
|
||||
print("usage: touch-predictions record <ID>...", file=sys.stderr)
|
||||
return 1
|
||||
config = project()
|
||||
done = config if isinstance(config, Failure) else recorded(config, [int(id_) for id_ in argv[1:]])
|
||||
done = config if isinstance(config, Failure) else recorded(config, sorted({int(id_) for id_ in argv[1:]}))
|
||||
if isinstance(done, Failure):
|
||||
print(f"touch-predictions: {done.reason}", file=sys.stderr)
|
||||
return 1
|
||||
@@ -82,7 +87,7 @@ def recorded(config: ProjectConfig, ids: list[int]) -> str | Failure:
|
||||
head = base if isinstance(base, Failure) else git("rev-parse", "--short", "HEAD", cwd=cwd)
|
||||
if isinstance(base, Failure) or isinstance(head, Failure):
|
||||
return head if isinstance(head, Failure) else base
|
||||
# Every chunk writes the plan and the records, so they tell no two chunks apart.
|
||||
# Every chunk writes the plan and the records, so they are left out of what a chunk touched.
|
||||
skipped = {path for name in ("plan", *RECORDS, TOUCH_PREDICTIONS) if (path := config.tracked(name))}
|
||||
touches = touched(base.strip(), "HEAD", cwd, skipped)
|
||||
if isinstance(touches, Failure):
|
||||
|
||||
Reference in New Issue
Block a user