Skip to content

Commit d1e15f6

Browse files
MichaReiserAlexWaygood
authored andcommitted
Remove tab-size setting (#12835)
Co-authored-by: Alex Waygood <[email protected]> Closes #12041
1 parent 89a8215 commit d1e15f6

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

crates/ruff/tests/format.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,13 @@ if True:
818818
819819
----- stderr -----
820820
ruff failed
821-
Cause: The `tab-size` option has been renamed to `indent-width` to emphasize that it configures the indentation used by the formatter as well as the tab width. Please update `[RUFF-TOML-PATH]` to use `indent-width = <value>` instead.
821+
Cause: Failed to parse [RUFF-TOML-PATH]
822+
Cause: TOML parse error at line 1, column 1
823+
|
824+
1 |
825+
| ^
826+
unknown field `tab-size`
827+
822828
"###);
823829
});
824830
Ok(())

crates/ruff_workspace/src/configuration.rs

-9
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,6 @@ impl Configuration {
445445
}
446446
};
447447

448-
#[allow(deprecated)]
449-
if options.tab_size.is_some() {
450-
let config_to_update = path.map_or_else(
451-
|| String::from("your `--config` CLI arguments"),
452-
|path| format!("`{}`", fs::relativize_path(path)),
453-
);
454-
return Err(anyhow!("The `tab-size` option has been renamed to `indent-width` to emphasize that it configures the indentation used by the formatter as well as the tab width. Please update {config_to_update} to use `indent-width = <value>` instead."));
455-
}
456-
457448
Ok(Self {
458449
builtins: options.builtins,
459450
cache_dir: options

crates/ruff_workspace/src/options.rs

-11
Original file line numberDiff line numberDiff line change
@@ -415,17 +415,6 @@ pub struct Options {
415415
)]
416416
pub indent_width: Option<IndentWidth>,
417417

418-
/// The number of spaces a tab is equal to when enforcing long-line violations (like `E501`)
419-
/// or formatting code with the formatter.
420-
///
421-
/// This option changes the number of spaces inserted by the formatter when
422-
/// using soft-tabs (`indent-style = space`).
423-
#[deprecated(
424-
since = "0.1.2",
425-
note = "The `tab-size` option has been renamed to `indent-width` to emphasize that it configures the indentation used by the formatter as well as the tab width. Please update your configuration to use `indent-width = <value>` instead."
426-
)]
427-
pub tab_size: Option<IndentWidth>,
428-
429418
#[option_group]
430419
pub lint: Option<LintOptions>,
431420

ruff.schema.json

-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)