Update analyze_graph.rs

This commit is contained in:
Dan 2025-11-16 13:11:35 -05:00
parent 0ee00edcdf
commit 2cc5cb708a

View file

@ -27,43 +27,43 @@ fn type_checking_imports() -> anyhow::Result<()> {
("ruff/c.py", ""), ("ruff/c.py", ""),
])?; ])?;
assert_cmd_snapshot!(test.analyze_graph_command(), @r###" assert_cmd_snapshot!(test.analyze_graph_command(), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
{ {
"ruff/__init__.py": [], "ruff\/__init__.py": [],
"ruff/a.py": [ "ruff\\a.py": [
"ruff/b.py", "ruff\\b.py",
"ruff/c.py" "ruff\\c.py"
], ],
"ruff/b.py": [ "ruff\\b.py": [
"ruff/c.py" "ruff\\c.py"
], ],
"ruff/c.py": [] "ruff\\c.py": []
} }
----- stderr ----- ----- stderr -----
"###); "#);
assert_cmd_snapshot!( assert_cmd_snapshot!(
test.analyze_graph_command() test.analyze_graph_command()
.arg("--no-type-checking-imports"), .arg("--no-type-checking-imports"),
@r###" @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
{ {
"ruff/__init__.py": [], "ruff\/__init__.py": [],
"ruff/a.py": [ "ruff\\a.py": [
"ruff/b.py" "ruff\\b.py"
], ],
"ruff/b.py": [], "ruff\\b.py": [],
"ruff/c.py": [] "ruff\\c.py": []
} }
----- stderr ----- ----- stderr -----
"### "#
); );
Ok(()) Ok(())
@ -101,21 +101,21 @@ fn type_checking_imports_from_config() -> anyhow::Result<()> {
), ),
])?; ])?;
assert_cmd_snapshot!(test.analyze_graph_command(), @r###" assert_cmd_snapshot!(test.analyze_graph_command(), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
{ {
"ruff/__init__.py": [], "ruff\/__init__.py": [],
"ruff/a.py": [ "ruff\\a.py": [
"ruff/b.py" "ruff\\b.py"
], ],
"ruff/b.py": [], "ruff\\b.py": [],
"ruff/c.py": [] "ruff\\c.py": []
} }
----- stderr ----- ----- stderr -----
"###); "#);
test.write_file( test.write_file(
"ruff.toml", "ruff.toml",
@ -125,24 +125,24 @@ fn type_checking_imports_from_config() -> anyhow::Result<()> {
"#, "#,
)?; )?;
assert_cmd_snapshot!(test.analyze_graph_command(), @r###" assert_cmd_snapshot!(test.analyze_graph_command(), @r#"
success: true success: true
exit_code: 0 exit_code: 0
----- stdout ----- ----- stdout -----
{ {
"ruff/__init__.py": [], "ruff\/__init__.py": [],
"ruff/a.py": [ "ruff\\a.py": [
"ruff/b.py", "ruff\\b.py",
"ruff/c.py" "ruff\\c.py"
], ],
"ruff/b.py": [ "ruff\\b.py": [
"ruff/c.py" "ruff\\c.py"
], ],
"ruff/c.py": [] "ruff\\c.py": []
} }
----- stderr ----- ----- stderr -----
"### "#
); );
Ok(()) Ok(())