Feature request: define regex excludes via attributes in code
We have a workspace consisting of 50 crates, which means maintaining one central list of regex excludes would be difficult to maintain and to keep in sync with the codebase. Due to this, we have mostly resorted to just #[mutants::skip] when needed. However, this has the disadvantage of disabling all mutations even if we only want to disable a specific one.
I was just upgrading to the latest version of cargo-mutants which added some mutations and it felt a bit bad to disable mutation of some functions just because the 1 new mutation added was not testable (but the 5 previous ones were).
Being able to define regex excludes in code would be a potentially more maintainable path that would let us keep taking full advantage of mutation testing.
Ideally, it would be function scoped, allowing something like:
#[mutants::exclude_re("delete match arm foo")]
fn blah() {
// ...
}
This feels like it is getting more important as more elaborate mutations get added - the probability of them all being testable will keep going down for each target function.
Sounds like a good idea!