Update insta snapshots (#14366)

This commit is contained in:
Micha Reiser 2024-11-15 19:31:15 +01:00 committed by GitHub
parent 81e5830585
commit c847cad389
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2595 changed files with 3052 additions and 2578 deletions

View file

@ -459,11 +459,11 @@ foo: 3.8- # trailing comment
"; ";
let parsed_versions = TypeshedVersions::from_str(VERSIONS).unwrap(); let parsed_versions = TypeshedVersions::from_str(VERSIONS).unwrap();
assert_eq!(parsed_versions.len(), 3); assert_eq!(parsed_versions.len(), 3);
assert_snapshot!(parsed_versions.to_string(), @r###" assert_snapshot!(parsed_versions.to_string(), @r"
bar: 2.7-3.10 bar: 2.7-3.10
bar.baz: 3.1-3.9 bar.baz: 3.1-3.9
foo: 3.8- foo: 3.8-
"### "
); );
} }

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff/src/version.rs source: crates/ruff/src/version.rs
expression: version expression: version
snapshot_kind: text
--- ---
0.0.0 0.0.0

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff/src/version.rs source: crates/ruff/src/version.rs
expression: version expression: version
snapshot_kind: text
--- ---
0.0.0 (53b0f5d92 2023-10-19) 0.0.0 (53b0f5d92 2023-10-19)

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff/src/version.rs source: crates/ruff/src/version.rs
expression: version expression: version
snapshot_kind: text
--- ---
0.0.0+24 (53b0f5d92 2023-10-19) 0.0.0+24 (53b0f5d92 2023-10-19)

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff/src/version.rs source: crates/ruff/src/version.rs
expression: version expression: version
snapshot_kind: text
--- ---
{ {
"version": "0.0.0", "version": "0.0.0",

View file

@ -8,7 +8,7 @@ const BIN_NAME: &str = "ruff";
#[test] #[test]
fn lint_select() { fn lint_select() {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).arg("config").arg("lint.select"), @r###" Command::new(get_cargo_bin(BIN_NAME)).arg("config").arg("lint.select"), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -29,14 +29,14 @@ fn lint_select() {
``` ```
----- stderr ----- ----- stderr -----
"### "#
); );
} }
#[test] #[test]
fn lint_select_json() { fn lint_select_json() {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).arg("config").arg("lint.select").arg("--output-format").arg("json"), @r###" Command::new(get_cargo_bin(BIN_NAME)).arg("config").arg("lint.select").arg("--output-format").arg("json"), @r##"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -50,6 +50,6 @@ fn lint_select_json() {
} }
----- stderr ----- ----- stderr -----
"### "##
); );
} }

View file

@ -30,7 +30,7 @@ if condition:
print('Hy "Micha"') # Should not change quotes print('Hy "Micha"') # Should not change quotes
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -45,7 +45,7 @@ if condition:
print('Hy "Micha"') # Should not change quotes print('Hy "Micha"') # Should not change quotes
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -65,7 +65,7 @@ bar = "needs formatting"
)?; )?;
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--isolated", "--no-cache", "--check"]).current_dir(tempdir.path()), @r###" .args(["format", "--isolated", "--no-cache", "--check"]).current_dir(tempdir.path()), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -74,7 +74,7 @@ bar = "needs formatting"
2 files would be reformatted 2 files would be reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -84,7 +84,7 @@ fn format_warn_stdin_filename_with_files() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--isolated", "--stdin-filename", "foo.py"]) .args(["format", "--isolated", "--stdin-filename", "foo.py"])
.arg("foo.py") .arg("foo.py")
.pass_stdin("foo = 1"), @r###" .pass_stdin("foo = 1"), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -92,13 +92,13 @@ fn format_warn_stdin_filename_with_files() {
----- stderr ----- ----- stderr -----
warning: Ignoring file foo.py in favor of standard input. warning: Ignoring file foo.py in favor of standard input.
"###); ");
} }
#[test] #[test]
fn nonexistent_config_file() { fn nonexistent_config_file() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--config", "foo.toml", "."]), @r###" .args(["format", "--config", "foo.toml", "."]), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -114,13 +114,13 @@ fn nonexistent_config_file() {
The path `foo.toml` does not point to a configuration file The path `foo.toml` does not point to a configuration file
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
fn config_override_rejected_if_invalid_toml() { fn config_override_rejected_if_invalid_toml() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--config", "foo = bar", "."]), @r###" .args(["format", "--config", "foo = bar", "."]), @r#"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -142,7 +142,7 @@ fn config_override_rejected_if_invalid_toml() {
expected `"`, `'` expected `"`, `'`
For more information, try '--help'. For more information, try '--help'.
"###); "#);
} }
#[test] #[test]
@ -161,19 +161,18 @@ fn too_many_config_files() -> Result<()> {
.arg(&ruff_dot_toml) .arg(&ruff_dot_toml)
.arg("--config") .arg("--config")
.arg(&ruff2_dot_toml) .arg(&ruff2_dot_toml)
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: You cannot specify more than one configuration file on the command line. Cause: You cannot specify more than one configuration file on the command line.
tip: remove either `--config=[TMP]/ruff.toml` or `--config=[TMP]/ruff2.toml`. tip: remove either `--config=[TMP]/ruff.toml` or `--config=[TMP]/ruff2.toml`.
For more information, try `--help`. For more information, try `--help`.
");
"###);
}); });
Ok(()) Ok(())
} }
@ -191,7 +190,7 @@ fn config_file_and_isolated() -> Result<()> {
.arg("--config") .arg("--config")
.arg(&ruff_dot_toml) .arg(&ruff_dot_toml)
.arg("--isolated") .arg("--isolated")
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -203,8 +202,7 @@ fn config_file_and_isolated() -> Result<()> {
tip: You cannot specify a configuration file and also specify `--isolated`, tip: You cannot specify a configuration file and also specify `--isolated`,
as `--isolated` causes ruff to ignore all configuration files. as `--isolated` causes ruff to ignore all configuration files.
For more information, try `--help`. For more information, try `--help`.
");
"###);
}); });
Ok(()) Ok(())
} }
@ -226,7 +224,7 @@ def foo():
// This overrides the long line length set in the config file // This overrides the long line length set in the config file
.args(["--config", "line-length=80"]) .args(["--config", "line-length=80"])
.arg("-") .arg("-")
.pass_stdin(fixture), @r###" .pass_stdin(fixture), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -236,7 +234,7 @@ def foo():
) )
----- stderr ----- ----- stderr -----
"###); "#);
Ok(()) Ok(())
} }
@ -259,7 +257,7 @@ def foo():
// ...but this overrides them both: // ...but this overrides them both:
.args(["--line-length", "100"]) .args(["--line-length", "100"])
.arg("-") .arg("-")
.pass_stdin(fixture), @r###" .pass_stdin(fixture), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -267,7 +265,7 @@ def foo():
print("looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong string") print("looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong string")
----- stderr ----- ----- stderr -----
"###); "#);
Ok(()) Ok(())
} }
@ -302,7 +300,7 @@ if condition:
print("Should change quotes") print("Should change quotes")
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -316,7 +314,7 @@ if condition:
print('Should change quotes') print('Should change quotes')
----- stderr ----- ----- stderr -----
"###); "#);
Ok(()) Ok(())
} }
@ -357,7 +355,7 @@ def f(x):
>>> foo, bar, quux = this_is_a_long_line(lion, hippo, lemur, bear) >>> foo, bar, quux = this_is_a_long_line(lion, hippo, lemur, bear)
''' '''
pass pass
"), @r###" "), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -403,7 +401,7 @@ def f(x):
pass pass
----- stderr ----- ----- stderr -----
"###); "#);
Ok(()) Ok(())
} }
@ -424,14 +422,14 @@ fn mixed_line_endings() -> Result<()> {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(["format", "--no-cache", "--diff", "--isolated"]) .args(["format", "--no-cache", "--diff", "--isolated"])
.arg("."), @r###" .arg("."), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
2 files already formatted 2 files already formatted
"###); ");
Ok(()) Ok(())
} }
@ -490,7 +488,7 @@ OTHER = "OTHER"
// Explicitly pass test.py, should be formatted regardless of it being excluded by format.exclude // Explicitly pass test.py, should be formatted regardless of it being excluded by format.exclude
.arg(test_path.file_name().unwrap()) .arg(test_path.file_name().unwrap())
// Format all other files in the directory, should respect the `exclude` and `format.exclude` options // Format all other files in the directory, should respect the `exclude` and `format.exclude` options
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -499,7 +497,7 @@ OTHER = "OTHER"
2 files would be reformatted 2 files would be reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -517,14 +515,14 @@ from module import =
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(["format", "--no-cache", "--isolated", "--check"]) .args(["format", "--no-cache", "--isolated", "--check"])
.arg("main.py"), @r###" .arg("main.py"), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
error: Failed to parse main.py:2:20: Expected an import name error: Failed to parse main.py:2:20: Expected an import name
"###); ");
Ok(()) Ok(())
} }
@ -546,7 +544,7 @@ if __name__ == "__main__":
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(["format", "--no-cache", "--isolated", "--check"]) .args(["format", "--no-cache", "--isolated", "--check"])
.arg("main.py"), @r###" .arg("main.py"), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -554,31 +552,31 @@ if __name__ == "__main__":
1 file would be reformatted 1 file would be reformatted
----- stderr ----- ----- stderr -----
"###); ");
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(["format", "--no-cache", "--isolated"]) .args(["format", "--no-cache", "--isolated"])
.arg("main.py"), @r###" .arg("main.py"), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
1 file reformatted 1 file reformatted
----- stderr ----- ----- stderr -----
"###); ");
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(["format", "--no-cache", "--isolated"]) .args(["format", "--no-cache", "--isolated"])
.arg("main.py"), @r###" .arg("main.py"), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
1 file left unchanged 1 file left unchanged
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -638,7 +636,7 @@ OTHER = "OTHER"
// Explicitly pass test.py, should be respect the `format.exclude` when `--force-exclude` is present // Explicitly pass test.py, should be respect the `format.exclude` when `--force-exclude` is present
.arg(test_path.file_name().unwrap()) .arg(test_path.file_name().unwrap())
// Format all other files in the directory, should respect the `exclude` and `format.exclude` options // Format all other files in the directory, should respect the `exclude` and `format.exclude` options
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -646,7 +644,7 @@ OTHER = "OTHER"
1 file would be reformatted 1 file would be reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -673,7 +671,7 @@ from test import say_hy
if __name__ == '__main__': if __name__ == '__main__':
say_hy("dear Ruff contributor") say_hy("dear Ruff contributor")
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -686,7 +684,7 @@ if __name__ == '__main__':
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
- 'ignore' -> 'lint.ignore' - 'ignore' -> 'lint.ignore'
"###); "#);
Ok(()) Ok(())
} }
@ -713,7 +711,7 @@ from test import say_hy
if __name__ == '__main__': if __name__ == '__main__':
say_hy("dear Ruff contributor") say_hy("dear Ruff contributor")
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -727,7 +725,7 @@ if __name__ == '__main__':
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
- 'ignore' -> 'lint.ignore' - 'ignore' -> 'lint.ignore'
"###); "#);
Ok(()) Ok(())
} }
@ -770,7 +768,7 @@ if condition:
print("Should change quotes") print("Should change quotes")
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -786,7 +784,7 @@ if condition:
----- stderr ----- ----- stderr -----
warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration. warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration.
"###); "#);
Ok(()) Ok(())
} }
@ -811,7 +809,7 @@ tab-size = 2
.pass_stdin(r" .pass_stdin(r"
if True: if True:
pass pass
"), @r###" "), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -824,8 +822,7 @@ if True:
1 | 1 |
| ^ | ^
unknown field `tab-size` unknown field `tab-size`
");
"###);
}); });
Ok(()) Ok(())
} }
@ -851,7 +848,7 @@ format = "json"
.arg("-") .arg("-")
.pass_stdin(r" .pass_stdin(r"
import os import os
"), @r###" "), @r#"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -864,8 +861,7 @@ format = "json"
2 | format = "json" 2 | format = "json"
| ^^^^^^ | ^^^^^^
invalid type: string "json", expected struct FormatOptions invalid type: string "json", expected struct FormatOptions
"#);
"###);
}); });
Ok(()) Ok(())
} }
@ -912,7 +908,7 @@ def say_hy(name: str):
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--no-cache", "--config"]) .args(["format", "--no-cache", "--config"])
.arg(&ruff_toml) .arg(&ruff_toml)
.arg(test_path), @r###" .arg(test_path), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -929,7 +925,7 @@ def say_hy(name: str):
warning: The isort option `isort.lines-between-types` with a value greater than 1 is incompatible with the formatter. To avoid unexpected behavior, we recommend setting the option to one of: `1` or `0` (default). warning: The isort option `isort.lines-between-types` with a value greater than 1 is incompatible with the formatter. To avoid unexpected behavior, we recommend setting the option to one of: `1` or `0` (default).
warning: The isort option `isort.force-wrap-aliases` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.force-wrap-aliases=false` or `format.skip-magic-trailing-comma=false`. warning: The isort option `isort.force-wrap-aliases` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.force-wrap-aliases=false` or `format.skip-magic-trailing-comma=false`.
warning: The isort option `isort.split-on-trailing-comma` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.split-on-trailing-comma=false` or `format.skip-magic-trailing-comma=false`. warning: The isort option `isort.split-on-trailing-comma` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.split-on-trailing-comma=false` or `format.skip-magic-trailing-comma=false`.
"###); "#);
Ok(()) Ok(())
} }
@ -970,7 +966,7 @@ indent-style = "tab"
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
def say_hy(name: str): def say_hy(name: str):
print(f"Hy {name}")"#), @r###" print(f"Hy {name}")"#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -988,7 +984,7 @@ def say_hy(name: str):
warning: The isort option `isort.lines-between-types` with a value greater than 1 is incompatible with the formatter. To avoid unexpected behavior, we recommend setting the option to one of: `1` or `0` (default). warning: The isort option `isort.lines-between-types` with a value greater than 1 is incompatible with the formatter. To avoid unexpected behavior, we recommend setting the option to one of: `1` or `0` (default).
warning: The isort option `isort.force-wrap-aliases` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.force-wrap-aliases=false` or `format.skip-magic-trailing-comma=false`. warning: The isort option `isort.force-wrap-aliases` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.force-wrap-aliases=false` or `format.skip-magic-trailing-comma=false`.
warning: The isort option `isort.split-on-trailing-comma` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.split-on-trailing-comma=false` or `format.skip-magic-trailing-comma=false`. warning: The isort option `isort.split-on-trailing-comma` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.split-on-trailing-comma=false` or `format.skip-magic-trailing-comma=false`.
"###); "#);
Ok(()) Ok(())
} }
@ -1032,14 +1028,14 @@ def say_hy(name: str):
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--no-cache", "--config"]) .args(["format", "--no-cache", "--config"])
.arg(&ruff_toml) .arg(&ruff_toml)
.arg(test_path), @r###" .arg(test_path), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
1 file reformatted 1 file reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1074,14 +1070,14 @@ def say_hy(name: str):
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--no-cache", "--config"]) .args(["format", "--no-cache", "--config"])
.arg(&ruff_toml) .arg(&ruff_toml)
.arg(test_path), @r###" .arg(test_path), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
1 file reformatted 1 file reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1109,7 +1105,7 @@ def say_hy(name: str):
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--no-cache", "--config"]) .args(["format", "--no-cache", "--config"])
.arg(&ruff_toml) .arg(&ruff_toml)
.arg(test_path), @r###" .arg(test_path), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1119,7 +1115,7 @@ def say_hy(name: str):
warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`. warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`. warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.
warning: The following rules may cause conflicts when used with the formatter: `COM812`, `ISC001`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration. warning: The following rules may cause conflicts when used with the formatter: `COM812`, `ISC001`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
"###); ");
Ok(()) Ok(())
} }
@ -1138,7 +1134,7 @@ fn test_diff() {
]}, { ]}, {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).args(args).args(paths), Command::new(get_cargo_bin(BIN_NAME)).args(args).args(paths),
@r###" @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1186,7 +1182,7 @@ fn test_diff() {
----- stderr ----- ----- stderr -----
2 files would be reformatted, 1 file already formatted 2 files would be reformatted, 1 file already formatted
"###); ");
}); });
} }
@ -1201,7 +1197,7 @@ fn test_diff_no_change() {
]}, { ]}, {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).args(args).args(paths), Command::new(get_cargo_bin(BIN_NAME)).args(args).args(paths),
@r###" @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1216,7 +1212,7 @@ fn test_diff_no_change() {
----- stderr ----- ----- stderr -----
1 file would be reformatted 1 file would be reformatted
"### "
); );
}); });
} }
@ -1235,7 +1231,7 @@ fn test_diff_stdin_unformatted() {
let unformatted = fs::read(fixtures.join("unformatted.py")).unwrap(); let unformatted = fs::read(fixtures.join("unformatted.py")).unwrap();
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).args(args).pass_stdin(unformatted), Command::new(get_cargo_bin(BIN_NAME)).args(args).pass_stdin(unformatted),
@r###" @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1249,7 +1245,7 @@ fn test_diff_stdin_unformatted() {
----- stderr ----- ----- stderr -----
"###); ");
} }
#[test] #[test]
@ -1259,13 +1255,13 @@ fn test_diff_stdin_formatted() {
let unformatted = fs::read(fixtures.join("formatted.py")).unwrap(); let unformatted = fs::read(fixtures.join("formatted.py")).unwrap();
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).args(args).pass_stdin(unformatted), Command::new(get_cargo_bin(BIN_NAME)).args(args).pass_stdin(unformatted),
@r###" @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
"###); ");
} }
#[test] #[test]
@ -1275,7 +1271,7 @@ fn test_notebook_trailing_semicolon() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--isolated", "--stdin-filename", "test.ipynb"]) .args(["format", "--isolated", "--stdin-filename", "test.ipynb"])
.arg("-") .arg("-")
.pass_stdin(unformatted), @r###" .pass_stdin(unformatted), @r##"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1694,7 +1690,7 @@ fn test_notebook_trailing_semicolon() {
} }
----- stderr ----- ----- stderr -----
"###); "##);
} }
#[test] #[test]
@ -1756,14 +1752,14 @@ include = ["*.ipy"]
.arg("--no-cache") .arg("--no-cache")
.args(["--config", &ruff_toml.file_name().unwrap().to_string_lossy()]) .args(["--config", &ruff_toml.file_name().unwrap().to_string_lossy()])
.args(["--extension", "ipy:ipynb"]) .args(["--extension", "ipy:ipynb"])
.arg("."), @r###" .arg("."), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
1 file reformatted 1 file reformatted
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1776,7 +1772,7 @@ fn range_formatting() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Shouldn't format this" ) print("Shouldn't format this" )
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1789,7 +1785,7 @@ def foo(arg1, arg2,):
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -1799,7 +1795,7 @@ fn range_formatting_unicode() {
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
def foo(arg1="👋🏽" ): print("Format this" ) def foo(arg1="👋🏽" ): print("Format this" )
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1808,7 +1804,7 @@ def foo(arg1="👋🏽" ): print("Format this" )
print("Format this") print("Format this")
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -1839,7 +1835,7 @@ def file2(arg1, arg2,):
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["format", "--isolated", "--range=1:8-1:15"]) .args(["format", "--isolated", "--range=1:8-1:15"])
.arg(file1) .arg(file1)
.arg(file2), @r###" .arg(file2), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -1847,7 +1843,7 @@ def file2(arg1, arg2,):
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: The `--range` option is only supported when formatting a single file but the specified paths resolve to 2 files. Cause: The `--range` option is only supported when formatting a single file but the specified paths resolve to 2 files.
"###); ");
Ok(()) Ok(())
} }
@ -1861,7 +1857,7 @@ fn range_formatting_out_of_bounds() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Shouldn't format this" ) print("Shouldn't format this" )
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1871,7 +1867,7 @@ def foo(arg1, arg2,):
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -1883,7 +1879,7 @@ fn range_start_larger_than_end() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Shouldn't format this" ) print("Shouldn't format this" )
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -1893,7 +1889,7 @@ def foo(arg1, arg2,):
tip: Try switching start and end: '50:1-90:1' tip: Try switching start and end: '50:1-90:1'
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -1905,7 +1901,7 @@ fn range_line_numbers_only() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Shouldn't format this" ) print("Shouldn't format this" )
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1918,7 +1914,7 @@ def foo(arg1, arg2,):
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -1930,7 +1926,7 @@ fn range_start_only() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Should format this" ) print("Should format this" )
"#), @r###" "#), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1939,7 +1935,7 @@ def foo(arg1, arg2,):
print("Should format this") print("Should format this")
----- stderr ----- ----- stderr -----
"###); "#);
} }
#[test] #[test]
@ -1975,7 +1971,7 @@ fn range_missing_line() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Should format this" ) print("Should format this" )
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -1985,7 +1981,7 @@ def foo(arg1, arg2,):
tip: The format is 'line:column'. tip: The format is 'line:column'.
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -1997,7 +1993,7 @@ fn zero_line_number() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Should format this" ) print("Should format this" )
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -2008,7 +2004,7 @@ def foo(arg1, arg2,):
tip: Try 1:2 instead. tip: Try 1:2 instead.
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -2020,7 +2016,7 @@ fn column_and_line_zero() {
def foo(arg1, arg2,): def foo(arg1, arg2,):
print("Should format this" ) print("Should format this" )
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -2031,7 +2027,7 @@ def foo(arg1, arg2,):
tip: Try 1:1 instead. tip: Try 1:1 instead.
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -2075,12 +2071,12 @@ fn range_formatting_notebook() {
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 5 "nbformat_minor": 5
} }
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
error: Failed to format main.ipynb: Range formatting isn't supported for notebooks. error: Failed to format main.ipynb: Range formatting isn't supported for notebooks.
"###); ");
} }

File diff suppressed because it is too large Load diff

View file

@ -42,7 +42,7 @@ inline-quotes = "single"
.arg(&ruff_toml) .arg(&ruff_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"a = "abcba".strip("aba")"#), @r###" .pass_stdin(r#"a = "abcba".strip("aba")"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -56,7 +56,7 @@ inline-quotes = "single"
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
- 'flake8-quotes' -> 'lint.flake8-quotes' - 'flake8-quotes' -> 'lint.flake8-quotes'
"###); ");
}); });
Ok(()) Ok(())
@ -85,7 +85,7 @@ inline-quotes = "single"
.arg("--config") .arg("--config")
.arg(&ruff_toml) .arg(&ruff_toml)
.arg("-") .arg("-")
.pass_stdin(r#"a = "abcba".strip("aba")"#), @r###" .pass_stdin(r#"a = "abcba".strip("aba")"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -96,7 +96,7 @@ inline-quotes = "single"
[*] 2 fixable with the `--fix` option. [*] 2 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -125,7 +125,7 @@ inline-quotes = "single"
.arg("--config") .arg("--config")
.arg(&ruff_toml) .arg(&ruff_toml)
.arg("-") .arg("-")
.pass_stdin(r#"a = "abcba".strip("aba")"#), @r###" .pass_stdin(r#"a = "abcba".strip("aba")"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -138,7 +138,7 @@ inline-quotes = "single"
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
"###); ");
}); });
Ok(()) Ok(())
@ -171,7 +171,7 @@ inline-quotes = "single"
.arg("--config") .arg("--config")
.arg(&ruff_toml) .arg(&ruff_toml)
.arg("-") .arg("-")
.pass_stdin(r#"a = "abcba".strip("aba")"#), @r###" .pass_stdin(r#"a = "abcba".strip("aba")"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -184,7 +184,7 @@ inline-quotes = "single"
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`:
- 'flake8-quotes' -> 'lint.flake8-quotes' - 'flake8-quotes' -> 'lint.flake8-quotes'
"###); ");
}); });
Ok(()) Ok(())
@ -252,7 +252,7 @@ OTHER = "OTHER"
// Explicitly pass test.py, should be linted regardless of it being excluded by lint.exclude // Explicitly pass test.py, should be linted regardless of it being excluded by lint.exclude
.arg(test_path.file_name().unwrap()) .arg(test_path.file_name().unwrap())
// Lint all other files in the directory, should respect the `exclude` and `lint.exclude` options // Lint all other files in the directory, should respect the `exclude` and `lint.exclude` options
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -265,7 +265,7 @@ OTHER = "OTHER"
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
"###); ");
}); });
Ok(()) Ok(())
@ -302,7 +302,7 @@ from test import say_hy
if __name__ == "__main__": if __name__ == "__main__":
say_hy("dear Ruff contributor") say_hy("dear Ruff contributor")
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -314,7 +314,7 @@ if __name__ == "__main__":
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
"###); ");
}); });
Ok(()) Ok(())
@ -349,7 +349,7 @@ max-line-length = 100
_ = "---------------------------------------------------------------------------亜亜亜亜亜亜" _ = "---------------------------------------------------------------------------亜亜亜亜亜亜"
# longer than 100 # longer than 100
_ = "---------------------------------------------------------------------------亜亜亜亜亜亜亜亜亜亜亜亜亜亜" _ = "---------------------------------------------------------------------------亜亜亜亜亜亜亜亜亜亜亜亜亜亜"
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -360,7 +360,7 @@ _ = "---------------------------------------------------------------------------
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `[TMP]/ruff.toml`:
- 'select' -> 'lint.select' - 'select' -> 'lint.select'
- 'pycodestyle' -> 'lint.pycodestyle' - 'pycodestyle' -> 'lint.pycodestyle'
"###); ");
}); });
Ok(()) Ok(())
@ -397,7 +397,7 @@ from test import say_hy
if __name__ == "__main__": if __name__ == "__main__":
say_hy("dear Ruff contributor") say_hy("dear Ruff contributor")
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -408,7 +408,7 @@ if __name__ == "__main__":
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
"###); ");
}); });
Ok(()) Ok(())
@ -445,7 +445,7 @@ from test import say_hy
if __name__ == "__main__": if __name__ == "__main__":
say_hy("dear Ruff contributor") say_hy("dear Ruff contributor")
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -456,7 +456,7 @@ if __name__ == "__main__":
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `ruff.toml`:
- 'extend-select' -> 'lint.extend-select' - 'extend-select' -> 'lint.extend-select'
"###); ");
}); });
Ok(()) Ok(())
@ -493,7 +493,7 @@ ignore = ["D203", "D212"]
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(sub_dir) .current_dir(sub_dir)
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
, @r###" , @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -501,7 +501,7 @@ ignore = ["D203", "D212"]
----- stderr ----- ----- stderr -----
warning: No Python files found under the given path(s) warning: No Python files found under the given path(s)
"###); ");
}); });
Ok(()) Ok(())
@ -511,7 +511,7 @@ ignore = ["D203", "D212"]
fn nonexistent_config_file() { fn nonexistent_config_file() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--config", "foo.toml", "."]), @r###" .args(["--config", "foo.toml", "."]), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -527,14 +527,14 @@ fn nonexistent_config_file() {
The path `foo.toml` does not point to a configuration file The path `foo.toml` does not point to a configuration file
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
fn config_override_rejected_if_invalid_toml() { fn config_override_rejected_if_invalid_toml() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--config", "foo = bar", "."]), @r###" .args(["--config", "foo = bar", "."]), @r#"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -556,7 +556,7 @@ fn config_override_rejected_if_invalid_toml() {
expected `"`, `'` expected `"`, `'`
For more information, try '--help'. For more information, try '--help'.
"###); "#);
} }
#[test] #[test]
@ -575,19 +575,18 @@ fn too_many_config_files() -> Result<()> {
.arg(&ruff_dot_toml) .arg(&ruff_dot_toml)
.arg("--config") .arg("--config")
.arg(&ruff2_dot_toml) .arg(&ruff2_dot_toml)
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: You cannot specify more than one configuration file on the command line. Cause: You cannot specify more than one configuration file on the command line.
tip: remove either `--config=[TMP]/ruff.toml` or `--config=[TMP]/ruff2.toml`. tip: remove either `--config=[TMP]/ruff.toml` or `--config=[TMP]/ruff2.toml`.
For more information, try `--help`. For more information, try `--help`.
");
"###);
}); });
Ok(()) Ok(())
} }
@ -596,7 +595,7 @@ fn too_many_config_files() -> Result<()> {
fn extend_passed_via_config_argument() { fn extend_passed_via_config_argument() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--config", "extend = 'foo.toml'", "."]), @r###" .args(["--config", "extend = 'foo.toml'", "."]), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -607,7 +606,7 @@ fn extend_passed_via_config_argument() {
tip: Cannot include `extend` in a --config flag value tip: Cannot include `extend` in a --config flag value
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -623,20 +622,19 @@ fn config_file_and_isolated() -> Result<()> {
.arg("--config") .arg("--config")
.arg(&ruff_dot_toml) .arg(&ruff_dot_toml)
.arg("--isolated") .arg("--isolated")
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: The argument `--config=[TMP]/ruff.toml` cannot be used with `--isolated` Cause: The argument `--config=[TMP]/ruff.toml` cannot be used with `--isolated`
tip: You cannot specify a configuration file and also specify `--isolated`, tip: You cannot specify a configuration file and also specify `--isolated`,
as `--isolated` causes ruff to ignore all configuration files. as `--isolated` causes ruff to ignore all configuration files.
For more information, try `--help`. For more information, try `--help`.
");
"###);
}); });
Ok(()) Ok(())
} }
@ -681,7 +679,7 @@ x = "longer_than_90_charactersssssssssssssssssssssssssssssssssssssssssssssssssss
.args(["--config", "lint.extend-select=['E501', 'F841']"]) .args(["--config", "lint.extend-select=['E501', 'F841']"])
.args(["--config", "lint.isort.combine-as-imports = false"]) .args(["--config", "lint.isort.combine-as-imports = false"])
.arg("-") .arg("-")
.pass_stdin(fixture), @r###" .pass_stdin(fixture), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -691,7 +689,7 @@ x = "longer_than_90_charactersssssssssssssssssssssssssssssssssssssssssssssssssss
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -700,7 +698,7 @@ fn valid_toml_but_nonexistent_option_provided_via_config_argument() {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args([".", "--config", "extend-select=['F481']"]), // No such code as F481! .args([".", "--config", "extend-select=['F481']"]), // No such code as F481!
@r###" @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -717,7 +715,7 @@ fn valid_toml_but_nonexistent_option_provided_via_config_argument() {
Unknown rule selector: `F481` Unknown rule selector: `F481`
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -727,7 +725,7 @@ fn each_toml_option_requires_a_new_flag_1() {
// commas can't be used to delimit different config overrides; // commas can't be used to delimit different config overrides;
// you need a new --config flag for each override // you need a new --config flag for each override
.args([".", "--config", "extend-select=['F841'], line-length=90"]), .args([".", "--config", "extend-select=['F841'], line-length=90"]),
@r###" @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -748,7 +746,7 @@ fn each_toml_option_requires_a_new_flag_1() {
expected newline, `#` expected newline, `#`
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -758,7 +756,7 @@ fn each_toml_option_requires_a_new_flag_2() {
// spaces *also* can't be used to delimit different config overrides; // spaces *also* can't be used to delimit different config overrides;
// you need a new --config flag for each override // you need a new --config flag for each override
.args([".", "--config", "extend-select=['F841'] line-length=90"]), .args([".", "--config", "extend-select=['F841'] line-length=90"]),
@r###" @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -779,7 +777,7 @@ fn each_toml_option_requires_a_new_flag_2() {
expected newline, `#` expected newline, `#`
For more information, try '--help'. For more information, try '--help'.
"###); ");
} }
#[test] #[test]
@ -806,7 +804,7 @@ select=["E501"]
.arg(&ruff_toml) .arg(&ruff_toml)
.args(["--config", "line-length=110"]) .args(["--config", "line-length=110"])
.arg("-") .arg("-")
.pass_stdin(fixture), @r###" .pass_stdin(fixture), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -814,7 +812,7 @@ select=["E501"]
Found 1 error. Found 1 error.
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -831,14 +829,14 @@ fn complex_config_setting_overridden_via_cli() -> Result<()> {
.args(["--config", "lint.per-file-ignores = {'generated.py' = ['N801']}"]) .args(["--config", "lint.per-file-ignores = {'generated.py' = ['N801']}"])
.args(["--stdin-filename", "generated.py"]) .args(["--stdin-filename", "generated.py"])
.arg("-") .arg("-")
.pass_stdin(fixture), @r###" .pass_stdin(fixture), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
All checks passed! All checks passed!
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -848,7 +846,7 @@ fn deprecated_config_option_overridden_via_cli() {
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--config", "select=['N801']", "-"]) .args(["--config", "select=['N801']", "-"])
.pass_stdin("class lowercase: ..."), .pass_stdin("class lowercase: ..."),
@r###" @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -858,7 +856,7 @@ fn deprecated_config_option_overridden_via_cli() {
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in your `--config` CLI arguments: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in your `--config` CLI arguments:
- 'select' -> 'lint.select' - 'select' -> 'lint.select'
"###); ");
} }
#[test] #[test]
@ -922,7 +920,7 @@ include = ["*.ipy"]
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--config", &ruff_toml.file_name().unwrap().to_string_lossy()]) .args(["--config", &ruff_toml.file_name().unwrap().to_string_lossy()])
.args(["--extension", "ipy:ipynb"]) .args(["--extension", "ipy:ipynb"])
.arg("."), @r###" .arg("."), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -931,7 +929,7 @@ include = ["*.ipy"]
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -960,7 +958,7 @@ external = ["AAA"]
.pass_stdin(r#" .pass_stdin(r#"
# flake8: noqa: AAA101, BBB102 # flake8: noqa: AAA101, BBB102
import os import os
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -970,7 +968,7 @@ import os
----- stderr ----- ----- stderr -----
warning: Invalid rule code provided to `# ruff: noqa` at -:2: BBB102 warning: Invalid rule code provided to `# ruff: noqa` at -:2: BBB102
"###); ");
}); });
Ok(()) Ok(())
@ -999,7 +997,7 @@ required-version = "0.1.0"
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
import os import os
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -1007,7 +1005,7 @@ import os
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: Required version `==0.1.0` does not match the running version `[VERSION]` Cause: Required version `==0.1.0` does not match the running version `[VERSION]`
"###); ");
}); });
Ok(()) Ok(())
@ -1038,7 +1036,7 @@ required-version = "{version}"
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
import os import os
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1047,7 +1045,7 @@ import os
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1078,7 +1076,7 @@ required-version = ">{version}"
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
import os import os
"#), @r###" "#), @r"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -1086,7 +1084,7 @@ import os
----- stderr ----- ----- stderr -----
ruff failed ruff failed
Cause: Required version `>[VERSION]` does not match the running version `[VERSION]` Cause: Required version `>[VERSION]` does not match the running version `[VERSION]`
"###); ");
}); });
Ok(()) Ok(())
@ -1115,7 +1113,7 @@ required-version = ">=0.1.0"
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
import os import os
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1124,7 +1122,7 @@ import os
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1156,7 +1154,7 @@ import os
def func(): def func():
x = 1 x = 1
"#), @r###" "#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1165,7 +1163,7 @@ def func():
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1194,7 +1192,7 @@ fn negated_per_file_ignores() -> Result<()> {
.arg("--select") .arg("--select")
.arg("RUF901") .arg("RUF901")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1203,7 +1201,7 @@ fn negated_per_file_ignores() -> Result<()> {
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1233,7 +1231,7 @@ fn negated_per_file_ignores_absolute() -> Result<()> {
.arg("--select") .arg("--select")
.arg("RUF901") .arg("RUF901")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1242,7 +1240,7 @@ fn negated_per_file_ignores_absolute() -> Result<()> {
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
} }
@ -1272,14 +1270,14 @@ fn negated_per_file_ignores_overlap() -> Result<()> {
.arg("--select") .arg("--select")
.arg("RUF901") .arg("RUF901")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
All checks passed! All checks passed!
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1311,7 +1309,7 @@ import os # F401
def function(): def function():
import os # F811 import os # F811
print(os.name) print(os.name)
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -1323,7 +1321,7 @@ def function():
----- stderr ----- ----- stderr -----
Found 1 error (1 fixed, 0 remaining). Found 1 error (1 fixed, 0 remaining).
"###); ");
}); });
Ok(()) Ok(())
@ -1363,22 +1361,22 @@ def first_square():
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
let test_code = std::fs::read_to_string(&test_path).expect("should read test file"); let test_code = std::fs::read_to_string(&test_path).expect("should read test file");
insta::assert_snapshot!(test_code, @r###" insta::assert_snapshot!(test_code, @r"
def first_square(): def first_square():
return [x * x for x in range(20)][0] # noqa: RUF015 return [x * x for x in range(20)][0] # noqa: RUF015
"###); ");
Ok(()) Ok(())
} }
@ -1418,23 +1416,22 @@ def unused(x):
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
let test_code = std::fs::read_to_string(&test_path).expect("should read test file"); let test_code = std::fs::read_to_string(&test_path).expect("should read test file");
insta::assert_snapshot!(test_code, @r###" insta::assert_snapshot!(test_code, @r"
def unused(x): # noqa: ANN001, ANN201, D103 def unused(x): # noqa: ANN001, ANN201, D103
pass pass
"###); ");
Ok(()) Ok(())
} }
@ -1474,24 +1471,23 @@ import a
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
let test_code = std::fs::read_to_string(&test_path).expect("should read test file"); let test_code = std::fs::read_to_string(&test_path).expect("should read test file");
insta::assert_snapshot!(test_code, @r###" insta::assert_snapshot!(test_code, @r"
import z # noqa: I001 import z # noqa: I001
import c import c
import a import a
"###); ");
Ok(()) Ok(())
} }
@ -1531,23 +1527,22 @@ def unused(x): # noqa: ANN001, ARG001, D103
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
let test_code = std::fs::read_to_string(&test_path).expect("should read test file"); let test_code = std::fs::read_to_string(&test_path).expect("should read test file");
insta::assert_snapshot!(test_code, @r###" insta::assert_snapshot!(test_code, @r"
def unused(x): # noqa: ANN001, ANN201, ARG001, D103 def unused(x): # noqa: ANN001, ANN201, ARG001, D103
pass pass
"###); ");
Ok(()) Ok(())
} }
@ -1592,19 +1587,19 @@ print(
.arg("-") .arg("-")
.pass_stdin(r#" .pass_stdin(r#"
"#), @r###" "#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
let test_code = std::fs::read_to_string(&test_path).expect("should read test file"); let test_code = std::fs::read_to_string(&test_path).expect("should read test file");
insta::assert_snapshot!(test_code, @r###" insta::assert_snapshot!(test_code, @r#"
print( print(
"""First line """First line
second line second line
@ -1612,7 +1607,7 @@ print(
%s""" # noqa: UP031 %s""" # noqa: UP031
% name % name
) )
"###); "#);
Ok(()) Ok(())
} }
@ -1656,14 +1651,14 @@ def first_square():
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.current_dir(tempdir.path()) .current_dir(tempdir.path())
.args(STDIN_BASE_OPTIONS) .args(STDIN_BASE_OPTIONS)
.args(["--add-noqa"]), @r###" .args(["--add-noqa"]), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
Added 1 noqa directive. Added 1 noqa directive.
"###); ");
}); });
Ok(()) Ok(())
@ -1693,7 +1688,7 @@ select = ["UP006"]
.arg(&ruff_toml) .arg(&ruff_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"from typing import List; foo: List[int]"#), @r###" .pass_stdin(r#"from typing import List; foo: List[int]"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1702,7 +1697,7 @@ select = ["UP006"]
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
let pyproject_toml = tempdir.path().join("pyproject.toml"); let pyproject_toml = tempdir.path().join("pyproject.toml");
@ -1725,14 +1720,14 @@ select = ["UP006"]
.arg(&pyproject_toml) .arg(&pyproject_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"from typing import List; foo: List[int]"#), @r###" .pass_stdin(r#"from typing import List; foo: List[int]"#), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
All checks passed! All checks passed!
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1762,7 +1757,7 @@ select = ["UP006"]
.arg(&pyproject_toml) .arg(&pyproject_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"from typing import List; foo: List[int]"#), @r###" .pass_stdin(r#"from typing import List; foo: List[int]"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1771,7 +1766,7 @@ select = ["UP006"]
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1801,7 +1796,7 @@ select = ["UP006"]
.arg(&pyproject_toml) .arg(&pyproject_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"from typing import List; foo: List[int]"#), @r###" .pass_stdin(r#"from typing import List; foo: List[int]"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1810,7 +1805,7 @@ select = ["UP006"]
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1840,7 +1835,7 @@ select = ["UP006"]
.arg(&pyproject_toml) .arg(&pyproject_toml)
.args(["--stdin-filename", "test.py"]) .args(["--stdin-filename", "test.py"])
.arg("-") .arg("-")
.pass_stdin(r#"from typing import List; foo: List[int]"#), @r###" .pass_stdin(r#"from typing import List; foo: List[int]"#), @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1849,7 +1844,7 @@ select = ["UP006"]
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())
@ -1904,7 +1899,7 @@ fn checks_notebooks_in_stable() -> anyhow::Result<()> {
.arg("--select") .arg("--select")
.arg("F401") .arg("F401")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1913,7 +1908,7 @@ fn checks_notebooks_in_stable() -> anyhow::Result<()> {
[*] 1 fixable with the `--fix` option. [*] 1 fixable with the `--fix` option.
----- stderr ----- ----- stderr -----
"###); ");
Ok(()) Ok(())
} }
@ -1942,14 +1937,14 @@ fn nested_implicit_namespace_package() -> Result<()> {
.arg("--select") .arg("--select")
.arg("INP") .arg("INP")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
All checks passed! All checks passed!
----- stderr ----- ----- stderr -----
"###); ");
insta::with_settings!({filters => vec![(r"\\", "/")]}, { insta::with_settings!({filters => vec![(r"\\", "/")]}, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
@ -1958,7 +1953,7 @@ fn nested_implicit_namespace_package() -> Result<()> {
.arg("INP") .arg("INP")
.arg("--preview") .arg("--preview")
.current_dir(&tempdir) .current_dir(&tempdir)
, @r###" , @r"
success: false success: false
exit_code: 1 exit_code: 1
----- stdout ----- ----- stdout -----
@ -1966,7 +1961,7 @@ fn nested_implicit_namespace_package() -> Result<()> {
Found 1 error. Found 1 error.
----- stderr ----- ----- stderr -----
"###); ");
}); });
Ok(()) Ok(())

View file

@ -29,7 +29,7 @@ fn check_project_include_defaults() {
filters => TEST_FILTERS.to_vec() filters => TEST_FILTERS.to_vec()
}, { }, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check", "--show-files"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r###" .args(["check", "--show-files"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
@ -41,7 +41,7 @@ fn check_project_include_defaults() {
----- stderr ----- ----- stderr -----
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `nested-project/pyproject.toml`: warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `nested-project/pyproject.toml`:
- 'select' -> 'lint.select' - 'select' -> 'lint.select'
"###); ");
}); });
} }
@ -53,14 +53,14 @@ fn check_project_respects_direct_paths() {
filters => TEST_FILTERS.to_vec() filters => TEST_FILTERS.to_vec()
}, { }, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check", "--show-files", "b.py"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r###" .args(["check", "--show-files", "b.py"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
[BASEPATH]/include-test/b.py [BASEPATH]/include-test/b.py
----- stderr ----- ----- stderr -----
"###); ");
}); });
} }
@ -72,14 +72,14 @@ fn check_project_respects_subdirectory_includes() {
filters => TEST_FILTERS.to_vec() filters => TEST_FILTERS.to_vec()
}, { }, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check", "--show-files", "subdirectory"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r###" .args(["check", "--show-files", "subdirectory"]).current_dir(Path::new("./resources/test/fixtures/include-test")), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
[BASEPATH]/include-test/subdirectory/c.py [BASEPATH]/include-test/subdirectory/c.py
----- stderr ----- ----- stderr -----
"###); ");
}); });
} }
@ -91,13 +91,13 @@ fn check_project_from_project_subdirectory_respects_includes() {
filters => TEST_FILTERS.to_vec() filters => TEST_FILTERS.to_vec()
}, { }, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check", "--show-files"]).current_dir(Path::new("./resources/test/fixtures/include-test/subdirectory")), @r###" .args(["check", "--show-files"]).current_dir(Path::new("./resources/test/fixtures/include-test/subdirectory")), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
[BASEPATH]/include-test/subdirectory/c.py [BASEPATH]/include-test/subdirectory/c.py
----- stderr ----- ----- stderr -----
"###); ");
}); });
} }

View file

@ -5,6 +5,7 @@ info:
args: args:
- rule - rule
- F401 - F401
snapshot_kind: text
--- ---
success: true success: true
exit_code: 0 exit_code: 0

View file

@ -6,6 +6,7 @@ info:
- check - check
- "--show-settings" - "--show-settings"
- unformatted.py - unformatted.py
snapshot_kind: text
--- ---
success: true success: true
exit_code: 0 exit_code: 0

View file

@ -16,14 +16,14 @@ const VERSION_FILTER: [(&str, &str); 1] = [(
fn version_basics() { fn version_basics() {
insta::with_settings!({filters => VERSION_FILTER.to_vec()}, { insta::with_settings!({filters => VERSION_FILTER.to_vec()}, {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).arg("version"), @r###" Command::new(get_cargo_bin(BIN_NAME)).arg("version"), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
ruff [VERSION] ruff [VERSION]
----- stderr ----- ----- stderr -----
"### "
); );
}); });
} }
@ -42,14 +42,14 @@ fn config_option_allowed_but_ignored() -> Result<()> {
.arg("version") .arg("version")
.arg("--config") .arg("--config")
.arg(&ruff_dot_toml) .arg(&ruff_dot_toml)
.args(["--config", "lint.isort.extra-standard-library = ['foo', 'bar']"]), @r###" .args(["--config", "lint.isort.extra-standard-library = ['foo', 'bar']"]), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
ruff [VERSION] ruff [VERSION]
----- stderr ----- ----- stderr -----
"### "
); );
}); });
Ok(()) Ok(())
@ -60,7 +60,7 @@ fn config_option_ignored_but_validated() {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)) Command::new(get_cargo_bin(BIN_NAME))
.arg("version") .arg("version")
.args(["--config", "foo = bar"]), @r###" .args(["--config", "foo = bar"]), @r#"
success: false success: false
exit_code: 2 exit_code: 2
----- stdout ----- ----- stdout -----
@ -82,7 +82,7 @@ fn config_option_ignored_but_validated() {
expected `"`, `'` expected `"`, `'`
For more information, try '--help'. For more information, try '--help'.
"### "#
); );
}); });
} }
@ -92,14 +92,14 @@ fn config_option_ignored_but_validated() {
fn isolated_option_allowed() { fn isolated_option_allowed() {
insta::with_settings!({filters => VERSION_FILTER.to_vec()}, { insta::with_settings!({filters => VERSION_FILTER.to_vec()}, {
assert_cmd_snapshot!( assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME)).arg("version").arg("--isolated"), @r###" Command::new(get_cargo_bin(BIN_NAME)).arg("version").arg("--isolated"), @r"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
ruff [VERSION] ruff [VERSION]
----- stderr ----- ----- stderr -----
"### "
); );
}); });
} }

View file

@ -418,7 +418,7 @@ pub(crate) mod tests {
#[test] #[test]
fn filesystem_debug_implementation_alternate() { fn filesystem_debug_implementation_alternate() {
assert_snapshot!(format!("{:#?}", mock_typeshed()), @r###" assert_snapshot!(format!("{:#?}", mock_typeshed()), @r#"
VendoredFileSystem { VendoredFileSystem {
inner_mutex_poisoned: false, inner_mutex_poisoned: false,
paths: [ paths: [
@ -454,7 +454,7 @@ pub(crate) mod tests {
}, },
}, },
} }
"###); "#);
} }
fn test_directory(dirname: &str) { fn test_directory(dirname: &str) {

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/comments/shebang.rs source: crates/ruff_linter/src/comments/shebang.rs
expression: "ShebangDirective::try_extract(source)" expression: "ShebangDirective::try_extract(source)"
snapshot_kind: text
--- ---
None None

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/comments/shebang.rs source: crates/ruff_linter/src/comments/shebang.rs
expression: "ShebangDirective::try_extract(source)" expression: "ShebangDirective::try_extract(source)"
snapshot_kind: text
--- ---
None None

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/comments/shebang.rs source: crates/ruff_linter/src/comments/shebang.rs
expression: "ShebangDirective::try_extract(source)" expression: "ShebangDirective::try_extract(source)"
snapshot_kind: text
--- ---
Some( Some(
ShebangDirective( ShebangDirective(

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/comments/shebang.rs source: crates/ruff_linter/src/comments/shebang.rs
expression: "ShebangDirective::try_extract(source)" expression: "ShebangDirective::try_extract(source)"
snapshot_kind: text
--- ---
Some( Some(
ShebangDirective( ShebangDirective(

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/comments/shebang.rs source: crates/ruff_linter/src/comments/shebang.rs
expression: "ShebangDirective::try_extract(source)" expression: "ShebangDirective::try_extract(source)"
snapshot_kind: text
--- ---
None None

View file

@ -1,8 +1,8 @@
--- ---
source: crates/ruff_linter/src/message/azure.rs source: crates/ruff_linter/src/message/azure.rs
expression: content expression: content
snapshot_kind: text
--- ---
##vso[task.logissue type=error;sourcepath=fib.py;linenumber=1;columnnumber=8;code=F401;]`os` imported but unused ##vso[task.logissue type=error;sourcepath=fib.py;linenumber=1;columnnumber=8;code=F401;]`os` imported but unused
##vso[task.logissue type=error;sourcepath=fib.py;linenumber=6;columnnumber=5;code=F841;]Local variable `x` is assigned to but never used ##vso[task.logissue type=error;sourcepath=fib.py;linenumber=6;columnnumber=5;code=F841;]Local variable `x` is assigned to but never used
##vso[task.logissue type=error;sourcepath=undef.py;linenumber=1;columnnumber=4;code=F821;]Undefined name `a` ##vso[task.logissue type=error;sourcepath=undef.py;linenumber=1;columnnumber=4;code=F821;]Undefined name `a`

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/azure.rs source: crates/ruff_linter/src/message/azure.rs
expression: content expression: content
snapshot_kind: text
--- ---
##vso[task.logissue type=error;sourcepath=syntax_errors.py;linenumber=1;columnnumber=15;]SyntaxError: Expected one or more symbol names after import ##vso[task.logissue type=error;sourcepath=syntax_errors.py;linenumber=1;columnnumber=15;]SyntaxError: Expected one or more symbol names after import
##vso[task.logissue type=error;sourcepath=syntax_errors.py;linenumber=3;columnnumber=12;]SyntaxError: Expected ')', found newline ##vso[task.logissue type=error;sourcepath=syntax_errors.py;linenumber=3;columnnumber=12;]SyntaxError: Expected ')', found newline

View file

@ -1,8 +1,8 @@
--- ---
source: crates/ruff_linter/src/message/github.rs source: crates/ruff_linter/src/message/github.rs
expression: content expression: content
snapshot_kind: text
--- ---
::error title=Ruff (F401),file=fib.py,line=1,col=8,endLine=1,endColumn=10::fib.py:1:8: F401 `os` imported but unused ::error title=Ruff (F401),file=fib.py,line=1,col=8,endLine=1,endColumn=10::fib.py:1:8: F401 `os` imported but unused
::error title=Ruff (F841),file=fib.py,line=6,col=5,endLine=6,endColumn=6::fib.py:6:5: F841 Local variable `x` is assigned to but never used ::error title=Ruff (F841),file=fib.py,line=6,col=5,endLine=6,endColumn=6::fib.py:6:5: F841 Local variable `x` is assigned to but never used
::error title=Ruff (F821),file=undef.py,line=1,col=4,endLine=1,endColumn=5::undef.py:1:4: F821 Undefined name `a` ::error title=Ruff (F821),file=undef.py,line=1,col=4,endLine=1,endColumn=5::undef.py:1:4: F821 Undefined name `a`

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/github.rs source: crates/ruff_linter/src/message/github.rs
expression: content expression: content
snapshot_kind: text
--- ---
::error title=Ruff,file=syntax_errors.py,line=1,col=15,endLine=2,endColumn=1::syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after import ::error title=Ruff,file=syntax_errors.py,line=1,col=15,endLine=2,endColumn=1::syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after import
::error title=Ruff,file=syntax_errors.py,line=3,col=12,endLine=4,endColumn=1::syntax_errors.py:3:12: SyntaxError: Expected ')', found newline ::error title=Ruff,file=syntax_errors.py,line=3,col=12,endLine=4,endColumn=1::syntax_errors.py:3:12: SyntaxError: Expected ')', found newline

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/gitlab.rs source: crates/ruff_linter/src/message/gitlab.rs
expression: redact_fingerprint(&content) expression: redact_fingerprint(&content)
snapshot_kind: text
--- ---
[ [
{ {

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/gitlab.rs source: crates/ruff_linter/src/message/gitlab.rs
expression: redact_fingerprint(&content) expression: redact_fingerprint(&content)
snapshot_kind: text
--- ---
[ [
{ {

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/grouped.rs source: crates/ruff_linter/src/message/grouped.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py: fib.py:
1:8 F401 `os` imported but unused 1:8 F401 `os` imported but unused
@ -8,5 +9,3 @@ fib.py:
undef.py: undef.py:
1:4 F821 Undefined name `a` 1:4 F821 Undefined name `a`

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/grouped.rs source: crates/ruff_linter/src/message/grouped.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py: fib.py:
1:8 F401 `os` imported but unused 1:8 F401 `os` imported but unused
@ -27,5 +28,3 @@ undef.py:
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/grouped.rs source: crates/ruff_linter/src/message/grouped.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py: fib.py:
1:8 F401 [*] `os` imported but unused 1:8 F401 [*] `os` imported but unused
@ -27,5 +28,3 @@ undef.py:
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/grouped.rs source: crates/ruff_linter/src/message/grouped.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py: fib.py:
1:8 F401 `os` imported but unused 1:8 F401 `os` imported but unused
@ -27,5 +28,3 @@ undef.py:
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/grouped.rs source: crates/ruff_linter/src/message/grouped.rs
expression: content expression: content
snapshot_kind: text
--- ---
syntax_errors.py: syntax_errors.py:
1:15 SyntaxError: Expected one or more symbol names after import 1:15 SyntaxError: Expected one or more symbol names after import

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/json.rs source: crates/ruff_linter/src/message/json.rs
expression: content expression: content
snapshot_kind: text
--- ---
[ [
{ {

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/json.rs source: crates/ruff_linter/src/message/json.rs
expression: content expression: content
snapshot_kind: text
--- ---
[ [
{ {

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/json.rs source: crates/ruff_linter/src/message/json.rs
expression: content expression: content
snapshot_kind: text
--- ---
[ [
{ {

View file

@ -1,8 +1,8 @@
--- ---
source: crates/ruff_linter/src/message/json_lines.rs source: crates/ruff_linter/src/message/json_lines.rs
expression: content expression: content
snapshot_kind: text
--- ---
{"cell":1,"code":"F401","end_location":{"column":10,"row":2},"filename":"notebook.ipynb","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":10,"row":2},"location":{"column":1,"row":2}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":2},"message":"`os` imported but unused","noqa_row":2,"url":"https://docs.astral.sh/ruff/rules/unused-import"} {"cell":1,"code":"F401","end_location":{"column":10,"row":2},"filename":"notebook.ipynb","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":10,"row":2},"location":{"column":1,"row":2}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":2},"message":"`os` imported but unused","noqa_row":2,"url":"https://docs.astral.sh/ruff/rules/unused-import"}
{"cell":2,"code":"F401","end_location":{"column":12,"row":2},"filename":"notebook.ipynb","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":3},"location":{"column":1,"row":2}}],"message":"Remove unused import: `math`"},"location":{"column":8,"row":2},"message":"`math` imported but unused","noqa_row":2,"url":"https://docs.astral.sh/ruff/rules/unused-import"} {"cell":2,"code":"F401","end_location":{"column":12,"row":2},"filename":"notebook.ipynb","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":3},"location":{"column":1,"row":2}}],"message":"Remove unused import: `math`"},"location":{"column":8,"row":2},"message":"`math` imported but unused","noqa_row":2,"url":"https://docs.astral.sh/ruff/rules/unused-import"}
{"cell":3,"code":"F841","end_location":{"column":6,"row":4},"filename":"notebook.ipynb","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":10,"row":4},"location":{"column":1,"row":4}}],"message":"Remove assignment to unused variable `x`"},"location":{"column":5,"row":4},"message":"Local variable `x` is assigned to but never used","noqa_row":4,"url":"https://docs.astral.sh/ruff/rules/unused-variable"} {"cell":3,"code":"F841","end_location":{"column":6,"row":4},"filename":"notebook.ipynb","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":10,"row":4},"location":{"column":1,"row":4}}],"message":"Remove assignment to unused variable `x`"},"location":{"column":5,"row":4},"message":"Local variable `x` is assigned to but never used","noqa_row":4,"url":"https://docs.astral.sh/ruff/rules/unused-variable"}

View file

@ -1,8 +1,8 @@
--- ---
source: crates/ruff_linter/src/message/json_lines.rs source: crates/ruff_linter/src/message/json_lines.rs
expression: content expression: content
snapshot_kind: text
--- ---
{"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"fib.py","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","noqa_row":1,"url":"https://docs.astral.sh/ruff/rules/unused-import"} {"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"fib.py","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","noqa_row":1,"url":"https://docs.astral.sh/ruff/rules/unused-import"}
{"cell":null,"code":"F841","end_location":{"column":6,"row":6},"filename":"fib.py","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":10,"row":6},"location":{"column":5,"row":6}}],"message":"Remove assignment to unused variable `x`"},"location":{"column":5,"row":6},"message":"Local variable `x` is assigned to but never used","noqa_row":6,"url":"https://docs.astral.sh/ruff/rules/unused-variable"} {"cell":null,"code":"F841","end_location":{"column":6,"row":6},"filename":"fib.py","fix":{"applicability":"unsafe","edits":[{"content":"","end_location":{"column":10,"row":6},"location":{"column":5,"row":6}}],"message":"Remove assignment to unused variable `x`"},"location":{"column":5,"row":6},"message":"Local variable `x` is assigned to but never used","noqa_row":6,"url":"https://docs.astral.sh/ruff/rules/unused-variable"}
{"cell":null,"code":"F821","end_location":{"column":5,"row":1},"filename":"undef.py","fix":null,"location":{"column":4,"row":1},"message":"Undefined name `a`","noqa_row":1,"url":"https://docs.astral.sh/ruff/rules/undefined-name"} {"cell":null,"code":"F821","end_location":{"column":5,"row":1},"filename":"undef.py","fix":null,"location":{"column":4,"row":1},"message":"Undefined name `a`","noqa_row":1,"url":"https://docs.astral.sh/ruff/rules/undefined-name"}

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/json_lines.rs source: crates/ruff_linter/src/message/json_lines.rs
expression: content expression: content
snapshot_kind: text
--- ---
{"cell":null,"code":null,"end_location":{"column":1,"row":2},"filename":"syntax_errors.py","fix":null,"location":{"column":15,"row":1},"message":"SyntaxError: Expected one or more symbol names after import","noqa_row":null,"url":null} {"cell":null,"code":null,"end_location":{"column":1,"row":2},"filename":"syntax_errors.py","fix":null,"location":{"column":15,"row":1},"message":"SyntaxError: Expected one or more symbol names after import","noqa_row":null,"url":null}
{"cell":null,"code":null,"end_location":{"column":1,"row":4},"filename":"syntax_errors.py","fix":null,"location":{"column":12,"row":3},"message":"SyntaxError: Expected ')', found newline","noqa_row":null,"url":null} {"cell":null,"code":null,"end_location":{"column":1,"row":4},"filename":"syntax_errors.py","fix":null,"location":{"column":12,"row":3},"message":"SyntaxError: Expected ')', found newline","noqa_row":null,"url":null}

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/junit.rs source: crates/ruff_linter/src/message/junit.rs
expression: content expression: content
snapshot_kind: text
--- ---
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="ruff" tests="3" failures="3" errors="0"> <testsuites name="ruff" tests="3" failures="3" errors="0">
@ -18,4 +19,3 @@ expression: content
</testcase> </testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/junit.rs source: crates/ruff_linter/src/message/junit.rs
expression: content expression: content
snapshot_kind: text
--- ---
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="ruff" tests="2" failures="2" errors="0"> <testsuites name="ruff" tests="2" failures="2" errors="0">

View file

@ -1,8 +1,8 @@
--- ---
source: crates/ruff_linter/src/message/pylint.rs source: crates/ruff_linter/src/message/pylint.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py:1: [F401] `os` imported but unused fib.py:1: [F401] `os` imported but unused
fib.py:6: [F841] Local variable `x` is assigned to but never used fib.py:6: [F841] Local variable `x` is assigned to but never used
undef.py:1: [F821] Undefined name `a` undef.py:1: [F821] Undefined name `a`

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/pylint.rs source: crates/ruff_linter/src/message/pylint.rs
expression: content expression: content
snapshot_kind: text
--- ---
syntax_errors.py:1: SyntaxError: Expected one or more symbol names after import syntax_errors.py:1: SyntaxError: Expected one or more symbol names after import
syntax_errors.py:3: SyntaxError: Expected ')', found newline syntax_errors.py:3: SyntaxError: Expected ')', found newline

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/rdjson.rs source: crates/ruff_linter/src/message/rdjson.rs
expression: content expression: content
snapshot_kind: text
--- ---
{ {
"diagnostics": [ "diagnostics": [

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/rdjson.rs source: crates/ruff_linter/src/message/rdjson.rs
expression: content expression: content
snapshot_kind: text
--- ---
{ {
"diagnostics": [ "diagnostics": [

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/sarif.rs source: crates/ruff_linter/src/message/sarif.rs
expression: value expression: value
snapshot_kind: text
--- ---
{ {
"$schema": "https://json.schemastore.org/sarif-2.1.0.json", "$schema": "https://json.schemastore.org/sarif-2.1.0.json",

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/text.rs source: crates/ruff_linter/src/message/text.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py:1:8: F401 `os` imported but unused fib.py:1:8: F401 `os` imported but unused
| |
@ -25,5 +26,3 @@ undef.py:1:4: F821 Undefined name `a`
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/text.rs source: crates/ruff_linter/src/message/text.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py:1:8: F401 `os` imported but unused fib.py:1:8: F401 `os` imported but unused
| |
@ -25,5 +26,3 @@ undef.py:1:4: F821 Undefined name `a`
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/text.rs source: crates/ruff_linter/src/message/text.rs
expression: content expression: content
snapshot_kind: text
--- ---
fib.py:1:8: F401 [*] `os` imported but unused fib.py:1:8: F401 [*] `os` imported but unused
| |
@ -25,5 +26,3 @@ undef.py:1:4: F821 Undefined name `a`
1 | if a == 1: pass 1 | if a == 1: pass
| ^ F821 | ^ F821
| |

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/text.rs source: crates/ruff_linter/src/message/text.rs
expression: content expression: content
snapshot_kind: text
--- ---
notebook.ipynb:cell 1:2:8: F401 [*] `os` imported but unused notebook.ipynb:cell 1:2:8: F401 [*] `os` imported but unused
| |
@ -28,5 +29,3 @@ notebook.ipynb:cell 3:4:5: F841 [*] Local variable `x` is assigned to but never
| ^ F841 | ^ F841
| |
= help: Remove assignment to unused variable `x` = help: Remove assignment to unused variable `x`

View file

@ -1,6 +1,7 @@
--- ---
source: crates/ruff_linter/src/message/text.rs source: crates/ruff_linter/src/message/text.rs
expression: content expression: content
snapshot_kind: text
--- ---
syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after import syntax_errors.py:1:15: SyntaxError: Expected one or more symbol names after import
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/airflow/mod.rs source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
--- ---
AIR001.py:11:1: AIR001 Task variable name should match the `task_id`: "my_task" AIR001.py:11:1: AIR001 Task variable name should match the `task_id`: "my_task"
| |
@ -18,5 +19,3 @@ AIR001.py:12:1: AIR001 Task variable name should match the `task_id`: "my_task_2
13 | 13 |
14 | from my_module import MyClass 14 | from my_module import MyClass
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/eradicate/mod.rs source: crates/ruff_linter/src/rules/eradicate/mod.rs
snapshot_kind: text
--- ---
ERA001.py:1:1: ERA001 Found commented-out code ERA001.py:1:1: ERA001 Found commented-out code
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/fastapi/mod.rs source: crates/ruff_linter/src/rules/fastapi/mod.rs
snapshot_kind: text
--- ---
FAST002.py:24:5: FAST002 [*] FastAPI dependency without `Annotated` FAST002.py:24:5: FAST002 [*] FastAPI dependency without `Annotated`
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/fastapi/mod.rs source: crates/ruff_linter/src/rules/fastapi/mod.rs
snapshot_kind: text
--- ---
FAST001.py:17:22: FAST001 [*] FastAPI route with redundant `response_model` argument FAST001.py:17:22: FAST001 [*] FastAPI route with redundant `response_model` argument
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/fastapi/mod.rs source: crates/ruff_linter/src/rules/fastapi/mod.rs
snapshot_kind: text
--- ---
FAST003.py:9:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature FAST003.py:9:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
| |
@ -28,5 +29,3 @@ YTT101.py:8:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.versio
9 | 9 |
10 | # the tool is timid and only flags certain numeric slices 10 | # the tool is timid and only flags certain numeric slices
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
| |
@ -16,5 +17,3 @@ YTT102.py:5:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.versio
5 | py_minor = version[2] 5 | py_minor = version[2]
| ^^^^^^^ YTT102 | ^^^^^^^ YTT102
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
| |
@ -46,5 +47,3 @@ YTT103.py:8:1: YTT103 `sys.version` compared to string (python3.10), use `sys.ve
8 | sys.version >= "3.5" 8 | sys.version >= "3.5"
| ^^^^^^^^^^^ YTT103 | ^^^^^^^^^^^ YTT103
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
| |
@ -36,5 +37,3 @@ YTT201.py:10:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
10 | PY2 = version_info[0] != 3 10 | PY2 = version_info[0] != 3
| ^^^^^^^^^^^^^^^ YTT201 | ^^^^^^^^^^^^^^^ YTT201
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2` YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2`
| |
@ -19,5 +20,3 @@ YTT202.py:6:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2`
| ^^^ YTT202 | ^^^ YTT202
7 | print("3") 7 | print("3")
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT203.py:4:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple YTT203.py:4:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple
| |
@ -16,5 +17,3 @@ YTT203.py:5:1: YTT203 `sys.version_info[1]` compared to integer (python4), compa
5 | version_info[1] < 6 5 | version_info[1] < 6
| ^^^^^^^^^^^^^^^ YTT203 | ^^^^^^^^^^^^^^^ YTT203
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT204.py:4:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple YTT204.py:4:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple
| |
@ -16,5 +17,3 @@ YTT204.py:5:1: YTT204 `sys.version_info.minor` compared to integer (python4), co
5 | version_info.minor > 8 5 | version_info.minor > 8
| ^^^^^^^^^^^^^^^^^^ YTT204 | ^^^^^^^^^^^^^^^^^^ YTT204
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT301.py:4:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` YTT301.py:4:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info`
| |
@ -16,5 +17,3 @@ YTT301.py:5:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_
5 | py_major = version[0] 5 | py_major = version[0]
| ^^^^^^^ YTT301 | ^^^^^^^ YTT301
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT302.py:4:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` YTT302.py:4:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info`
| |
@ -46,5 +47,3 @@ YTT302.py:8:1: YTT302 `sys.version` compared to string (python10), use `sys.vers
8 | sys.version >= "3" 8 | sys.version >= "3"
| ^^^^^^^^^^^ YTT302 | ^^^^^^^^^^^ YTT302
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
snapshot_kind: text
--- ---
YTT303.py:4:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` YTT303.py:4:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info`
| |
@ -16,5 +17,3 @@ YTT303.py:5:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_
5 | print(version[:1]) 5 | print(version[:1])
| ^^^^^^^ YTT303 | ^^^^^^^ YTT303
| |

View file

@ -1,4 +1,5 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
allow_overload.py:29:9: ANN201 Missing return type annotation for public function `bar` allow_overload.py:29:9: ANN201 Missing return type annotation for public function `bar`
| |
@ -9,5 +10,3 @@ allow_overload.py:29:9: ANN201 Missing return type annotation for public functio
30 | return i 30 | return i
| |
= help: Add return type annotation = help: Add return type annotation

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
allow_star_arg_any.py:10:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` allow_star_arg_any.py:10:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a`
| |
@ -32,5 +33,3 @@ allow_star_arg_any.py:44:67: ANN401 Dynamically typed expressions (typing.Any) a
| ^^^ ANN401 | ^^^ ANN401
45 | pass 45 | pass
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
auto_return_type.py:1:5: ANN201 [*] Missing return type annotation for public function `func` auto_return_type.py:1:5: ANN201 [*] Missing return type annotation for public function `func`
| |
@ -768,5 +769,3 @@ auto_return_type.py:299:5: ANN201 [*] Missing return type annotation for public
300 300 | match x: 300 300 | match x:
301 301 | case [1, 2, 3]: 301 301 | case [1, 2, 3]:
302 302 | return 1 302 302 | return 1

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
auto_return_type.py:1:5: ANN201 [*] Missing return type annotation for public function `func` auto_return_type.py:1:5: ANN201 [*] Missing return type annotation for public function `func`
| |
@ -872,5 +873,3 @@ auto_return_type.py:299:5: ANN201 [*] Missing return type annotation for public
300 300 | match x: 300 300 | match x:
301 301 | case [1, 2, 3]: 301 301 | case [1, 2, 3]:
302 302 | return 1 302 302 | return 1

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
annotation_presence.py:5:5: ANN201 [*] Missing return type annotation for public function `foo` annotation_presence.py:5:5: ANN201 [*] Missing return type annotation for public function `foo`
| |
@ -332,5 +333,3 @@ annotation_presence.py:165:18: ANN101 Missing type annotation for `self` in meth
| ^^^^ ANN101 | ^^^^ ANN101
166 | print(f"{self.attr=}") 166 | print(f"{self.attr=}")
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
ignore_fully_untyped.py:24:5: ANN201 [*] Missing return type annotation for public function `error_partially_typed_1` ignore_fully_untyped.py:24:5: ANN201 [*] Missing return type annotation for public function `error_partially_typed_1`
| |
@ -68,5 +69,3 @@ ignore_fully_untyped.py:43:9: ANN201 [*] Missing return type annotation for publ
43 |- def error_typed_self(self: X): 43 |- def error_typed_self(self: X):
43 |+ def error_typed_self(self: X) -> None: 43 |+ def error_typed_self(self: X) -> None:
44 44 | pass 44 44 | pass

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special method `__init__` mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special method `__init__`
| |
@ -77,5 +78,3 @@ mypy_init_return.py:47:9: ANN204 [*] Missing return type annotation for special
47 |- def __init__(self, *arg): 47 |- def __init__(self, *arg):
47 |+ def __init__(self, *arg) -> None: 47 |+ def __init__(self, *arg) -> None:
48 48 | ... 48 48 | ...

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__` simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__`
| |
@ -275,5 +276,3 @@ simple_magic_methods.py:41:9: ANN204 [*] Missing return type annotation for spec
41 |- def __index__(self): 41 |- def __index__(self):
41 |+ def __index__(self) -> int: 41 |+ def __index__(self) -> int:
42 42 | ... 42 42 | ...

View file

@ -1,4 +1,5 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
snapshot_kind: text
--- ---
suppress_none_returning.py:45:5: ANN201 [*] Missing return type annotation for public function `foo` suppress_none_returning.py:45:5: ANN201 [*] Missing return type annotation for public function `foo`
| |
@ -47,5 +48,3 @@ suppress_none_returning.py:59:9: ANN001 Missing type annotation for function arg
| ^ ANN001 | ^ ANN001
60 | a = 2 + 2 60 | a = 2 + 2
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC100.py:8:5: ASYNC100 A `with trio.fail_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. ASYNC100.py:8:5: ASYNC100 A `with trio.fail_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint.
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC105.py:30:5: ASYNC105 [*] Call to `trio.aclose_forcefully` is not immediately awaited ASYNC105.py:30:5: ASYNC105 [*] Call to `trio.aclose_forcefully` is not immediately awaited
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC109_0.py:8:16: ASYNC109 Async function definition with a `timeout` parameter ASYNC109_0.py:8:16: ASYNC109 Async function definition with a `timeout` parameter
| |

View file

@ -1,4 +1,5 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC109_0.py:8:16: ASYNC109 Async function definition with a `timeout` parameter ASYNC109_0.py:8:16: ASYNC109 Async function definition with a `timeout` parameter
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC109_1.py:5:16: ASYNC109 Async function definition with a `timeout` parameter ASYNC109_1.py:5:16: ASYNC109 Async function definition with a `timeout` parameter
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC110.py:7:5: ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop ASYNC110.py:7:5: ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC115.py:5:11: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)` ASYNC115.py:5:11: ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC116.py:11:11: ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep_forever()` ASYNC116.py:11:11: ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep_forever()`
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC210.py:8:5: ASYNC210 Async functions should not call blocking HTTP methods ASYNC210.py:8:5: ASYNC210 Async functions should not call blocking HTTP methods
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC22x.py:31:5: ASYNC220 Async functions should not create subprocesses with blocking methods ASYNC22x.py:31:5: ASYNC220 Async functions should not create subprocesses with blocking methods
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC22x.py:8:5: ASYNC221 Async functions should not run processes with blocking methods ASYNC22x.py:8:5: ASYNC221 Async functions should not run processes with blocking methods
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC22x.py:20:5: ASYNC222 Async functions should not wait on processes with blocking methods ASYNC22x.py:20:5: ASYNC222 Async functions should not wait on processes with blocking methods
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC230.py:6:5: ASYNC230 Async functions should not open files with blocking methods like `open` ASYNC230.py:6:5: ASYNC230 Async functions should not open files with blocking methods like `open`
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs source: crates/ruff_linter/src/rules/flake8_async/mod.rs
snapshot_kind: text
--- ---
ASYNC251.py:6:5: ASYNC251 Async functions should not call `time.sleep` ASYNC251.py:6:5: ASYNC251 Async functions should not call `time.sleep`
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S101.py:1:1: S101 Use of `assert` detected S101.py:1:1: S101 Use of `assert` detected
| |
@ -23,5 +24,3 @@ S101.py:7:5: S101 Use of `assert` detected
7 | assert x == 2 # S101 7 | assert x == 2 # S101
| ^^^^^^ S101 | ^^^^^^ S101
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S102.py:3:5: S102 Use of `exec` detected S102.py:3:5: S102 Use of `exec` detected
| |
@ -18,5 +19,3 @@ S102.py:5:1: S102 Use of `exec` detected
5 | exec('y = 3') 5 | exec('y = 3')
| ^^^^ S102 | ^^^^ S102
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S103.py:6:25: S103 `os.chmod` setting a permissive mask `0o227` on file or directory S103.py:6:25: S103 `os.chmod` setting a permissive mask `0o227` on file or directory
| |
@ -136,5 +137,3 @@ S103.py:23:25: S103 `os.chmod` setting an invalid mask on file or directory
23 | os.chmod("/etc/passwd", 0o100000000) # Error 23 | os.chmod("/etc/passwd", 0o100000000) # Error
| ^^^^^^^^^^^ S103 | ^^^^^^^^^^^ S103
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S104.py:9:1: S104 Possible binding to all interfaces S104.py:9:1: S104 Possible binding to all interfaces
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S105.py:13:12: S105 Possible hardcoded password assigned to: "password" S105.py:13:12: S105 Possible hardcoded password assigned to: "password"
| |
@ -373,5 +374,3 @@ S105.py:64:13: S105 Possible hardcoded password assigned to: "token"
| ^^^^^^ S105 | ^^^^^^ S105
65 | pass 65 | pass
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S106.py:14:9: S106 Possible hardcoded password assigned to argument: "password" S106.py:14:9: S106 Possible hardcoded password assigned to argument: "password"
| |
@ -7,5 +8,3 @@ S106.py:14:9: S106 Possible hardcoded password assigned to argument: "password"
14 | func(1, password="s3cr3t") 14 | func(1, password="s3cr3t")
| ^^^^^^^^^^^^^^^^^ S106 | ^^^^^^^^^^^^^^^^^ S106
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S107.py:5:29: S107 Possible hardcoded password assigned to function default: "password" S107.py:5:29: S107 Possible hardcoded password assigned to function default: "password"
| |
@ -35,5 +36,3 @@ S107.py:29:62: S107 Possible hardcoded password assigned to function default: "p
| ^^^^^^^^ S107 | ^^^^^^^^ S107
30 | pass 30 | pass
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc"
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
| |
@ -22,5 +23,3 @@ S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception
10 | 10 |
11 | try: 11 | try:
| |

View file

@ -1,5 +1,6 @@
--- ---
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
snapshot_kind: text
--- ---
S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
| |
@ -31,5 +32,3 @@ S110.py:13:1: S110 `try`-`except`-`pass` detected, consider logging the exceptio
14 | | pass 14 | | pass
| |________^ S110 | |________^ S110
| |

Some files were not shown because too many files have changed in this diff Show more