Remove support for providing output format via format option (#7984)

See the provided breaking changes note for details.

Removes support for the deprecated `--format`option in the `ruff check`
CLI, `format` inference as `output-format` in the configuration file,
and the `RUFF_FORMAT` environment variable.

The error message for use of `format` in the configuration file could be
better, but would require some awkward serde wrappers and it seems hard
to present the correct schema to the user still.
This commit is contained in:
Zanie Blue 2023-10-16 13:06:12 -05:00 committed by GitHub
parent ee7575eb5a
commit 523f542dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 144 deletions

View file

@ -22,7 +22,7 @@ use ruff_python_trivia::CommentRanges;
use ruff_source_file::{Locator, SourceLocation};
use ruff_text_size::Ranged;
use ruff_workspace::configuration::Configuration;
use ruff_workspace::options::{FormatOptions, FormatOrOutputFormat, LintOptions, Options};
use ruff_workspace::options::{FormatOptions, LintOptions, Options};
use ruff_workspace::Settings;
#[wasm_bindgen(typescript_custom_section)]
@ -140,11 +140,11 @@ impl Workspace {
..LintOptions::default()
}),
format: Some(FormatOrOutputFormat::Format(FormatOptions {
format: Some(FormatOptions {
indent_style: Some(IndentStyle::Space),
quote_style: Some(QuoteStyle::Double),
..FormatOptions::default()
})),
}),
..Options::default()
})
.map_err(into_error)