Skip to content

Commit

Permalink
Remove --line-length option from format command (#8131)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Oct 23, 2023
1 parent 802616a commit 2f32a57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions crates/ruff_cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<LineLength>,
/// Ignore all configuration files.
#[arg(long, conflicts_with = "config", help_heading = "Miscellaneous")]
pub isolated: bool,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions crates/ruff_python_formatter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f32a57

Please sign in to comment.