Skip to content

Was chain_width removed? #4437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DumpsterDoofus opened this issue Sep 24, 2020 · 2 comments
Closed

Was chain_width removed? #4437

DumpsterDoofus opened this issue Sep 24, 2020 · 2 comments

Comments

@DumpsterDoofus
Copy link

DumpsterDoofus commented Sep 24, 2020

Describe the bug

chain_width is documented as a stable option at https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#chain_width. However, it doesn't seem to exist as a configuration option. Am I misusing it?

To Reproduce

In a new project directory, create a file rustfmt.toml with these contents:

chain_width=10

In that directory, run cargo fmt.

Expected behavior

Formatting succeeds. Long function call chains are formatted on separate lines.

Actual behavior

A warning is printed:

Warning: Unknown configuration option `chain_width`

Long function call chains are formatted on one line.

Meta

  • rustfmt version: rustfmt 1.4.18-stable (8157a3f 2020-07-15)
  • From where did you install rustfmt?: rustup component add rustfmt
  • How do you run rustfmt: cargo fmt
@DumpsterDoofus DumpsterDoofus added the bug Panic, non-idempotency, invalid code, etc. label Sep 24, 2020
@calebcartwright
Copy link
Member

Thanks for the question @DumpsterDoofus . You are looking at the configuration options for the latest version of rustfmt in source (v2.x), but you are using a different version of rustfmt v1.4.18.

As mentioned in the Configurations.md file you referenced:

Below you can find a detailed visual guide on all the supported configuration options of rustfmt.

Note that the below list reflects the configuration options available on the latest version of rustfmt in source control. Some newer options may not be available yet in a released version of rustfmt.

For version- and channel-specific configurations, please visit https://rust-lang.github.io/rustfmt/.

Looks like the tag is missing for 1.4.18 but you can use this: https://rust-lang.github.io/rustfmt/?version=v1.4.20&search= to browse available options for the version of rustfmt you are using (there were no config changes between 1.4.18 and 1.4.20)

@doivosevic
Copy link

can we know if 2.0 is planned for 2020 or is there a roadmap somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants