-
-
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
Skip analysis when no executed lines with --git-diff-lines
option
#1688
Skip analysis when no executed lines with --git-diff-lines
option
#1688
Conversation
48e58b0
to
4774c54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor suggestion, otherwise looks good 👍
{ | ||
public static function create(): self | ||
{ | ||
return new self('No files in diff found, skipping mutation analysis.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return new self('No files in diff found, skipping mutation analysis.'); | |
return new self('No covered lines in in diff found, skipping mutation analysis.'); |
or something similar, because the current error message is from another exception :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I kept the message on purpose because I thought it made sense in this situation as well, but there is a slight difference indeed. Thanks for the review!
When using the `--git-diff-lines` option, there are situations where a file can be modified but will not yield any test change, for instance when only a comment is modified in a PHP source file. This commit prevents an error being thrown when this very situation occurs; instead, the analysis is skipped.
4774c54
to
eadbd4e
Compare
Thank you @romm |
Released as https://github.com/infection/infection/releases/tag/0.26.9 Enjoy! |
That was fast! thank you!! |
This PR:
When using the
--git-diff-lines
option, there are situations where afile can be modified but will not yield any test change, for instance
when only a comment is modified in a PHP source file.
This commit prevents an error being thrown when this very situation
occurs; instead, the analysis is skipped.