From bd84520393eba6ccbdc896b9824eb20ebeb8585e Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 19 Sep 2023 12:01:25 +0200 Subject: [PATCH] Rename `format` option to `output-format` --- crates/ruff/src/settings/mod.rs | 2 +- crates/ruff_cli/src/args.rs | 24 ++- crates/ruff_cli/src/lib.rs | 24 ++- .../tests/.integration_test.rs.pending-snap | 172 ++++++++++++++++++ crates/ruff_cli/tests/integration_test.rs | 5 +- crates/ruff_wasm/src/lib.rs | 2 +- crates/ruff_workspace/src/configuration.rs | 8 +- crates/ruff_workspace/src/options.rs | 28 ++- crates/ruff_workspace/src/resolver.rs | 7 +- docs/configuration.md | 4 +- ruff.schema.json | 25 --- 11 files changed, 244 insertions(+), 57 deletions(-) create mode 100644 crates/ruff_cli/tests/.integration_test.rs.pending-snap diff --git a/crates/ruff/src/settings/mod.rs b/crates/ruff/src/settings/mod.rs index ea5d38aa98830f..1b3a7d3574cda6 100644 --- a/crates/ruff/src/settings/mod.rs +++ b/crates/ruff/src/settings/mod.rs @@ -44,7 +44,7 @@ pub struct CliSettings { pub cache_dir: PathBuf, pub fix: bool, pub fix_only: bool, - pub format: SerializationFormat, + pub output_format: SerializationFormat, pub show_fixes: bool, pub show_source: bool, } diff --git a/crates/ruff_cli/src/args.rs b/crates/ruff_cli/src/args.rs index 6ff4362eef5a27..0ac99002be561f 100644 --- a/crates/ruff_cli/src/args.rs +++ b/crates/ruff_cli/src/args.rs @@ -105,9 +105,21 @@ pub struct CheckCommand { /// Ignore any `# noqa` comments. #[arg(long)] ignore_noqa: bool, - /// Output serialization format for violations. - #[arg(long, value_enum, env = "RUFF_FORMAT")] + + /// Output serialization format for violations. (Deprecated: Use `--output-format` instead). + #[arg( + long, + value_enum, + env = "RUFF_FORMAT", + conflicts_with = "output_format", + hide = true + )] pub format: Option, + + /// Output serialization format for violations. + #[arg(long, value_enum, env = "RUFF_OUTPUT_FORMAT")] + pub output_format: Option, + /// Specify file to write the linter output to (default: stdout). #[arg(short, long)] pub output_file: Option, @@ -476,7 +488,7 @@ impl CheckCommand { fix: resolve_bool_arg(self.fix, self.no_fix), fix_only: resolve_bool_arg(self.fix_only, self.no_fix_only), force_exclude: resolve_bool_arg(self.force_exclude, self.no_force_exclude), - format: self.format, + output_format: self.output_format.or(self.format), show_fixes: resolve_bool_arg(self.show_fixes, self.no_show_fixes), }, ) @@ -578,7 +590,7 @@ pub struct Overrides { pub fix: Option, pub fix_only: Option, pub force_exclude: Option, - pub format: Option, + pub output_format: Option, pub show_fixes: Option, } @@ -622,8 +634,8 @@ impl ConfigProcessor for Overrides { .collect(), extend_fixable: self.extend_fixable.clone().unwrap_or_default(), }); - if let Some(format) = &self.format { - config.format = Some(*format); + if let Some(output_format) = &self.output_format { + config.output_format = Some(*output_format); } if let Some(force_exclude) = &self.force_exclude { config.force_exclude = Some(*force_exclude); diff --git a/crates/ruff_cli/src/lib.rs b/crates/ruff_cli/src/lib.rs index 8e1b9d6cbe8b18..c7ae2b4a2fd73a 100644 --- a/crates/ruff_cli/src/lib.rs +++ b/crates/ruff_cli/src/lib.rs @@ -12,7 +12,7 @@ use notify::{recommended_watcher, RecursiveMode, Watcher}; use ruff::logging::{set_up_logging, LogLevel}; use ruff::settings::types::SerializationFormat; use ruff::settings::{flags, CliSettings}; -use ruff::{fs, warn_user_once}; +use ruff::{fs, warn_user, warn_user_once}; use crate::args::{Args, CheckCommand, Command, FormatCommand}; use crate::printer::{Flags as PrinterFlags, Printer}; @@ -180,6 +180,14 @@ fn format(args: FormatCommand, log_level: LogLevel) -> Result { } pub fn check(args: CheckCommand, log_level: LogLevel) -> Result { + if args.format.is_some() { + if std::env::var("RUFF_FORMAT").is_ok() { + warn_user!("The environment variable `RUFF_FORMAT` is deprecated. Use `RUFF_OUTPUT_FORMAT` instead."); + } else { + warn_user!("The argument `--format=` is deprecated. Use `--output-format=` instead."); + } + } + let (cli, overrides) = args.partition(); // Construct the "default" settings. These are used when no `pyproject.toml` @@ -219,7 +227,7 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result { let CliSettings { fix, fix_only, - format, + output_format, show_fixes, show_source, .. @@ -251,7 +259,7 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result { printer_flags |= PrinterFlags::SHOW_SOURCE; } if cli.ecosystem_ci { - warn_user_once!( + warn_user!( "The formatting of fixes emitted by this option is a work-in-progress, subject to \ change at any time, and intended only for internal use." ); @@ -262,12 +270,12 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result { if cache { // `--no-cache` doesn't respect code changes, and so is often confusing during // development. - warn_user_once!("Detected debug build without --no-cache."); + warn_user!("Detected debug build without --no-cache."); } if cli.add_noqa { if !autofix.is_generate() { - warn_user_once!("--fix is incompatible with --add-noqa."); + warn_user!("--fix is incompatible with --add-noqa."); } let modifications = commands::add_noqa::add_noqa(&cli.files, &pyproject_config, &overrides)?; @@ -281,11 +289,11 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result { return Ok(ExitStatus::Success); } - let printer = Printer::new(format, log_level, autofix, printer_flags); + let printer = Printer::new(output_format, log_level, autofix, printer_flags); if cli.watch { - if format != SerializationFormat::Text { - warn_user_once!("--format 'text' is used in watch mode."); + if output_format != SerializationFormat::Text { + warn_user!("--format 'text' is used in watch mode."); } // Configure the file watcher. diff --git a/crates/ruff_cli/tests/.integration_test.rs.pending-snap b/crates/ruff_cli/tests/.integration_test.rs.pending-snap new file mode 100644 index 00000000000000..1dd5a031b23dd9 --- /dev/null +++ b/crates/ruff_cli/tests/.integration_test.rs.pending-snap @@ -0,0 +1,172 @@ +{"run_id":"1695117408-19346168","line":293,"new":{"module_name":"integration_test","snapshot_name":"nursery_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":293,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated."}} +{"run_id":"1695117408-19346168","line":254,"new":{"module_name":"integration_test","snapshot_name":"nursery_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":254,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":428,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_prefix_empty","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":428,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","CPY"],"stdin":"I=42\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117408-19346168","line":411,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":411,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","FURB145"],"stdin":"a = l[:]\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117408-19346168","line":179,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_no_issues_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":179,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":393,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":393,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":332,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector_preview_enabled","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":332,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated."}} +{"run_id":"1695117408-19346168","line":142,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":142,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":197,"new":{"module_name":"integration_test","snapshot_name":"show_source","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":197,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--show-source"],"stdin":"l = 1"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":352,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":352,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":272,"new":{"module_name":"integration_test","snapshot_name":"nursery_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":272,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117408-19346168","line":312,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":312,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead."}} +{"run_id":"1695117408-19346168","line":82,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_py","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":82,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":64,"new":{"module_name":"integration_test","snapshot_name":"stdin_filename","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":64,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","F401.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":237,"new":{"module_name":"integration_test","snapshot_name":"show_statistics","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":237,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","F401","--statistics"],"stdin":"import sys\nimport os\n\nprint(os.getuid())\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":370,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":370,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117408-19346168","line":160,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_not_fixable_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":160,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nif (1, 2):\n print(sys.version)\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":48,"new":{"module_name":"integration_test","snapshot_name":"stdin_error","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":48,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":560,"new":{"module_name":"integration_test","snapshot_name":"check_input_from_argfile","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":560,"info":{"program":"ruff","args":["check","--no-cache","@/tmp/.tmpU7L8hY/file_paths.txt"],"stdin":""}},"snapshot":"success: false\nexit_code: 2\n----- stdout -----\n\n----- stderr -----\nruff failed\n Cause: TOML parse error at line 63, column 1\n |\n63 | format-output = \"grouped\"\n | ^^^^^^^^^^^^^\nunknown field `format-output`, expected one of `allowed-confusables`, `builtins`, `cache-dir`, `dummy-variable-rgx`, `exclude`, `extend`, `extend-exclude`, `extend-include`, `extend-ignore`, `extend-select`, `extend-fixable`, `extend-unfixable`, `external`, `fix`, `fix-only`, `fixable`, `format`, `output-format`, `force-exclude`, `ignore`, `ignore-init-module-imports`, `include`, `line-length`, `tab-size`, `logger-objects`, `required-version`, `respect-gitignore`, `select`, `show-source`, `show-fixes`, `src`, `namespace-packages`, `target-version`, `preview`, `task-tags`, `typing-modules`, `unfixable`, `flake8-annotations`, `flake8-bandit`, `flake8-bugbear`, `flake8-builtins`, `flake8-comprehensions`, `flake8-copyright`, `flake8-errmsg`, `flake8-quotes`, `flake8-self`, `flake8-tidy-imports`, `flake8-type-checking`, `flake8-gettext`, `flake8-implicit-str-concat`, `flake8-import-conventions`, `flake8-pytest-style`, `flake8-unused-arguments`, `isort`, `mccabe`, `pep8-naming`, `pycodestyle`, `pydocstyle`, `pyflakes`, `pylint`, `pyupgrade`, `per-file-ignores`, `extend-per-file-ignores`\n\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n/path/to/a.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":35,"new":{"module_name":"integration_test","snapshot_name":"stdin_success","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":35,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":""}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":101,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_pyi","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":101,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.pyi","--select","TCH"],"stdin":"import os\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117408-19346168","line":518,"new":null,"old":null} +{"run_id":"1695117438-443103442","line":222,"new":null,"old":null} +{"run_id":"1695117438-443103442","line":464,"new":null,"old":null} +{"run_id":"1695117438-443103442","line":445,"new":null,"old":null} +{"run_id":"1695117438-443103442","line":352,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":352,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":332,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector_preview_enabled","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":332,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated."}} +{"run_id":"1695117438-443103442","line":411,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":411,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","FURB145"],"stdin":"a = l[:]\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117438-443103442","line":312,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":312,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead."}} +{"run_id":"1695117438-443103442","line":370,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":370,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117438-443103442","line":197,"new":{"module_name":"integration_test","snapshot_name":"show_source","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":197,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--show-source"],"stdin":"l = 1"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":272,"new":{"module_name":"integration_test","snapshot_name":"nursery_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":272,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117438-443103442","line":293,"new":{"module_name":"integration_test","snapshot_name":"nursery_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":293,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated."}} +{"run_id":"1695117438-443103442","line":393,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":393,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":254,"new":{"module_name":"integration_test","snapshot_name":"nursery_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":254,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":428,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_prefix_empty","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":428,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","CPY"],"stdin":"I=42\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117438-443103442","line":64,"new":{"module_name":"integration_test","snapshot_name":"stdin_filename","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":64,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","F401.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":179,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_no_issues_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":179,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":82,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_py","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":82,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":237,"new":{"module_name":"integration_test","snapshot_name":"show_statistics","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":237,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","F401","--statistics"],"stdin":"import sys\nimport os\n\nprint(os.getuid())\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":160,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_not_fixable_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":160,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nif (1, 2):\n print(sys.version)\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":142,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":142,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":48,"new":{"module_name":"integration_test","snapshot_name":"stdin_error","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":48,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":35,"new":{"module_name":"integration_test","snapshot_name":"stdin_success","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":35,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":""}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":101,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_pyi","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":101,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.pyi","--select","TCH"],"stdin":"import os\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117438-443103442","line":518,"new":null,"old":null} +{"run_id":"1695117438-443103442","line":560,"new":{"module_name":"integration_test","snapshot_name":"check_input_from_argfile","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":560,"info":{"program":"ruff","args":["check","--no-cache","@/tmp/.tmpZSvFK3/file_paths.txt"],"stdin":""}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n/path/to/a.py:\n 1:8 F401 [*] `os` imported but unused\n\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n/path/to/a.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":222,"new":null,"old":null} +{"run_id":"1695117487-958753303","line":445,"new":null,"old":null} +{"run_id":"1695117487-958753303","line":464,"new":null,"old":null} +{"run_id":"1695117487-958753303","line":352,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":352,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":179,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_no_issues_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":179,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":332,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector_preview_enabled","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":332,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated."}} +{"run_id":"1695117487-958753303","line":272,"new":{"module_name":"integration_test","snapshot_name":"nursery_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":272,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\nFound 2 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117487-958753303","line":254,"new":{"module_name":"integration_test","snapshot_name":"nursery_prefix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":254,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":293,"new":{"module_name":"integration_test","snapshot_name":"nursery_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":293,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: Selection of nursery rule `E225` without the `--preview` flag is deprecated."}} +{"run_id":"1695117487-958753303","line":393,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":393,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","E225","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:2: E225 Missing whitespace around operator\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":428,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_prefix_empty","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":428,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","CPY"],"stdin":"I=42\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `CPY` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117487-958753303","line":411,"new":{"module_name":"integration_test","snapshot_name":"preview_disabled_direct","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":411,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","FURB145"],"stdin":"a = l[:]\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: Selection `FURB145` has no effect because the `--preview` flag was not included."}} +{"run_id":"1695117487-958753303","line":312,"new":{"module_name":"integration_test","snapshot_name":"nursery_group_selector","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":312,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","NURSERY"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 2 errors.\n\n----- stderr -----\nwarning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead."}} +{"run_id":"1695117487-958753303","line":64,"new":{"module_name":"integration_test","snapshot_name":"stdin_filename","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":64,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","F401.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nF401.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":197,"new":{"module_name":"integration_test","snapshot_name":"show_source","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":197,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--show-source"],"stdin":"l = 1"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `l`\n |\n1 | l = 1\n | ^ E741\n |\n\nFound 1 error.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":237,"new":{"module_name":"integration_test","snapshot_name":"show_statistics","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":237,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","F401","--statistics"],"stdin":"import sys\nimport os\n\nprint(os.getuid())\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n1\tF401\t[*] `sys` imported but unused\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":82,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_py","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":82,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.py"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nTCH.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":370,"new":{"module_name":"integration_test","snapshot_name":"preview_enabled_all","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":370,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--select","ALL","--preview"],"stdin":"I=42\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:1: E741 Ambiguous variable name: `I`\n-:1:1: D100 Missing docstring in public module\n-:1:1: CPY001 Missing copyright notice at top of file\n-:1:2: E225 Missing whitespace around operator\nFound 4 errors.\n\n----- stderr -----\nwarning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.\nwarning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`."}} +{"run_id":"1695117487-958753303","line":142,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":142,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nprint(sys.version)\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\nimport sys\n\nprint(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":560,"new":null,"old":null} +{"run_id":"1695117487-958753303","line":48,"new":{"module_name":"integration_test","snapshot_name":"stdin_error","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":48,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":"import os\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n-:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":35,"new":{"module_name":"integration_test","snapshot_name":"stdin_success","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":35,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text"],"stdin":""}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":160,"new":{"module_name":"integration_test","snapshot_name":"stdin_autofix_when_not_fixable_should_still_print_contents","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":160,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--fix"],"stdin":"import os\nimport sys\n\nif (1, 2):\n print(sys.version)\n"}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\nimport sys\n\nif (1, 2):\n print(sys.version)\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":101,"new":{"module_name":"integration_test","snapshot_name":"stdin_source_type_pyi","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":101,"info":{"program":"ruff","args":["--isolated","--no-cache","-","--format","text","--stdin-filename","TCH.pyi","--select","TCH"],"stdin":"import os\n"}},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----\nwarning: The argument `--format=` is deprecated. Use `--output-format=` instead.\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: true\nexit_code: 0\n----- stdout -----\n\n----- stderr -----"}} +{"run_id":"1695117487-958753303","line":518,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":222,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":445,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":464,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":428,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":411,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":393,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":293,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":179,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":352,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":197,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":254,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":312,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":332,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":370,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":272,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":237,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":48,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":64,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":82,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":142,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":160,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":560,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":35,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":101,"new":null,"old":null} +{"run_id":"1695117508-419493337","line":518,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":222,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":464,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":445,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":393,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":254,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":428,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":370,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":411,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":312,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":197,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":332,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":293,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":352,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":272,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":64,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":142,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":237,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":160,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":179,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":82,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":48,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":560,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":35,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":101,"new":null,"old":null} +{"run_id":"1695117528-784760922","line":518,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":222,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":445,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":293,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":464,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":312,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":428,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":352,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":197,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":393,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":411,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":332,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":48,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":272,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":142,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":370,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":179,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":64,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":237,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":254,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":560,"new":{"module_name":"integration_test","snapshot_name":"check_input_from_argfile","metadata":{"source":"crates/ruff_cli/tests/integration_test.rs","assertion_line":560,"info":{"program":"ruff","args":["check","--no-cache","@/tmp/.tmp9UKj5x/file_paths.txt"],"stdin":""}},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n/path/to/a.py:\n 1:8 F401 [*] `os` imported but unused\n\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----\n"},"old":{"module_name":"integration_test","metadata":{},"snapshot":"success: false\nexit_code: 1\n----- stdout -----\n/path/to/a.py:1:8: F401 [*] `os` imported but unused\nFound 1 error.\n[*] 1 potentially fixable with the --fix option.\n\n----- stderr -----"}} +{"run_id":"1695117600-69668612","line":101,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":35,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":82,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":160,"new":null,"old":null} +{"run_id":"1695117600-69668612","line":518,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":222,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":445,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":428,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":464,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":312,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":332,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":293,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":272,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":411,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":393,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":254,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":352,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":370,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":237,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":82,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":142,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":197,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":64,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":160,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":48,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":561,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":179,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":35,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":101,"new":null,"old":null} +{"run_id":"1695117638-583717779","line":518,"new":null,"old":null} diff --git a/crates/ruff_cli/tests/integration_test.rs b/crates/ruff_cli/tests/integration_test.rs index 79e0ffeb567e9e..e693c64a0f07a8 100644 --- a/crates/ruff_cli/tests/integration_test.rs +++ b/crates/ruff_cli/tests/integration_test.rs @@ -28,7 +28,7 @@ use ruff_cli::args::Args; use ruff_cli::run; const BIN_NAME: &str = "ruff"; -const STDIN_BASE_OPTIONS: &[&str] = &["--isolated", "--no-cache", "-", "--format", "text"]; +const STDIN_BASE_OPTIONS: &[&str] = &["--isolated", "--no-cache", "-", "--output-format", "text"]; #[test] fn stdin_success() { @@ -117,7 +117,7 @@ fn stdin_json() { "-", "--isolated", "--no-cache", - "--format", + "--output-format", "json", "--stdin-filename", "F401.py", @@ -551,6 +551,7 @@ fn check_input_from_argfile() -> Result<()> { let args = vec![ "check".to_string(), "--no-cache".to_string(), + "--isolated".to_string(), format!("@{}", &input_file_path.display()), ]; diff --git a/crates/ruff_wasm/src/lib.rs b/crates/ruff_wasm/src/lib.rs index 2ab51cf77a75c4..78dc98a03f465f 100644 --- a/crates/ruff_wasm/src/lib.rs +++ b/crates/ruff_wasm/src/lib.rs @@ -145,7 +145,7 @@ impl Workspace { fix_only: None, fixable: None, force_exclude: None, - format: None, + output_format: None, ignore_init_module_imports: None, include: None, logger_objects: None, diff --git a/crates/ruff_workspace/src/configuration.rs b/crates/ruff_workspace/src/configuration.rs index e07b92ad23293d..eb5a77d450a24e 100644 --- a/crates/ruff_workspace/src/configuration.rs +++ b/crates/ruff_workspace/src/configuration.rs @@ -62,7 +62,7 @@ pub struct Configuration { pub fix: Option, pub fix_only: Option, pub force_exclude: Option, - pub format: Option, + pub output_format: Option, pub ignore_init_module_imports: Option, pub include: Option>, pub line_length: Option, @@ -115,7 +115,7 @@ impl Configuration { .unwrap_or_else(|| cache_dir(project_root)), fix: self.fix.unwrap_or(false), fix_only: self.fix_only.unwrap_or(false), - format: self.format.unwrap_or_default(), + output_format: self.output_format.unwrap_or_default(), show_fixes: self.show_fixes.unwrap_or(false), show_source: self.show_source.unwrap_or(false), }, @@ -372,7 +372,7 @@ impl Configuration { external: options.external, fix: options.fix, fix_only: options.fix_only, - format: options.format, + output_format: options.output_format.or(options.format), force_exclude: options.force_exclude, ignore_init_module_imports: options.ignore_init_module_imports, include: options.include.map(|paths| { @@ -704,7 +704,7 @@ impl Configuration { external: self.external.or(config.external), fix: self.fix.or(config.fix), fix_only: self.fix_only.or(config.fix_only), - format: self.format.or(config.format), + output_format: self.output_format.or(config.output_format), force_exclude: self.force_exclude.or(config.force_exclude), include: self.include.or(config.include), ignore_init_module_imports: self diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 2cc069d081d863..a6d0eba6a3e7cb 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -234,20 +234,34 @@ pub struct Options { /// A list of rule codes or prefixes to consider autofixable. By default, /// all rules are considered autofixable. pub fixable: Option>, + + /// The style in which violation messages should be formatted: `"text"` + /// (default), `"grouped"` (group messages by file), `"json"` + /// (machine-readable), `"junit"` (machine-readable XML), `"github"` (GitHub + /// Actions annotations), `"gitlab"` (GitLab CI code quality report), + /// `"pylint"` (Pylint text format) or `"azure"` (Azure Pipeline logging commands). + /// + /// This option has been **deprecated** in favor of `output-format` + /// to avoid ambiguity with Ruff's upcoming formatter. + #[cfg_attr(feature = "schemars", schemars(skip))] + pub format: Option, + + /// The style in which violation messages should be formatted: `"text"` + /// (default), `"grouped"` (group messages by file), `"json"` + /// (machine-readable), `"junit"` (machine-readable XML), `"github"` (GitHub + /// Actions annotations), `"gitlab"` (GitLab CI code quality report), + /// `"pylint"` (Pylint text format) or `"azure"` (Azure Pipeline logging commands). + #[cfg_attr(feature = "schemars", schemars(skip))] #[option( default = r#""text""#, value_type = r#""text" | "json" | "junit" | "github" | "gitlab" | "pylint" | "azure""#, example = r#" # Group violations by containing file. - format = "grouped" + format-output = "grouped" "# )] - /// The style in which violation messages should be formatted: `"text"` - /// (default), `"grouped"` (group messages by file), `"json"` - /// (machine-readable), `"junit"` (machine-readable XML), `"github"` (GitHub - /// Actions annotations), `"gitlab"` (GitLab CI code quality report), - /// `"pylint"` (Pylint text format) or `"azure"` (Azure Pipeline logging commands). - pub format: Option, + pub output_format: Option, + #[option( default = r#"false"#, value_type = "bool", diff --git a/crates/ruff_workspace/src/resolver.rs b/crates/ruff_workspace/src/resolver.rs index ae8fcb22443b3b..0bc2d3c02dcaaf 100644 --- a/crates/ruff_workspace/src/resolver.rs +++ b/crates/ruff_workspace/src/resolver.rs @@ -16,9 +16,9 @@ use rustc_hash::{FxHashMap, FxHashSet}; use crate::configuration::Configuration; use crate::pyproject; use crate::pyproject::settings_toml; -use ruff::fs; use ruff::packaging::is_package; use ruff::settings::{AllSettings, Settings}; +use ruff::{fs, warn_user_once}; /// The configuration information from a `pyproject.toml` file. pub struct PyprojectConfig { @@ -220,6 +220,11 @@ fn resolve_configuration( // Resolve the current path. let options = pyproject::load_options(&path) .map_err(|err| anyhow!("Failed to parse `{}`: {}", path.display(), err))?; + + if options.format.is_some() { + warn_user_once!("The option `format` has been deprecated to avoid ambiguity with Ruff's upcoming formatter. Use `format-output` instead."); + } + let project_root = relativity.resolve(&path); let configuration = Configuration::from_options(options, &project_root)?; diff --git a/docs/configuration.md b/docs/configuration.md index fa546ce3b6046b..caa228d2891fa5 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -206,8 +206,8 @@ Options: Fix any fixable lint violations, but don't report on leftover violations. Implies `--fix` --ignore-noqa Ignore any `# noqa` comments - --format - Output serialization format for violations [env: RUFF_FORMAT=] [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure] + --output-format + Output serialization format for violations [env: RUFF_OUTPUT_FORMAT=] [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure] -o, --output-file Specify file to write the linter output to (default: stdout) --target-version diff --git a/ruff.schema.json b/ruff.schema.json index 3d32bf5eeec6a0..6ef39e94517bfd 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -326,17 +326,6 @@ "null" ] }, - "format": { - "description": "The style in which violation messages should be formatted: `\"text\"` (default), `\"grouped\"` (group messages by file), `\"json\"` (machine-readable), `\"junit\"` (machine-readable XML), `\"github\"` (GitHub Actions annotations), `\"gitlab\"` (GitLab CI code quality report), `\"pylint\"` (Pylint text format) or `\"azure\"` (Azure Pipeline logging commands).", - "anyOf": [ - { - "$ref": "#/definitions/SerializationFormat" - }, - { - "type": "null" - } - ] - }, "ignore": { "description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.", "type": [ @@ -2805,20 +2794,6 @@ "YTT303" ] }, - "SerializationFormat": { - "type": "string", - "enum": [ - "text", - "json", - "json-lines", - "junit", - "grouped", - "github", - "gitlab", - "pylint", - "azure" - ] - }, "Strictness": { "oneOf": [ {