Rustfmt: Was chain_width removed?

Created on 24 Sep 2020  路  2Comments  路  Source: rust-lang/rustfmt

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 (8157a3f0 2020-07-15)
  • From where did you install rustfmt?: rustup component add rustfmt
  • How do you run rustfmt: cargo fmt
bug

Most helpful comment

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)

All 2 comments

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)

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

Was this page helpful?
0 / 5 - 0 ratings