[ChangesReporting] Deprecate github and gitlab output formats - #8390
Conversation
Rector is a refactoring tool, not a static analysis tool. The github and gitlab code-quality output formats fit static analysers, not Rector, so deprecate both. They will be removed in the next minor version. A deprecation warning is printed to STDERR (via error style), so the machine-readable output on STDOUT stays clean. Claude-Session: https://claude.ai/code/session_01Ajwt4SBryQ2b5hvv2SMAds
The test intentionally exercises the now-deprecated formatter until removal. Claude-Session: https://claude.ai/code/session_01Ajwt4SBryQ2b5hvv2SMAds
|
Annotations are not just for static analysers, they are helpful for visualising any kind of issue with the code including those detected by linters and formatters. And we definitely use Rector as a linter against old idioms, which is why we run it in CI. Now, it is not critical that the issues are displayed in the GitHub PR’s Files tab but it can be helpful. Sometimes I am making PRs without the ability to run Rector locally. That is when I cannot or do not want to bother setting up PHP environment locally, like on mobile, when making small changes using GitHub’s web editor, or when doing trivial drive-by contributions to a third party project in a hurry. Then it is simply more convenient to see the suggestions directly in the code rather than having to click through actions log.
But yeah, I can see how the unified diff format is too noisy. The output format would ideally omit the diff context and only attach to the minus lines. Though https://github.com/orgs/community/discussions/206690 is still annoying us. |
|
Thanks for getting back to me. This is exactly what I want to avoid: Static analysis should inform you, Rector should work for you and not bother your with any output. I made a mistake making Rector a bit of both that lead to failing at both. Recent changes are getting back to PR and forget. So devs and agents can use it flawlessly, and give the reporting power back to IDE, static analysis tool if someone needs it. Hope this makes it more clear. |
It is becoming deprecated: rectorphp/rector-src#8390

Rector is a refactoring tool, not a static analysis tool. The
githubandgitlaboutput formats produce code-quality reports meant for static analysers (GitHub Actions annotations / GitLab CodeClimate JSON), which is a poor fit for Rector's diffs.Deprecate both. They will be removed in the next minor version.