Skip to content
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: Added support for Psalm static analyzer #7810

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

troizet
Copy link
Collaborator

@troizet troizet commented Sep 29, 2024

This PR adds support for the Psalm static analyzer.
https://psalm.dev/

php_psal_support.mp4

Most of it is copying code from PHPStan. The main differences are in the command to start the analyzer in Psalm.java.

Also in this PR the file PHPStanStyleReportParser.java is renamed to CheckStyleReportParser.java and is used for both PHPStan and Psalm.

Also, the image file for Psalm is a copy of textDetail.png from the Search API module.

Tested on Psalm version 5.26.1

@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label Sep 29, 2024
Copy link
Member

@tmysik tmysik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; please, let @junichi11 review it too. Thanks!

Copy link
Member

@junichi11 junichi11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great because this is implemented based on the existing code :)
Just in case, I would add unit tests using the actual results of an example. Thanks!

@troizet
Copy link
Collaborator Author

troizet commented Oct 5, 2024

I would add unit tests using the actual results of an example

Added a test for parsing psalm output.

Copy link
Member

@junichi11 junichi11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

@junichi11 junichi11 added this to the NB24 milestone Oct 5, 2024
@junichi11 junichi11 merged commit d04b41d into apache:master Oct 5, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants