Swift edition
Environment and exit codes
Settings that belong to a machine or a person rather than a project can come from the environment: a CI job that always wants one format, or a terminal that can't show colour. An option given on the command line always wins.
Environment
| Variable | What it does | Option |
|---|---|---|
MUTASTIC_FORMAT | The format when --format isn't given. For a machine or a CI job that always wants the same format, concise say. A format mutastic doesn't have is refused, as the option's is. | --format |
MUTASTIC_AGENT=1 | The agent format, for coding agents. Coding agents set it, so mutastic answers in the format they read best, with progress as lines. MUTASTIC_FORMAT still wins. | --format |
MUTASTIC_VOCABULARY | Plain or classic, when --vocabulary isn't given. classic says killed and survived instead of caught and missed. The JSON report and the event stream always use the standard names. Any other value is refused. | --vocabulary |
MUTASTIC_PILLS | Labels: square (the default), rounded (for a Nerd Font) or off. How labels such as MISSED and PASS are drawn. rounded needs a terminal font with Nerd Font glyphs; off leaves out the coloured blocks and keeps the words. Any other value is refused. | — |
MUTASTIC_ARID=audit | Run the mutants the arid filters skip, and say what happened. Adds an Arid audit row to the summary: how many of those mutants ran, and how many the tests caught. | — |
MUTASTIC_GITHUB=off | No GitHub Actions annotations or job summary. On GitHub Actions (GITHUB_ACTIONS=true), a full run annotates the line of each of its first ten misses and adds a summary to the job's page. off leaves them out. | — |
MUTASTIC_GATE_BUDGET | Seconds a hooked gate check may take. 600 unless set: what the agents' plugins' Stop hook allows. The check waits for the count of the task's start only as long as this leaves, and hands over before it runs when its last run took longer. | — |
MUTASTIC_GATE_COUNT_WAIT | Seconds gate check waits for the count of the task's start. 240 unless set. A count not done by then is left, and a pass says the check compared the test attributes in the source only. | — |
NO_COLOR | No colour. Set to anything, it turns colour off, as it does for many tools. | --color |
FORCE_COLOR | Colour even off a terminal. Set to anything, it turns colour on where mutastic can't tell a person is reading, such as a CI log that shows colour. It wins over NO_COLOR. | --color |
TERM=dumb | No colour, unless FORCE_COLOR is set, and progress as lines. | — |
MUTASTIC_PROGRESS | Auto, bar, counter or none, when --progress isn't given. For a Gradle or Maven build, or a CI job, that always wants the same. Any other value is refused. | --progress |
MUTASTIC_TERM_PROGRESS | True or false: whether the terminal's tab shows the run's progress. Unset, it does in Windows Terminal, ConEmu, Ghostty and WezTerm, which say they draw it. | — |
MUTASTIC_HEARTBEAT | Seconds a log may go without a progress line. 30 unless set. Off a terminal, a line with the phase, its counts and its clock is printed whenever this long has passed since the last. A value that isn't a number above 0 is refused. | — |
CI | Progress as lines, not redrawn in place. Set to anything but false or 0; as are TF_BUILD, GITHUB_ACTIONS, GITLAB_CI, BUILDKITE, JENKINS_URL, TEAMCITY_VERSION and CIRCLECI, since some CI services pretend to be a terminal. | — |
CLAUDECODE | Progress as lines, for a coding agent. As are CLAUDE_CODE, GEMINI_CLI, CODEX_SANDBOX, CODEX_THREAD_ID, OPENCODE, COPILOT_AGENT, COPILOT_CLI, CURSOR_AGENT, REPL_ID, JUNIE_DATA, GOOSE_PROVIDER and AUGMENT_AGENT, which coding agents set. Only progress changes: the format is still --format's. | — |
MUTASTIC_COLUMNS | The terminal's width, for the Java edition. The JDK can't ask the terminal, so mutastic sets it when it runs the Java edition on a terminal, unless it's set already. | — |
MUTASTIC_JAVA_ENGINE | A Java edition's bin/mutastic to run instead, such as one built from its source. Nothing is fetched. | — |
MUTASTIC_JAVA_RELEASES | Where the Java edition's releases are downloaded from, for a mirror. GitHub's releases of mutastic/mutastic unless set. | — |
MUTASTIC_SWIFT_ENGINE | A Swift edition's mutastic to run in a Swift project, such as one built from its source. Unless set, the Swift edition installed in ~/.mutastic/swift-<version>/, by just install in its checkout or fetched from its releases: the newest of this mutastic's minor version, or else the newest. With none installed, the release for this machine is fetched the first time; with none published, a Swift package or Xcode project is refused. | — |
MUTASTIC_JAVA_HOME | The JDK mutastic runs on, 25 or later. Unless set, the newest JDK 25 or later of JAVA_HOME and those installed where SDKMAN, asdf, mise, Gradle, IntelliJ, Homebrew, macOS and Linux keep them. Your build and its tests keep the JAVA_HOME and PATH you gave them. | — |
JAVA_HOME | In a Maven or Gradle project, the JDK the build runs on. java on the PATH unless set. mutastic leaves it as it is for the build and its tests, and runs on it too when it's the newest JDK 25 or later found. | — |
MUTASTIC_BUILD_ARGS | Arguments for swift build, unless the command line gives some. Split at spaces, with quotes around an argument that has some: -Xswiftc -DPOSTGRES . The tests don't get them, and no command mutastic offers repeats them, so a secret goes here rather than after --. It replaces build:'s args: in mutastic.yaml. | — |
MUTASTIC_SWIFT_SYNSITES | The site finder to run, when it isn't beside mutastic. | — |
Exit codes
Every command exits with one of these.
| Status | Means | What to do |
|---|---|---|
0 | The score reaches the threshold, or with --fail-on-new no miss is new; for verify, each mutant named is caught, skipped, or crashed where a crash proves nothing; for gate check, the task is done; for next, nothing missed is left but what's proposed for ignoring. | — |
1 | The score is below the threshold, or with --fail-on-new a miss is new; for verify, a mutant named is still missed or not covered; for gate check, the task isn't done; for ignore --accept or --remove, the mutant isn't proposed or ignored; for next, something is queued; for baseline, there's one already, or none to prune. | — |
2 | mutastic couldn't run: an unknown option, a word the command doesn't take, a directory with no Package.swift, an id that isn't a mutant of the package, shares --from-shards can't put together as one run, --fail-on-new with no baseline, or no task open for gate check. | — |
3 | The tests fail without any mutant: a test fails with no mutant in, so the run stops; or, for run and verify, a test that caught mutants fails on its own, with no mutant in. Its message offers the way past it: leaving the test out, with a reason, under exclude-tests: in mutastic.yaml. | — |