Psalm: Generate XML report in Checkstyle format

Created on 8 May 2019  路  6Comments  路  Source: vimeo/psalm

It would be great to generate XML report in Checkstyle format, this way it could be parsed by other tools out of the box, e.g. a CI server like Teamcity or Jenkins.

both phan and phpstan are already able to make reports in this format:
similar issue for phpstan: https://github.com/phpstan/phpstan/issues/271

Most helpful comment

For now I have opened an issue so that the feature request is not forgotten :slightly_smiling_face:.

All 6 comments

Thanks! Running latest master with --report=checkstyle.xml or --output-format=checkstyle will get you what you want

How do I prevent issues with severity "info" from being included in the checkstyle file?

Using command psalm --show-info=false --report=checkstyle.xml prevents issues with severity "info" from being displayed on stdout but the checkstyle.xml file still has them.

Yeah, --show-info=false just controls stdout - everything else has info in.

How do I prevent issues with severity "info" from being included in the checkstyle file?

You can't - at least, that's not something I've designed. I suppose you could open a PR for something like --report-level=error

For now I have opened an issue so that the feature request is not forgotten :slightly_smiling_face:.

@muglug This is awesome and it's just amazing how quickly you responded!
This first implementation almost works :) it just needs proper escaping for the values inserted into the XML so that it's valid XML and could be parsed by various parsers.

I filed a new issue about that: https://github.com/vimeo/psalm/issues/1620

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ADmad picture ADmad  路  3Comments

zerkms picture zerkms  路  3Comments

vudaltsov picture vudaltsov  路  3Comments

tux-rampage picture tux-rampage  路  3Comments

muglug picture muglug  路  3Comments