From 2f32a57cf469a8814eaf4eb8f680790ac5837d4e Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 24 Oct 2023 08:58:01 +0900 Subject: [PATCH] Remove `--line-length` option from `format` command (#8131) --- crates/ruff_cli/src/args.rs | 4 ---- crates/ruff_python_formatter/README.md | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/ruff_cli/src/args.rs b/crates/ruff_cli/src/args.rs index 50eef6a92b8e1..4ebcf17fa78c2 100644 --- a/crates/ruff_cli/src/args.rs +++ b/crates/ruff_cli/src/args.rs @@ -402,9 +402,6 @@ pub struct FormatCommand { force_exclude: bool, #[clap(long, overrides_with("force_exclude"), hide = true)] no_force_exclude: bool, - /// Set the line-length. - #[arg(long, help_heading = "Rule configuration", hide = true)] - pub line_length: Option, /// Ignore all configuration files. #[arg(long, conflicts_with = "config", help_heading = "Miscellaneous")] pub isolated: bool, @@ -547,7 +544,6 @@ impl FormatCommand { stdin_filename: self.stdin_filename, }, CliOverrides { - line_length: self.line_length, respect_gitignore: resolve_bool_arg( self.respect_gitignore, self.no_respect_gitignore, diff --git a/crates/ruff_python_formatter/README.md b/crates/ruff_python_formatter/README.md index d7a72a41d2334..d23e39aee6b87 100644 --- a/crates/ruff_python_formatter/README.md +++ b/crates/ruff_python_formatter/README.md @@ -118,11 +118,10 @@ quote-style = "single" ``` The Ruff formatter also respects Ruff's [`line-length`](https://docs.astral.sh/ruff/settings/#line-length) -setting, which also can be provided via a `pyproject.toml` or `ruff.toml` file, or on the CLI, as -in: +setting, which also can be provided via a `pyproject.toml` or `ruff.toml` file. -```console -ruff format --line-length 100 /path/to/file.py +```toml +line-length = 80 ``` ### Excluding code from formatting