Skip to content

Commit 2978995

Browse files
committed
Remove obsolete unstable --output-format warning for formatter
The warning that `--output-format` for the formatter requires preview mode is no longer needed since astral-sh#17138 stabilized formatter output format support. Closes astral-sh#23267 https://claude.ai/code/session_0151C636aixLhqvzG7BURQ7P
1 parent e84b0f4 commit 2978995

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

crates/ruff/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,8 @@ pub fn run(
212212
}
213213

214214
fn format(args: FormatCommand, global_options: GlobalConfigArgs) -> Result<ExitStatus> {
215-
let cli_output_format_set = args.output_format.is_some();
216215
let (cli, config_arguments) = args.partition(global_options)?;
217216
let pyproject_config = resolve::resolve(&config_arguments, cli.stdin_filename.as_deref())?;
218-
if cli_output_format_set && !pyproject_config.settings.formatter.preview.is_enabled() {
219-
warn_user_once!(
220-
"The --output-format flag for the formatter is unstable and requires preview mode to use."
221-
);
222-
}
223217
if is_stdin(&cli.files, cli.stdin_filename.as_deref()) {
224218
commands::format_stdin::format_stdin(&cli, &config_arguments, &pyproject_config)
225219
} else {

crates/ruff/tests/cli/format.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,25 +2399,6 @@ fn cookiecutter_globbing() -> Result<()> {
23992399
Ok(())
24002400
}
24012401

2402-
#[test]
2403-
fn stable_output_format_warning() -> Result<()> {
2404-
let test = CliTest::new()?;
2405-
assert_cmd_snapshot!(
2406-
test.format_command()
2407-
.args(["--output-format=full", "-"])
2408-
.pass_stdin(""),
2409-
@"
2410-
success: true
2411-
exit_code: 0
2412-
----- stdout -----
2413-
2414-
----- stderr -----
2415-
warning: The --output-format flag for the formatter is unstable and requires preview mode to use.
2416-
",
2417-
);
2418-
Ok(())
2419-
}
2420-
24212402
#[test]
24222403
fn markdown_formatting_preview_disabled() -> Result<()> {
24232404
let test = CliTest::new()?;

0 commit comments

Comments
 (0)