mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Make --quiet more aggressive (#566)
This commit is contained in:
parent
9f9cbb5520
commit
a3f7de2257
4 changed files with 135 additions and 65 deletions
14
src/cli.rs
14
src/cli.rs
|
@ -7,6 +7,7 @@ use log::warn;
|
|||
use regex::Regex;
|
||||
|
||||
use crate::checks_gen::CheckCodePrefix;
|
||||
use crate::logging::LogLevel;
|
||||
use crate::printer::SerializationFormat;
|
||||
use crate::settings::configuration::Configuration;
|
||||
use crate::settings::types::{PatternPrefixPair, PythonVersion};
|
||||
|
@ -93,6 +94,19 @@ pub struct Cli {
|
|||
pub stdin_filename: Option<String>,
|
||||
}
|
||||
|
||||
/// Map the CLI settings to a `LogLevel`.
|
||||
pub fn extract_log_level(cli: &Cli) -> LogLevel {
|
||||
if cli.silent {
|
||||
LogLevel::Silent
|
||||
} else if cli.quiet {
|
||||
LogLevel::Quiet
|
||||
} else if cli.verbose {
|
||||
LogLevel::Verbose
|
||||
} else {
|
||||
LogLevel::Default
|
||||
}
|
||||
}
|
||||
|
||||
pub enum Warnable {
|
||||
Select,
|
||||
ExtendSelect,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue