Skip to content

[ChangesReporting] Deprecate github and gitlab output formats - #8390

Merged
TomasVotruba merged 2 commits into
mainfrom
deprecate-static-analysis-output-formats
Aug 28, 2026
Merged

[ChangesReporting] Deprecate github and gitlab output formats#8390
TomasVotruba merged 2 commits into
mainfrom
deprecate-static-analysis-output-formats

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 28, 2026

Copy link
Copy Markdown
Member

Rector is a refactoring tool, not a static analysis tool. The github and gitlab output 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.

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
@TomasVotruba
TomasVotruba merged commit 33760c7 into main Aug 28, 2026
44 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-static-analysis-output-formats branch August 28, 2026 08:55
@jtojnar

jtojnar commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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.

Annotation shown in the Files tab

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.

@TomasVotruba

Copy link
Copy Markdown
Member Author

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.

jtojnar added a commit to fossar/selfoss that referenced this pull request Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants