-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
with no match should raise an Error
#1604
Comments
…n't matched Implements #1604 Will be useful to remove stale/non-matching `ignoreSourceCodeByRegex` settings inside `infection.json` and will help debugging them.
Unmatched regexes should not lead to a non-zero exit status by default as there could be version-dependent mutants which do not always appear and trigger a regex, among other things. Showing a notice should be fine, though. |
Another possibility would be to make the behaviour configurable, for example as PHPStan is doing it: https://phpstan.org/user-guide/ignoring-errors#reporting-unused-ignores |
Also when applying on a diff, this cannot work. But yeah maybe a confit entry or a flag could help. |
There are also |
Hi, I've used quite few times
ignoreSourceCodeByRegex
(both global and per-mutator) and it may happen that, after a refactor, an ignore regex is not necessary anymore. But Infection doesn't tell me that, so I might forget the regex in place, and that could be very bad if, in a later commit, a new line-of-code matches the forgotten regex by accident.Just like PHPStan fails when an ignore regex is set but has no match during the check, I'd like Infection too to have an exit code over zero for unmatched
ignoreSourceCodeByRegex
.The text was updated successfully, but these errors were encountered: