phpat
phpat copied to clipboard
Support checkstyle format / GithubActions annotations
GithubActions supports annotations within changed files. These can be achieved with https://github.com/staabm/annotate-pull-request-from-checkstyle when the tool in question supports output in the checkstyle format.
That means one can actually see errors detected by the tool on a per line basis in the „files changed“ tab of a pull request (see screenshots in the repo)
See https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/acc2aad7ceb544a414c9c87587d688393649a9c4/src/Report/CheckstyleReporter.php#L41 as a reference implementation
Hi. It's a good enhancement. The tool is kind of ready to create a second output implementation, but there would be some things to change on the current behaviour:
- Save every occurrence of a dependency in the AST (currently only saved once) and performe the unique check in the
mustOnly
andcanOnly
assertions. - Save the line of the occurrence in the AST.
- Implement the CheckstyleOutput from OutputInterface.
- Create an option to chose an output (or more than one maybe).
Since I'm refactoring a bit the AST collectors, I will start implementing the first 2 steps ASAP. I will put the issue on hold until this previous steps are done.
Thank you!
PHPat has been rebuilt as a PHPStan extension (v0.10). This feature is now included 🙂