Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less scary ruff format message #7867

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions crates/ruff_cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::sync::mpsc::channel;

use anyhow::Result;
use clap::CommandFactory;
use colored::Colorize;
use log::warn;
use notify::{recommended_watcher, RecursiveMode, Watcher};

Expand Down Expand Up @@ -104,8 +105,6 @@ pub fn run(
}: Args,
) -> Result<ExitStatus> {
{
use colored::Colorize;

let default_panic_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
#[allow(clippy::print_stderr)]
Expand Down Expand Up @@ -166,10 +165,7 @@ pub fn run(
}

fn format(args: FormatCommand, log_level: LogLevel) -> Result<ExitStatus> {
warn_user_once!(
"`ruff format` is a work-in-progress, subject to change at any time, and intended only for \
experimentation."
);
warn_user_once!("`ruff format` is not yet stable, and subject to change in future versions.");

let (cli, overrides) = args.partition();

Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_cli/tests/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if condition:
print('Hy "Micha"') # Should not change quotes

----- stderr -----
warning: `ruff format` is a work-in-progress, subject to change at any time, and intended only for experimentation.
warning: `ruff format` is not yet stable, and subject to change in future versions.
"###);
}

Expand Down Expand Up @@ -83,7 +83,7 @@ if condition:
print('Should change quotes')

----- stderr -----
warning: `ruff format` is a work-in-progress, subject to change at any time, and intended only for experimentation.
warning: `ruff format` is not yet stable, and subject to change in future versions.
"###);
Ok(())
}
Expand Down Expand Up @@ -139,7 +139,7 @@ if condition:
print('Should change quotes')

----- stderr -----
warning: `ruff format` is a work-in-progress, subject to change at any time, and intended only for experimentation.
warning: `ruff format` is not yet stable, and subject to change in future versions.
"###);
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_cli/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ fn stdin_format_jupyter() {
}

----- stderr -----
warning: `ruff format` is a work-in-progress, subject to change at any time, and intended only for experimentation.
warning: `ruff format` is not yet stable, and subject to change in future versions.
"###);
}

Expand Down
Loading