Skip to content

Let empty files be empty files (reprise)#6940

Open
notpeter wants to merge 5 commits into
rust-lang:mainfrom
notpeter:empty_files_again
Open

Let empty files be empty files (reprise)#6940
notpeter wants to merge 5 commits into
rust-lang:mainfrom
notpeter:empty_files_again

Conversation

@notpeter

@notpeter notpeter commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

No longer add a "final newline" to empty files.
Empty files shouldn't need need trailing newlines.

Much simpler than previous version.

@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Jun 12, 2026
@ytmimi

ytmimi commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@notpeter can you remind me why we're repurposing the */reorder_module tests for this PR and creating */reorder_module_2027? Is reordering the mods related to these whitespace changes? I'm a little confused by that right now.

Wouldn't it make more sense to create some new distinct test cases for what we're working on.

@ytmimi ytmimi self-assigned this Jun 12, 2026
@notpeter

Copy link
Copy Markdown
Contributor Author

When I was doing that PR, I was really bummed when it felt appropriate to duplicate the tree. In this PR, I've now switched from duplicated versions and instead added rustfmt-skip_children for the 2027 reorder tests. This way it will not attempt to reformat all the fixtures (which are empty files with newlines) and the rest of reorder_modules retains coverage under StyleEdition 2027. I think that leads to a simpler/clearer PR without having to duplicate a tree of dozens of empty files.

@ytmimi ytmimi Jun 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid making any changes to the reorder_modules test cases. It's still not clear to me why we're updating these existing test cases. I think we should create new distinct test cases that don't modify any of the old tests.

View changes since the review

@ytmimi

ytmimi commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: awaiting review from the assignee but also interested parties. labels Jun 12, 2026
@rustbot

rustbot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustfmt fails on an empty file; --check's diff doesn't result in properly formatted file

3 participants