-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
[php] Configure Psalm 6 default settings findUnusedBaselineEntry, findUnusedCode #234
[php] Configure Psalm 6 default settings findUnusedBaselineEntry, findUnusedCode #234
Conversation
This fixes a warning that outputs that we should be explicit about this setting. I picked enabling it as the solution.
We were not ready yet. These are now explicitly disabled, which takes care of the reminder message.
This tells Psalm that these are a part of an expected API.
php/psalm.xml
Outdated
@@ -2,6 +2,8 @@ | |||
<psalm | |||
errorLevel="1" | |||
resolveFromConfigFile="true" | |||
findUnusedBaselineEntry="true" | |||
findUnusedCode="true" |
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.
I'd put these on to false. To get some warnings out of the way and then tackle what is left piece meal. Especially in the generated code it will be hard to follow psalms recommendations.
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.
I did put them to false, which didn't change the output. That confused me, so I continued on the track "follow the suggestions".
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.
Weird. I can't reproduce that locally. Pushed a commit to see if it matters.
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.
@mpkorstanje This is super! Thanks for bringing it over the line. A lot less output!
* Run `vendor/bin/psalm --no-cache --alter --issues=MissingParamType` * Bump "phpunit/phpunit": "^10.5" to minimum deps run doesn't use a version that is too old * Upgrade to latest phpunit.xml format * Set findUnusedBaselineEntry="false" and findUnusedCode="false" to suppress paslm warnings
There! |
🤔 What's changed?
Psalm's offering news, and our CI had not configured those settings.
This PR fixes a warning that outputs that we should be explicit about this setting.
First, I picked enabling it as the solution. (And, then I continued on that path.)
Psalm in CI: found some issues: 9 errors found
OK, so perhaps "enable" wasn't the right way, let's see if disabling will lead to nicer output? I learned a little, and placed some Psalm annotations in the code, in order to tell Psalm "these properties on the exceptions, they're expected, across all our implementations".
That got us a shorter list of Psalm offenses.
Psalm in CI: 5 errors found
Upon thinking about those issues reported, I sort of think that it can absolutely be that it's part of the API to have some unused parameters (in code like AST handling callbacks). So, perhaps they're all
@psalm-api
.⚡️ What's your motivation?
CI output should be terse, clear and focused. This change hopes to make it less noisy.
🏷️ What kind of change is this?
🏦 Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)
I agree to respect and uphold the Cucumber Community Code of Conduct