-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a8e5f7
commit 8e8a334
Showing
8 changed files
with
256 additions
and
27 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
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
138 changes: 138 additions & 0 deletions
138
...ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap.new
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,138 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_raise/mod.rs | ||
assertion_line: 23 | ||
--- | ||
RSE102.py:5:21: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
3 | except TypeError: | ||
4 | # RSE102 | ||
5 | raise ValueError() | ||
| ^^ RSE102 | ||
6 | | ||
7 | try: | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
2 2 | y = 6 + "7" | ||
3 3 | except TypeError: | ||
4 4 | # RSE102 | ||
5 |- raise ValueError() | ||
5 |+ raise ValueError | ||
6 6 | | ||
7 7 | try: | ||
8 8 | x = 1 / 0 | ||
|
||
RSE102.py:13:16: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
12 | # RSE102 | ||
13 | raise TypeError() | ||
| ^^ RSE102 | ||
14 | | ||
15 | # RSE102 | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
10 10 | raise | ||
11 11 | | ||
12 12 | # RSE102 | ||
13 |-raise TypeError() | ||
13 |+raise TypeError | ||
14 14 | | ||
15 15 | # RSE102 | ||
16 16 | raise TypeError () | ||
|
||
RSE102.py:16:17: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
15 | # RSE102 | ||
16 | raise TypeError () | ||
| ^^ RSE102 | ||
17 | | ||
18 | # RSE102 | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
13 13 | raise TypeError() | ||
14 14 | | ||
15 15 | # RSE102 | ||
16 |-raise TypeError () | ||
16 |+raise TypeError | ||
17 17 | | ||
18 18 | # RSE102 | ||
19 19 | raise TypeError \ | ||
|
||
RSE102.py:20:5: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
18 | # RSE102 | ||
19 | raise TypeError \ | ||
20 | () | ||
| ^^ RSE102 | ||
21 | | ||
22 | # RSE102 | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
16 16 | raise TypeError () | ||
17 17 | | ||
18 18 | # RSE102 | ||
19 |-raise TypeError \ | ||
20 |- () | ||
19 |+raise TypeError | ||
21 20 | | ||
22 21 | # RSE102 | ||
23 22 | raise TypeError( | ||
|
||
RSE102.py:23:16: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
22 | # RSE102 | ||
23 | raise TypeError( | ||
| ________________^ | ||
24 | | | ||
25 | | ) | ||
| |_^ RSE102 | ||
26 | | ||
27 | # RSE102 | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
20 20 | () | ||
21 21 | | ||
22 22 | # RSE102 | ||
23 |-raise TypeError( | ||
24 |- | ||
25 |-) | ||
23 |+raise TypeError | ||
26 24 | | ||
27 25 | # RSE102 | ||
28 26 | raise TypeError( | ||
|
||
RSE102.py:28:16: RSE102 [*] Unnecessary parentheses on raised exception | ||
| | ||
27 | # RSE102 | ||
28 | raise TypeError( | ||
| ________________^ | ||
29 | | # Hello, world! | ||
30 | | ) | ||
| |_^ RSE102 | ||
31 | | ||
32 | # OK | ||
| | ||
= help: Remove unnecessary parentheses | ||
|
||
ℹ Fix | ||
25 25 | ) | ||
26 26 | | ||
27 27 | # RSE102 | ||
28 |-raise TypeError( | ||
29 |- # Hello, world! | ||
30 |-) | ||
28 |+raise TypeError | ||
31 29 | | ||
32 30 | # OK | ||
33 31 | raise AssertionError | ||
|
||
|
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