mirror of https://github.com/astral-sh/ruff
Remove `--line-length` option from `format` command (#8131)
This commit is contained in:
parent
802616aac0
commit
2f32a57cf4
|
|
@ -402,9 +402,6 @@ pub struct FormatCommand {
|
||||||
force_exclude: bool,
|
force_exclude: bool,
|
||||||
#[clap(long, overrides_with("force_exclude"), hide = true)]
|
#[clap(long, overrides_with("force_exclude"), hide = true)]
|
||||||
no_force_exclude: bool,
|
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.
|
/// Ignore all configuration files.
|
||||||
#[arg(long, conflicts_with = "config", help_heading = "Miscellaneous")]
|
#[arg(long, conflicts_with = "config", help_heading = "Miscellaneous")]
|
||||||
pub isolated: bool,
|
pub isolated: bool,
|
||||||
|
|
@ -547,7 +544,6 @@ impl FormatCommand {
|
||||||
stdin_filename: self.stdin_filename,
|
stdin_filename: self.stdin_filename,
|
||||||
},
|
},
|
||||||
CliOverrides {
|
CliOverrides {
|
||||||
line_length: self.line_length,
|
|
||||||
respect_gitignore: resolve_bool_arg(
|
respect_gitignore: resolve_bool_arg(
|
||||||
self.respect_gitignore,
|
self.respect_gitignore,
|
||||||
self.no_respect_gitignore,
|
self.no_respect_gitignore,
|
||||||
|
|
|
||||||
|
|
@ -118,11 +118,10 @@ quote-style = "single"
|
||||||
```
|
```
|
||||||
|
|
||||||
The Ruff formatter also respects Ruff's [`line-length`](https://docs.astral.sh/ruff/settings/#line-length)
|
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
|
setting, which also can be provided via a `pyproject.toml` or `ruff.toml` file.
|
||||||
in:
|
|
||||||
|
|
||||||
```console
|
```toml
|
||||||
ruff format --line-length 100 /path/to/file.py
|
line-length = 80
|
||||||
```
|
```
|
||||||
|
|
||||||
### Excluding code from formatting
|
### Excluding code from formatting
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue