Skip to content

Commit

Permalink
Remove tab-size setting (#12835)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Closes #12041
  • Loading branch information
MichaReiser authored and AlexWaygood committed Oct 17, 2024
1 parent 89a8215 commit d1e15f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
8 changes: 7 additions & 1 deletion crates/ruff/tests/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,13 @@ if True:
----- stderr -----
ruff failed
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.
Cause: Failed to parse [RUFF-TOML-PATH]
Cause: TOML parse error at line 1, column 1
|
1 |
| ^
unknown field `tab-size`
"###);
});
Ok(())
Expand Down
9 changes: 0 additions & 9 deletions crates/ruff_workspace/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,6 @@ impl Configuration {
}
};

#[allow(deprecated)]
if options.tab_size.is_some() {
let config_to_update = path.map_or_else(
|| String::from("your `--config` CLI arguments"),
|path| format!("`{}`", fs::relativize_path(path)),
);
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."));
}

Ok(Self {
builtins: options.builtins,
cache_dir: options
Expand Down
11 changes: 0 additions & 11 deletions crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,6 @@ pub struct Options {
)]
pub indent_width: Option<IndentWidth>,

/// The number of spaces a tab is equal to when enforcing long-line violations (like `E501`)
/// or formatting code with the formatter.
///
/// This option changes the number of spaces inserted by the formatter when
/// using soft-tabs (`indent-style = space`).
#[deprecated(
since = "0.1.2",
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."
)]
pub tab_size: Option<IndentWidth>,

#[option_group]
pub lint: Option<LintOptions>,

Expand Down
12 changes: 0 additions & 12 deletions ruff.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1e15f6

Please sign in to comment.