Skip to content

Commit 67f231c

Browse files
committed
t-strings are not native literals
1 parent e9dd5f2 commit 67f231c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

crates/ruff_linter/resources/test/fixtures/pyupgrade/UP018.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,7 @@
9090
int(1)and None
9191
float(1.)and None
9292
bool(True)and()
93+
94+
95+
# t-strings are not native literals
96+
str(t"hey")

crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018.py.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ UP018.py:90:1: UP018 [*] Unnecessary `int` call (rewrite as a literal)
660660
90 |+1 and None
661661
91 91 | float(1.)and None
662662
92 92 | bool(True)and()
663+
93 93 |
663664

664665
UP018.py:91:1: UP018 [*] Unnecessary `float` call (rewrite as a literal)
665666
|
@@ -678,6 +679,8 @@ UP018.py:91:1: UP018 [*] Unnecessary `float` call (rewrite as a literal)
678679
91 |-float(1.)and None
679680
91 |+1. and None
680681
92 92 | bool(True)and()
682+
93 93 |
683+
94 94 |
681684

682685
UP018.py:92:1: UP018 [*] Unnecessary `bool` call (rewrite as a literal)
683686
|
@@ -694,3 +697,6 @@ UP018.py:92:1: UP018 [*] Unnecessary `bool` call (rewrite as a literal)
694697
91 91 | float(1.)and None
695698
92 |-bool(True)and()
696699
92 |+True and()
700+
93 93 |
701+
94 94 |
702+
95 95 | # t-strings are not native literals

0 commit comments

Comments
 (0)