Skip to content

Commit

Permalink
Mark unaliased-collections-abc-set-import fix as safe
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 29, 2024
1 parent 0045032 commit ef151af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub(crate) fn unaliased_collections_abc_set_import(
diagnostic.try_set_fix(|| {
let scope = &checker.semantic().scopes[binding.scope];
let (edit, rest) = Renamer::rename(name, "AbstractSet", scope, checker.semantic())?;
Ok(Fix::unsafe_edits(edit, rest))
Ok(Fix::safe_edits(edit, rest))
});
}
Some(diagnostic)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PYI025.py:10:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet`
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
7 7 |
8 8 |
9 9 | def f():
Expand All @@ -29,7 +29,7 @@ PYI025.py:14:51: PYI025 [*] Use `from collections.abc import Set as AbstractSet`
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
11 11 |
12 12 |
13 13 | def f():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PYI025.pyi:8:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet`
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
5 5 | from collections.abc import Container, Sized, Set as AbstractSet, ValuesView # Ok
6 6 |
7 7 | def f():
Expand All @@ -31,7 +31,7 @@ PYI025.pyi:11:51: PYI025 [*] Use `from collections.abc import Set as AbstractSet
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
8 8 | from collections.abc import Set # PYI025
9 9 |
10 10 | def f():
Expand All @@ -52,7 +52,7 @@ PYI025.pyi:16:37: PYI025 [*] Use `from collections.abc import Set as AbstractSet
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
13 13 | def f():
14 14 | """Test: local symbol renaming."""
15 15 | if True:
Expand Down Expand Up @@ -87,7 +87,7 @@ PYI025.pyi:33:29: PYI025 [*] Use `from collections.abc import Set as AbstractSet
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
17 17 | else:
18 18 | Set = 1
19 19 |
Expand Down Expand Up @@ -130,7 +130,7 @@ PYI025.pyi:44:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet
|
= help: Alias `Set` to `AbstractSet`

Unsafe fix
Safe fix
41 41 |
42 42 | def f():
43 43 | """Test: nonlocal symbol renaming."""
Expand Down

0 comments on commit ef151af

Please sign in to comment.