Add RUFF_FORMAT environment variable support (#1731)

Resolves #1716
This commit is contained in:
messense 2023-01-08 10:54:19 +08:00 committed by GitHub
parent 4149627f19
commit f9a5867d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -29,7 +29,7 @@ bitflags = { version = "1.3.2" }
cachedir = { version = "0.3.0" } cachedir = { version = "0.3.0" }
cfg-if = { version = "1.0.0" } cfg-if = { version = "1.0.0" }
chrono = { version = "0.4.21", default-features = false, features = ["clock"] } chrono = { version = "0.4.21", default-features = false, features = ["clock"] }
clap = { version = "4.0.1", features = ["derive"] } clap = { version = "4.0.1", features = ["derive", "env"] }
clap_complete_command = { version = "0.4.0" } clap_complete_command = { version = "0.4.0" }
colored = { version = "2.0.0" } colored = { version = "2.0.0" }
dirs = { version = "4.0.0" } dirs = { version = "4.0.0" }

View file

@ -362,7 +362,7 @@ Options:
--per-file-ignores <PER_FILE_IGNORES> --per-file-ignores <PER_FILE_IGNORES>
List of mappings from file pattern to code to exclude List of mappings from file pattern to code to exclude
--format <FORMAT> --format <FORMAT>
Output serialization format for error messages [possible values: text, json, junit, grouped, github, gitlab] Output serialization format for error messages [env: RUFF_FORMAT=] [possible values: text, json, junit, grouped, github, gitlab]
--stdin-filename <STDIN_FILENAME> --stdin-filename <STDIN_FILENAME>
The name of the file when passing it through stdin The name of the file when passing it through stdin
--cache-dir <CACHE_DIR> --cache-dir <CACHE_DIR>

View file

@ -93,7 +93,7 @@ pub struct Cli {
#[arg(long, value_delimiter = ',')] #[arg(long, value_delimiter = ',')]
pub per_file_ignores: Option<Vec<PatternPrefixPair>>, pub per_file_ignores: Option<Vec<PatternPrefixPair>>,
/// Output serialization format for error messages. /// Output serialization format for error messages.
#[arg(long, value_enum)] #[arg(long, value_enum, env = "RUFF_FORMAT")]
pub format: Option<SerializationFormat>, pub format: Option<SerializationFormat>,
/// The name of the file when passing it through stdin. /// The name of the file when passing it through stdin.
#[arg(long)] #[arg(long)]