rust-lang / rust-lang/rustfmt

`rustfmt::nowrap` attribute to disable all width constraints

Open
#5,551 0 comments 8 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

Some code or data can look substantially easier to read if not wrapped due to width constraints. For instance, a series of asserts in a test may align better if not wrapped.

rustfmt::skip allows fully manual formatting, but then rustfmt doesn't help with places that would always have newlines even without a width constraint.

Please consider adding a rustfmt::nowrap attribute, which disables width constraints within the code the attribute applies to, but still otherwise formats the code.

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

No files, tests, or entry points are named in the issue. Start by reviewing how rustfmt::skip and width constraints currently behave, then define the attribute's scope and expected formatting; done means width wrapping is disabled within that scope while other rustfmt formatting remains active.

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
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.