rust-lang / rust-lang/rustfmt

Option to respect existing line breaks

Open
#3,074 1 comment 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

I'd like an option for rustfmt to never delete existing line breaks.

Sounds like I'm not the only one who wants this functionality. I think having this option would eliminate a lot of #[rustfmt::skip] usecases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining rustfmt's handling of existing line breaks and the current #[rustfmt::skip] behavior. The issue names no files, tests, or entry points; done would require a defined option, documented behavior, and tests showing that existing breaks are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.