cargo-mutants icon indicating copy to clipboard operation
cargo-mutants copied to clipboard

`--config=FILE` option

Open sandersaares opened this issue 9 months ago • 1 comments

Some of my code is OS-specific, so on the "wrong" OS it ends up getting mutated when it does not even get compiled, causing false missed mutants.

It would be desirable to be able to provide OS-specific configuration. Thinking mainly of exclude globs here, though I suppose there may be other useful options.

The simplest implementation might be to just allow the config file to be provided by path. I see there is a --no-config but there does not appear to be a way to specify mutants_windows.toml or similar.

There is a workaround: just specify all the values on the command line and have a script wrapper around cargo-mutants. This is workable, though requires manual labor by everyone who needs to do OS-filtering, so something built-in might increase the total happines in the world.

sandersaares avatar Mar 22 '25 20:03 sandersaares

There is already #50 about automatically understanding that #[cfg(windows)] isn't useful to mutate on !windows.

However it's also a good idea, and will be simpler to implement, to just take --config mutants-win.toml etc.

sourcefrog avatar Mar 26 '25 23:03 sourcefrog

Done: https://mutants.rs/config-file.html

sourcefrog avatar Jun 05 '25 14:06 sourcefrog