phpat icon indicating copy to clipboard operation
phpat copied to clipboard

Support checkstyle format / GithubActions annotations

Open staabm opened this issue 5 years ago • 1 comments

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

staabm avatar Jan 27 '20 20:01 staabm

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 and canOnly 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!

carlosas avatar Jan 27 '20 21:01 carlosas

PHPat has been rebuilt as a PHPStan extension (v0.10). This feature is now included 🙂

carlosas avatar Sep 24 '22 10:09 carlosas