mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
Less scary ruff format
message (#7867)
This commit is contained in:
parent
0f759af3cf
commit
ec9d5cddd6
3 changed files with 6 additions and 10 deletions
|
@ -6,6 +6,7 @@ use std::sync::mpsc::channel;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::CommandFactory;
|
use clap::CommandFactory;
|
||||||
|
use colored::Colorize;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use notify::{recommended_watcher, RecursiveMode, Watcher};
|
use notify::{recommended_watcher, RecursiveMode, Watcher};
|
||||||
|
|
||||||
|
@ -104,8 +105,6 @@ pub fn run(
|
||||||
}: Args,
|
}: Args,
|
||||||
) -> Result<ExitStatus> {
|
) -> Result<ExitStatus> {
|
||||||
{
|
{
|
||||||
use colored::Colorize;
|
|
||||||
|
|
||||||
let default_panic_hook = std::panic::take_hook();
|
let default_panic_hook = std::panic::take_hook();
|
||||||
std::panic::set_hook(Box::new(move |info| {
|
std::panic::set_hook(Box::new(move |info| {
|
||||||
#[allow(clippy::print_stderr)]
|
#[allow(clippy::print_stderr)]
|
||||||
|
@ -166,10 +165,7 @@ pub fn run(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format(args: FormatCommand, log_level: LogLevel) -> Result<ExitStatus> {
|
fn format(args: FormatCommand, log_level: LogLevel) -> Result<ExitStatus> {
|
||||||
warn_user_once!(
|
warn_user_once!("`ruff format` is not yet stable, and subject to change in future versions.");
|
||||||
"`ruff format` is a work-in-progress, subject to change at any time, and intended only for \
|
|
||||||
experimentation."
|
|
||||||
);
|
|
||||||
|
|
||||||
let (cli, overrides) = args.partition();
|
let (cli, overrides) = args.partition();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ if condition:
|
||||||
print('Hy "Micha"') # Should not change quotes
|
print('Hy "Micha"') # Should not change quotes
|
||||||
|
|
||||||
----- stderr -----
|
----- 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.
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ if condition:
|
||||||
print('Should change quotes')
|
print('Should change quotes')
|
||||||
|
|
||||||
----- stderr -----
|
----- 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ if condition:
|
||||||
print('Should change quotes')
|
print('Should change quotes')
|
||||||
|
|
||||||
----- stderr -----
|
----- 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ fn stdin_format_jupyter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
----- stderr -----
|
----- 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.
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue