Skip to content

v0.10.0 — ditto -v, and a scope with nothing in it

Choose a tag to compare

@Disble Disble released this 30 Aug 22:35

Fixed

  • A change with nothing mutable in it no longer fails ditto changed. The
    score calculator reports -1 for an empty run, which is below every threshold,
    so a scope that produced no mutants and a suite that failed were the same
    answer. Run and RunStaged keep that refusal — a repository or an index
    yielding nothing is a scope somebody configured wrong — but a diff is not: a
    new switch case, a comment, a rename are all legitimately unmutatable, and
    failing a gate for one is failing a change for being correct.

    Found by this repository's own gate the day after it went green, on the -v
    commit below: one added switch case, a scope of one file, zero mutants, and a
    red run that had found nothing wrong with anything.

    The count is read through an optional interface, and the reporter decorators
    now forward it. Without that it was unreadable exactly when the stack is
    deepest, which is the gated run that raised the problem — backlog entry 12's
    class, caught again.

Added

  • -v and --version alongside ditto version. Nothing new is reported;
    it is the spelling people actually type, and a tool that only answers the long
    form makes them look it up to ask the simplest question it has.

    Safe at this level rather than lucky: subcommand flags are parsed by their own
    FlagSet, and Go's flag package does no prefix matching, so ditto run -v
    never resolved to -verbose and still does not — it reports an undefined flag,
    as it always did.

Measured

The gate on this release's merge: 9 mutants, score 1.00 against a 0.50 minimum, PASS in 66.19s.

It took four runs to get there, and each one found something the suite did not:
a scope of zero mutants read as a failing score; the -1 that means "unknown"
unguarded in three places; and then those guards written in the wrong package —
a gated mutant is judged by the tests of its OWN package, so assertions covering
exactly those lines passed while the mutants survived.