rust-lang / rust-lang/rustfmt

indent_style attribute finer configuration

Open
#3,316 5 comments 7 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

Hello!
In this PR where many *_indent configuration options were merged into one.
https://github.com/rust-lang/rustfmt/pull/2147

However, it can still be useful to have a possibility to do a finer configuration. What do you think about having old options alongside with indent_style? indent_style will thus set default behaviour which can be redefined for specific cases in other options.

rustfmt.toml could look like this:

indent_style = "Visual"
indent_style_where = "Block"

Where default value for indent_style_* is indent_style.

I can make a PR if there is any interest.

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 reviewing the earlier rustfmt/pull/2147 change and the current configuration represented by rustfmt.toml. Define how indent_style should provide defaults for indent_style_* options and how specific cases override it, then verify the proposed configuration behavior in rustfmt.

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.