-
Notifications
You must be signed in to change notification settings - Fork 359
Use Psalm for static code analysis #1764
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
base: dev
Are you sure you want to change the base?
Conversation
I spent some more time today bringing this up to date and trying to resolve issues. One of the most prevalent errors is that Psalm doesn't like factories stating We should revisit this in the future and see if the bug is fixed. |
I'm flagging this as "on hold" until vimeo/psalm#3621 is resolved, since we currently can't get the error list to clear out without intersection types working properly. |
I took a few minutes today to bring this up to date. I think the existing problem with union types remains unresolved, but I thought it might be helpful to get this integrated with GitHub Actions, etc. |
I've managed to get the build to pass here by suppressing several of the false-positive errors that have been causing problems. Perhaps the best approach for moving forward here is to either suppress or resolve all remaining errors until we have a clean baseline. Then we can re-evaluate the suppressed checks to see which ones are completely useless and which ones might be valuable in combination with appropriate code annotations. I can already see that some of the issues Psalm can detect and fix will lead to improvements in code quality, so it seems worth getting some of those benefits as soon as we can, even if it means not taking full advantage of everything Psalm has to offer right away. |
Psalm is a static code analysis tool that we can add to our toolkit for improving VuFind's code quality. This PR introduces it.
TODO: