-
Notifications
You must be signed in to change notification settings - Fork 250
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
Allow users to ignore mutants based on heuristics #3229
Comments
Note: we currently already have some arbitrary ignore rules configured in the babel-transformer. A good approach might be to abstract those away in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ignore-plugins are released in StrykerJS 7.3 🎉 https://twitter.com/stryker_mutator/status/1713557660832792870 https://stryker-mutator.io/docs/stryker-js/disable-mutants/#using-an-ignore-plugin |
Is your feature request related to a problem? Please describe.
We have had a couple of requests in the past to allow to ignore specific mutants:
#2966 #1174 #1470 #1464
Some of these issues have been solved by allowing users to ignore using a comment, however, this isn't always practical.
For large codebases where you want to ignore the same pattern every time. For example:
console.log()
.Or you want to ignore mutants based on some other data, for example using the result of a git command, like the git checker seems to be doing.
Describe the solution you'd like
I would like to be able to ignore specific mutants based on heuristics (for lack of a better word). It would be run inside the instrumenter on each AST node visitation. It could then decide to ignore the current node with a reason.
The API could look like this
We should document some examples for common use cases, like ignoring
console.log
statements. Issue #3230 needs to be solved to allow for locally defined plugins.Describe alternatives you've considered
There are a number of issues linked where users thought of different approaches. However, I think this abstraction makes the most sense. It allows for the most freedom.
Additional context
All current plugin APIs are located inside the
@stryker-mutator/api
package. I want this to be no exception. However, theNodePath
interface comes from@babel/core
. I don't want that to be part of the dependencies of the API package. So we might want to mark it as a dev dependency 🤷♀️The text was updated successfully, but these errors were encountered: