Skip to content

Commit 52f4c1e

Browse files
Remove deprecated CLI option --format (#10170)
Co-authored-by: Tibor Reiss <tibor.reiss@gmail.com>
1 parent eceffe7 commit 52f4c1e

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

crates/ruff/src/args.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ pub enum Command {
6363
/// Output format
6464
#[arg(long, value_enum, default_value = "text")]
6565
output_format: HelpFormat,
66-
67-
/// Output format (Deprecated: Use `--output-format` instead).
68-
#[arg(long, value_enum, conflicts_with = "output_format", hide = true)]
69-
format: Option<HelpFormat>,
7066
},
7167
/// List or describe the available configuration options.
7268
Config { option: Option<String> },
@@ -75,10 +71,6 @@ pub enum Command {
7571
/// Output format
7672
#[arg(long, value_enum, default_value = "text")]
7773
output_format: HelpFormat,
78-
79-
/// Output format (Deprecated: Use `--output-format` instead).
80-
#[arg(long, value_enum, conflicts_with = "output_format", hide = true)]
81-
format: Option<HelpFormat>,
8274
},
8375
/// Clear any caches in the current directory and any subdirectories.
8476
#[clap(alias = "--clean")]

crates/ruff/src/lib.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use ruff_linter::settings::types::SerializationFormat;
1818
use ruff_linter::{fs, warn_user, warn_user_once};
1919
use ruff_workspace::Settings;
2020

21-
use crate::args::{Args, CheckCommand, Command, FormatCommand, HelpFormat};
21+
use crate::args::{Args, CheckCommand, Command, FormatCommand};
2222
use crate::printer::{Flags as PrinterFlags, Printer};
2323

2424
pub mod args;
@@ -114,15 +114,6 @@ fn resolve_default_files(files: Vec<PathBuf>, is_stdin: bool) -> Vec<PathBuf> {
114114
}
115115
}
116116

117-
/// Get the actual value of the `format` desired from either `output_format`
118-
/// or `format`, and warn the user if they're using the deprecated form.
119-
fn resolve_help_output_format(output_format: HelpFormat, format: Option<HelpFormat>) -> HelpFormat {
120-
if format.is_some() {
121-
warn_user!("The `--format` argument is deprecated. Use `--output-format` instead.");
122-
}
123-
format.unwrap_or(output_format)
124-
}
125-
126117
pub fn run(
127118
Args {
128119
command,
@@ -171,10 +162,8 @@ pub fn run(
171162
Command::Rule {
172163
rule,
173164
all,
174-
format,
175-
mut output_format,
165+
output_format,
176166
} => {
177-
output_format = resolve_help_output_format(output_format, format);
178167
if all {
179168
commands::rule::rules(output_format)?;
180169
}
@@ -187,11 +176,7 @@ pub fn run(
187176
commands::config::config(option.as_deref())?;
188177
Ok(ExitStatus::Success)
189178
}
190-
Command::Linter {
191-
format,
192-
mut output_format,
193-
} => {
194-
output_format = resolve_help_output_format(output_format, format);
179+
Command::Linter { output_format } => {
195180
commands::linter::linter(output_format)?;
196181
Ok(ExitStatus::Success)
197182
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy