New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignoreSourceCodeByRegex
: show ignored mutants on progress and summary
#1607
Comments
Agree, this is absolutely weird, didn't see it previously. I'm ok with adding Feel free to contribute, it's quite easy (though need some time to updated all tests). We have an example of adding |
I started to implement this feature request due to some free time and faced with a fact that we probably need to revise how Why? We have an But currently this mutator does not handle IMO we need to work with regex in the same way like we do for typical
Also I have a strong feeling that we can/should combine Thoughts? |
in this case, In pseudo code it would be # IgnoreMutator
public function canMutate(Node $node): bool
{
if (/* ignore regex is in the config */) {
$sourceCodeLine = // generate from $node;
if ($this->diffSourceCodeMatcher->matches($sourceCodeLine, $sourceCodeRegex)) {
return false;
}
}
} what I want to say, that it's not for free, we would need to generate source code line. And to be honest I don't know how to do it and even if this is possible. Consider the following case: $a = str_replace('a', foo(c('test' . 'bar'))); and ignore regex:
to ignore lines where
- $a = str_replace('a', foo(c('test')));
+ $a = foo(c('test'));
- $a = str_replace('a', foo(c('test'. 'bar')));
+ $a = str_replace('a', foo(c('test'))); in this case generating the code from That' s why in the current implementation of If you will find the way to solve the issues above, I'm +1 for your suggestion about moving it to
Regarding this: I'm looking into possible syntax of
and |
Implemented in #1612 |
Currently the ignored mutants are not shown on output, and it's weird to me to have a counter that doesn't reach its end.
It also gives a false sense of confidence that
100%
score is perfection: I like and want to have100%
score in this case, but it should be clear how perfect score was achieved.Here's a diff of one of my output, red is actual and green is expected:
The text was updated successfully, but these errors were encountered: