Skip to content

revert adding post rectors to applied rules as not relevant in result#7365

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-avoid-post-rectors-as-hidden-feature
Sep 29, 2025
Merged

revert adding post rectors to applied rules as not relevant in result#7365
TomasVotruba merged 1 commit into
mainfrom
tv-avoid-post-rectors-as-hidden-feature

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Sep 29, 2025

Copy link
Copy Markdown
Member

Partially reverts: https://github.com/rectorphp/rector-src/pull/7304/files

Ref rectorphp/rector#9373

I'm testing this feature and it shows under every single change, as most of changes do include object from time to time.
This is not very helpful, as new users is trying to understand what 5 of those magical post-rules. Also demo link will not work to create test fixture, as exactly 1 rule must be applied.

Autoimport is a standalone features, because of its complexity. It's not a rule per-se.
Saying that, I'm reverting these post rules from being shown in the result, to keep reports nice and tidy to read 👍

@TomasVotruba TomasVotruba force-pushed the tv-avoid-post-rectors-as-hidden-feature branch from b268cb0 to bbb3be6 Compare September 29, 2025 16:48
@TomasVotruba TomasVotruba force-pushed the tv-avoid-post-rectors-as-hidden-feature branch from bbb3be6 to 82aeb38 Compare September 29, 2025 16:50
@TomasVotruba TomasVotruba merged commit 48c564a into main Sep 29, 2025
50 checks passed
@TomasVotruba TomasVotruba deleted the tv-avoid-post-rectors-as-hidden-feature branch September 29, 2025 16:53
@simonschaufi

simonschaufi commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Instead of reverting it completely, I would at least appreciate a configuration option because I really want to see what is going on. There should be a way to show the post rectors in order to know how to disable them for certain files because I have a scenario where I can't import namespaces neither in php nor in the doc blocks.

What do you think about a configuration option or a cli parameter?

@samsonasik

Copy link
Copy Markdown
Member

@TomasVotruba I agree with @simonschaufi, I will create PR to make it configurable, disable by default.

@TomasVotruba

Copy link
Copy Markdown
Member Author

There is already many options. I want to keep config as simple as it is.

@samsonasik

Copy link
Copy Markdown
Member

The @return needs to be updated to only RectorInterface then to:

-@return array<class-string<RectorInterface|PostRectorInterface>>
+@return array<class-string<RectorInterface>>

since PostRectorInterface is filter out.

@samsonasik

Copy link
Copy Markdown
Member

@simonschaufi

Copy link
Copy Markdown
Contributor

There is already many options. I want to keep config as simple as it is.

So what do you suggest instead? I would love to hear your opinion how to still display the post rectors if wanted.

@samsonasik

Copy link
Copy Markdown
Member

@simonschaufi I created new PR:

in case @TomasVotruba will consider that

@rectorphp rectorphp locked as resolved and limited conversation to collaborators Sep 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants