Remove deprecated CLI option --format (#10170) · astral-sh/ruff@52f4c1e (original) (raw)

Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ use ruff_linter::settings::types::SerializationFormat;
18 18 use ruff_linter::{fs, warn_user, warn_user_once};
19 19 use ruff_workspace::Settings;
20 20
21 -use crate::args::{Args, CheckCommand, Command, FormatCommand, HelpFormat};
21 +use crate::args::{Args, CheckCommand, Command, FormatCommand};
22 22 use crate:🖨️:{Flags as PrinterFlags, Printer};
23 23
24 24 pub mod args;
@@ -114,15 +114,6 @@ fn resolve_default_files(files: Vec, is_stdin: bool) -> Vec {
114 114 }
115 115 }
116 116
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 -
126 117 pub fn run(
127 118 Args {
128 119 command,
@@ -171,10 +162,8 @@ pub fn run(
171 162 Command::Rule {
172 163 rule,
173 164 all,
174 - format,
175 -mut output_format,
165 + output_format,
176 166 } => {
177 - output_format = resolve_help_output_format(output_format, format);
178 167 if all {
179 168 commands::rule::rules(output_format)?;
180 169 }
@@ -187,11 +176,7 @@ pub fn run(
187 176 commands::config::config(option.as_deref())?;
188 177 Ok(ExitStatus::Success)
189 178 }
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 } => {
195 180 commands::linter::linter(output_format)?;
196 181 Ok(ExitStatus::Success)
197 182 }