Skip to content
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

Add a debug ignore by regex command #1668

Open
theofidry opened this issue Feb 11, 2022 · 2 comments
Open

Add a debug ignore by regex command #1668

theofidry opened this issue Feb 11, 2022 · 2 comments

Comments

@theofidry
Copy link
Member

Sometimes especially when dealing with regexes, you find yourself to debug why it is not working. You check your regex against the assumed subject and see that it works but somehow applied to your application config it doesn't because there is more things going on: the regex is slightly altered by the app or the subject is not what you expect it to be.

I had this issue several times with PHP-Scoper (you can exclude/expose symbols based on a regex) and eventually I created the inspect-symbols command which allows to check the result.

I find myself in the exact same situation with infection with the ignoreByRegex configs and just end up putting a breakpoint and debug why it is not working. I think a command could help here.

WDYT?

@sanmai
Copy link
Member

sanmai commented Feb 11, 2022

I don't know if you had to ignore a lot of mutations, but if that's just one or two it might be easier to use @infection-ignore-all.

@theofidry
Copy link
Member Author

Hm at least for the case at hand I preferred to keep it at the mutator level: it was a pretty specific case.

But either way, you may end up with the same problem with @infection-ignore-all 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants