diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs index 79e6ba61a776e8..94113af9fd9367 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs @@ -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) diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap index 4c065291fd825c..ebbbebba5ce059 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap @@ -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(): @@ -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(): diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap index 96752937fb791e..f1426067804567 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap @@ -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(): @@ -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(): @@ -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: @@ -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 | @@ -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."""