Skip to content

Remove most trailing whitespace across cargo (particularly markdown) - #17358

Merged
weihanglo merged 2 commits into
rust-lang:masterfrom
joshtriplett:no-trailing-whitespace
Aug 14, 2026
Merged

Remove most trailing whitespace across cargo (particularly markdown)#17358
weihanglo merged 2 commits into
rust-lang:masterfrom
joshtriplett:no-trailing-whitespace

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

Regularly, people send in PRs, and their editor introduces unrelated
changes by removing trailing whitespace.

Proactively remove trailing whitespace from most markdown files and rust
source.

This leaves unmodified the trailing spaces in:

  • Test snapshot output, because while we could represent the correct
    form, the snapshot testing tool won't use that format
  • Generated files
  • Manpages input, which we can handle in another pass

@rustbot rustbot added A-credential-provider Area: credential provider for storing and retreiving credentials A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo
  • Random selection from epage, weihanglo

@rustbot

This comment has been minimized.

Regularly, people send in PRs, and their editor introduces unrelated
changes by removing trailing whitespace.

Proactively remove trailing whitespace from most markdown files and rust
source.

This leaves unmodified the trailing spaces in:
- Test snapshot output, because while we could represent the correct
  form, the snapshot testing tool won't use that format
- Generated files
- Manpages input, which we can handle in another pass
@joshtriplett
joshtriplett force-pushed the no-trailing-whitespace branch from 68b5ef8 to 1d864ca Compare August 13, 2026 22:42
@rustbot rustbot added the A-documenting-cargo-itself Area: Cargo's documentation label Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread src/util/frontmatter.rs
---
fn main() {}
"#,
"--- cargo \n\

@weihanglo weihanglo Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did this change because the trailing --- cargo after infostring? Can we remove only that trailing instead?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@weihanglo That would change what this test is testing; given the name of the test, I think it's trying to test whitespace here.

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.

Did this need to happen? rustfmt handles trailing whitespace so we shouldn't need to police it and it is annoying to work with source in this style. Every time I see code like this, I switch it away from it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think Json was looking from an editor's angle. I am fine with either, though I agree with Ed that the old style is way readable.

Comment thread src/util/frontmatter.rs
Comment thread src/util/frontmatter.rs
@weihanglo
weihanglo enabled auto-merge August 13, 2026 22:49
@joshtriplett
joshtriplett force-pushed the no-trailing-whitespace branch from 7aace91 to b3b4fdb Compare August 13, 2026 22:55
@weihanglo
weihanglo added this pull request to the merge queue Aug 13, 2026
Merged via the queue into rust-lang:master with commit a9792b4 Aug 14, 2026
31 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2026
@joshtriplett
joshtriplett deleted the no-trailing-whitespace branch August 14, 2026 04:39
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Aug 15, 2026
Update cargo submodule

6 commits in eb98b54bc9f3c74519f43d066cb3fd02ebc88df0..8a0d8afba810304bcf9a10bac430be80dd470233
2026-08-11 16:00:29 +0000 to 2026-08-15 01:32:53 +0000
- chore: update to cc@1.4.3 (rust-lang/cargo#17364)
- Remove most trailing whitespace across cargo (particularly markdown) (rust-lang/cargo#17358)
- Remove unremap file when running cargo clean -p in new build-dir layout (rust-lang/cargo#17356)
- fix(update)!: Remove unstable `--breaking` (rust-lang/cargo#17333)
- docs: adopt rust-lang/rust's LLM usage policy (rust-lang/cargo#17330)
- fix(min-publish-age): remove `registry.min-publish-age` (rust-lang/cargo#17353)

r? ghost
@rustbot rustbot added this to the 1.100.0 milestone Aug 15, 2026
renovate-bot pushed a commit to renovate-bot/rust-lang-_-compiler-builtins that referenced this pull request Aug 17, 2026
Update cargo submodule

6 commits in eb98b54bc9f3c74519f43d066cb3fd02ebc88df0..8a0d8afba810304bcf9a10bac430be80dd470233
2026-08-11 16:00:29 +0000 to 2026-08-15 01:32:53 +0000
- chore: update to cc@1.4.3 (rust-lang/cargo#17364)
- Remove most trailing whitespace across cargo (particularly markdown) (rust-lang/cargo#17358)
- Remove unremap file when running cargo clean -p in new build-dir layout (rust-lang/cargo#17356)
- fix(update)!: Remove unstable `--breaking` (rust-lang/cargo#17333)
- docs: adopt rust-lang/rust's LLM usage policy (rust-lang/cargo#17330)
- fix(min-publish-age): remove `registry.min-publish-age` (rust-lang/cargo#17353)

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

Labels

A-credential-provider Area: credential provider for storing and retreiving credentials A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants