Skip to content

[Diffs] Handle --no-diffs usage to show file have been changed if any with --dry-run + --no-diffs#7619

Merged
TomasVotruba merged 8 commits intomainfrom
handle-no-diffs
Nov 11, 2025
Merged

[Diffs] Handle --no-diffs usage to show file have been changed if any with --dry-run + --no-diffs#7619
TomasVotruba merged 8 commits intomainfrom
handle-no-diffs

Conversation

@samsonasik
Copy link
Copy Markdown
Member

Fixes rectorphp/rector#9487

@indykoning @TomasVotruba this should can cover rectorphp/rector#9487

this may need verification for counting increment for parallel process tho :)

@samsonasik
Copy link
Copy Markdown
Member Author

It seems cause invalid result on end to end test, I will check more :)

@samsonasik samsonasik marked this pull request as draft November 11, 2025 04:44
@samsonasik samsonasik marked this pull request as ready for review November 11, 2025 08:41
@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 I will add e2e test for it :)

@samsonasik
Copy link
Copy Markdown
Member Author

I've added e2e test for it, it shows files changed without show the diff on --no-diffs, on verify locally, it shows 2 status:

➜  rector-src git:(handle-no-diffs) ✗ bin/rector process src/ChangesReporting/Output/ConsoleOutputFormatter.php --no-diffs --dry-run
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%                                                                                                                        
 [OK] 1 file would have been changed (dry-run) by Rector                                                                
                                                                                                                        
 ➜  rector-src git:(handle-no-diffs) ✗ echo $?
2

which 2 is ExitCode::CHANGED_CODE 👍

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 1a19a34 into main Nov 11, 2025
54 checks passed
@TomasVotruba TomasVotruba deleted the handle-no-diffs branch November 11, 2025 11:22
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 😇

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dry run combined with no diffs always exits with success code

2 participants