Answer prose round 1: 0 🔴, 6 🟡 (0 misread); docstrings and a fixture's comment say what the code does
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -9,8 +9,9 @@ HUNK = re.compile(r"^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@", re.MULTILINE)
|
||||
|
||||
class Mutant(typing.NamedTuple):
|
||||
"""A mutant the project's tests killed, as the lines it changes in the tree its tool ran in: the number of the first, from 1,
|
||||
those lines as the tree has them, and what the mutant has in their place. name is what the report calls the bug it becomes:
|
||||
the path and line, then the tool's own name of the mutant."""
|
||||
those lines as the tree has them, and what the mutant has in their place. Where it only adds lines, the number is that of the
|
||||
line they go in before. name is what the report calls the bug it becomes: the path and line, then what the tool tells the
|
||||
mutant by, which is Gremlins' column and mutator, or mutmut's name."""
|
||||
|
||||
path: str
|
||||
line: int
|
||||
@@ -20,7 +21,7 @@ class Mutant(typing.NamedTuple):
|
||||
|
||||
|
||||
def mutated(source: bytes, mutant: Mutant) -> bytes | None:
|
||||
"""A file's source with the mutant applied, or None where its line doesn't start the lines the mutant changes."""
|
||||
"""A file's source with the mutant applied, or None where the lines the mutant changes don't stand at the mutant's line."""
|
||||
lines = source.split(b"\n")
|
||||
first = mutant.line - 1
|
||||
if not 0 <= first <= len(lines) or tuple(lines[first:first + len(mutant.was)]) != mutant.was:
|
||||
|
||||
Reference in New Issue
Block a user