-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
30 additions
and
30 deletions.
There are no files selected for viewing
File renamed without changes.
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
50 changes: 24 additions & 26 deletions
50
..._tests__useless-try-except_TRY302.py.snap → ..._tests__useless-try-except_TRY203.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 |
---|---|---|
@@ -1,150 +1,148 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/tryceratops/mod.rs | ||
--- | ||
TRY302.py:12:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:12:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
10 | try: | ||
11 | process() | ||
12 | except Exception: | ||
| _____^ | ||
13 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
14 | | ||
15 | def bad(): | ||
| | ||
|
||
TRY302.py:18:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:18:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
16 | try: | ||
17 | process() | ||
18 | except Exception: | ||
| _____^ | ||
19 | | raise | ||
20 | | print("this code is pointless!") | ||
| |________________________________________^ TRY302 | ||
| |________________________________________^ TRY203 | ||
21 | | ||
22 | def bad(): | ||
| | ||
|
||
TRY302.py:25:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:25:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
23 | try: | ||
24 | process() | ||
25 | except: | ||
| _____^ | ||
26 | | # I am a comment, not a statement! | ||
27 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
28 | | ||
29 | def bad(): | ||
| | ||
|
||
TRY302.py:32:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:32:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
30 | try: | ||
31 | process() | ||
32 | except Exception: | ||
| _____^ | ||
33 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
34 | | ||
35 | def bad(): | ||
| | ||
|
||
TRY302.py:38:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:38:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
36 | try: | ||
37 | process() | ||
38 | except Exception as e: | ||
| _____^ | ||
39 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
40 | | ||
41 | def bad(): | ||
| | ||
|
||
TRY302.py:44:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:44:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
42 | try: | ||
43 | process() | ||
44 | except Exception as e: | ||
| _____^ | ||
45 | | raise e | ||
| |_______________^ TRY302 | ||
| |_______________^ TRY203 | ||
46 | | ||
47 | def bad(): | ||
| | ||
|
||
TRY302.py:50:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:50:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
48 | try: | ||
49 | process() | ||
50 | except MyException: | ||
| _____^ | ||
51 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
52 | except Exception: | ||
53 | raise | ||
| | ||
|
||
TRY302.py:52:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:52:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
50 | except MyException: | ||
51 | raise | ||
52 | except Exception: | ||
| _____^ | ||
53 | | raise | ||
| |_____________^ TRY302 | ||
| |_____________^ TRY203 | ||
54 | | ||
55 | def bad(): | ||
| | ||
|
||
TRY302.py:58:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:58:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
56 | try: | ||
57 | process() | ||
58 | except MyException as e: | ||
| _____^ | ||
59 | | raise e | ||
| |_______________^ TRY302 | ||
| |_______________^ TRY203 | ||
60 | except Exception as e: | ||
61 | raise e | ||
| | ||
|
||
TRY302.py:60:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:60:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
58 | except MyException as e: | ||
59 | raise e | ||
60 | except Exception as e: | ||
| _____^ | ||
61 | | raise e | ||
| |_______________^ TRY302 | ||
| |_______________^ TRY203 | ||
62 | | ||
63 | def bad(): | ||
| | ||
|
||
TRY302.py:66:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:66:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
64 | try: | ||
65 | process() | ||
66 | except MyException as ex: | ||
| _____^ | ||
67 | | raise ex | ||
| |________________^ TRY302 | ||
| |________________^ TRY203 | ||
68 | except Exception as e: | ||
69 | raise e | ||
| | ||
|
||
TRY302.py:68:5: TRY302 Remove exception handler; error is immediately re-raised | ||
TRY203.py:68:5: TRY203 Remove exception handler; error is immediately re-raised | ||
| | ||
66 | except MyException as ex: | ||
67 | raise ex | ||
68 | except Exception as e: | ||
| _____^ | ||
69 | | raise e | ||
| |_______________^ TRY302 | ||
| |_______________^ TRY203 | ||
70 | | ||
71 | def fine(): | ||
| | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.