-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark quotes as unnecessary for non-evaluated annotations
- Loading branch information
1 parent
b0731ef
commit 2876c33
Showing
8 changed files
with
88 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP037_1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from typing import Tuple | ||
|
||
|
||
def foo(): | ||
# UP037 | ||
x: "Tuple[int, int]" = (0, 0) | ||
print(x) | ||
|
||
|
||
# OK | ||
X: "Tuple[int, int]" = (0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...inter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_1.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs | ||
--- | ||
UP037_1.py:9:8: UP037 [*] Remove quotes from type annotation | ||
| | ||
7 | def foo(): | ||
8 | # UP037 | ||
9 | x: "Tuple[int, int]" = (0, 0) | ||
| ^^^^^^^^^^^^^^^^^ UP037 | ||
10 | print(x) | ||
| | ||
= help: Remove quotes | ||
|
||
ℹ Safe fix | ||
6 6 | | ||
7 7 | def foo(): | ||
8 8 | # UP037 | ||
9 |- x: "Tuple[int, int]" = (0, 0) | ||
9 |+ x: Tuple[int, int] = (0, 0) | ||
10 10 | print(x) | ||
11 11 | | ||
12 12 | |