-
Notifications
You must be signed in to change notification settings - Fork 57
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
Exit code is ignored from phpmd (parsing errors for new php syntax) #230
Comments
I'm not sure if exit code strategy should be changed. phpqa counts phpmd violations, not parsing errors. There was similar issue for some php7 syntax: phpmd does not support new syntax. Different exit code is ignored, something is displayed in "Parsing errors" tab in html report. Let's say phpqa respects phpmd's exit code. You can't fix the build unless phpmd releases new version. You could ignore the file, but it would be ignored for phpcs, phpstan etc. I'm open to proposals. It could be overriden in config, but I don't think it should be default behavior. If you need it, you can use analysis without html report. CLI report analyzes only exit code: phpqa --tools phpmd:0 --output cli |
Well it would be important to find a solution for this as in cases like this we literally tought everything was working fine, pipeline was passing, while in fact we were introducing lal kinds of violations. I will think about it. |
Brainstorming notes... A) Similar solution like for phpcs 'errorsXPath' => [
# ignoreWarnings => xpath
false => '//checkstyle/file/error',
true => '//checkstyle/file/error[@severity="error"]',
],
Big disadvantage, that you can't fix the build unless phpmd releases new version. B) Display skipped errors somewhere Exit code strategy is not changed. Just display number of phpmd's parsing errors, phpcs's warnings somewhere in CLI output. +---------+----------------+--------------+--------+----------------------------+
| Tool | Allowed Errors | Errors count | Is OK? | HTML report |
+---------+----------------+--------------+--------+----------------------------+
| phpcs | 0 | 0 (10) | ✓! | .phpqa-report/phpcs.html |
| phpmd | 0 | 0 (2) | ✓! | .phpqa-report/phpmd.html |
+---------+----------------+--------------+--------+----------------------------+ |
Well I also taught about this and you are right about this |
It's described in #237:
|
Phpmd (v2.10.0) fails for a particular reason in this case (issue with trailing commas in function arguments):
The exit code is printed correctly but phpqa considers this a success.
The text was updated successfully, but these errors were encountered: