Skip to content

Commit

Permalink
Tweak message
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 21, 2024
1 parent bb001ed commit 3b9570d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
useless_else_on_loop.py:9:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:9:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
7 | if i % 2:
8 | return i
Expand All @@ -10,9 +10,9 @@ useless_else_on_loop.py:9:5: PLW0120 `else` clause on loop without a `break` sta
10 | print("math is broken")
11 | return None
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:18:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:18:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
16 | while True:
17 | return 1
Expand All @@ -21,29 +21,29 @@ useless_else_on_loop.py:18:5: PLW0120 `else` clause on loop without a `break` st
19 | print("math is broken")
20 | return None
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:30:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:30:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
28 | break
29 |
30 | else: # [useless-else-on-loop]
| ^^^^ PLW0120
31 | print("or else!")
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:37:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:37:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
35 | while False:
36 | break
37 | else: # [useless-else-on-loop]
| ^^^^ PLW0120
38 | print("or else!")
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:42:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:42:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
40 | for j in range(10):
41 | pass
Expand All @@ -52,9 +52,9 @@ useless_else_on_loop.py:42:1: PLW0120 `else` clause on loop without a `break` st
43 | print("fat chance")
44 | for j in range(10):
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:88:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:88:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
86 | else:
87 | print("all right")
Expand All @@ -63,9 +63,9 @@ useless_else_on_loop.py:88:5: PLW0120 `else` clause on loop without a `break` st
89 | return True
90 | return False
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:98:9: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:98:9: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
96 | for _ in range(3):
97 | pass
Expand All @@ -74,9 +74,9 @@ useless_else_on_loop.py:98:9: PLW0120 `else` clause on loop without a `break` st
99 | if 1 < 2: # pylint: disable=comparison-of-constants
100 | break
|
= help: Remove redundant `else` clause
= help: Remove `else`

useless_else_on_loop.py:144:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:144:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
142 | for j in range(10):
143 | pass
Expand All @@ -85,6 +85,6 @@ useless_else_on_loop.py:144:5: PLW0120 `else` clause on loop without a `break` s
145 | # [useless-else-on-loop]
146 | print("fat chance")
|
= help: Remove redundant `else` clause
= help: Remove `else`


Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
useless_else_on_loop.py:9:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:9:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
7 | if i % 2:
8 | return i
Expand All @@ -10,7 +10,7 @@ useless_else_on_loop.py:9:5: PLW0120 [*] `else` clause on loop without a `break`
10 | print("math is broken")
11 | return None
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
6 6 | for i in range(10):
Expand All @@ -23,7 +23,7 @@ useless_else_on_loop.py:9:5: PLW0120 [*] `else` clause on loop without a `break`
12 11 |
13 12 |

useless_else_on_loop.py:18:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:18:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
16 | while True:
17 | return 1
Expand All @@ -32,7 +32,7 @@ useless_else_on_loop.py:18:5: PLW0120 [*] `else` clause on loop without a `break
19 | print("math is broken")
20 | return None
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
15 15 | """else + return is not acceptable."""
Expand All @@ -45,15 +45,15 @@ useless_else_on_loop.py:18:5: PLW0120 [*] `else` clause on loop without a `break
21 20 |
22 21 |

useless_else_on_loop.py:30:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:30:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
28 | break
29 |
30 | else: # [useless-else-on-loop]
| ^^^^ PLW0120
31 | print("or else!")
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
27 27 | for _ in range(10):
Expand All @@ -66,15 +66,15 @@ useless_else_on_loop.py:30:1: PLW0120 [*] `else` clause on loop without a `break
33 32 |
34 33 | while True:

useless_else_on_loop.py:37:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:37:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
35 | while False:
36 | break
37 | else: # [useless-else-on-loop]
| ^^^^ PLW0120
38 | print("or else!")
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
34 34 | while True:
Expand All @@ -87,7 +87,7 @@ useless_else_on_loop.py:37:1: PLW0120 [*] `else` clause on loop without a `break
40 39 | for j in range(10):
41 40 | pass

useless_else_on_loop.py:42:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:42:1: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
40 | for j in range(10):
41 | pass
Expand All @@ -96,7 +96,7 @@ useless_else_on_loop.py:42:1: PLW0120 [*] `else` clause on loop without a `break
43 | print("fat chance")
44 | for j in range(10):
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
39 39 |
Expand All @@ -113,7 +113,7 @@ useless_else_on_loop.py:42:1: PLW0120 [*] `else` clause on loop without a `break
47 46 |
48 47 | def test_return_for2():

useless_else_on_loop.py:88:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:88:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
86 | else:
87 | print("all right")
Expand All @@ -122,7 +122,7 @@ useless_else_on_loop.py:88:5: PLW0120 [*] `else` clause on loop without a `break
89 | return True
90 | return False
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
85 85 | break
Expand All @@ -135,7 +135,7 @@ useless_else_on_loop.py:88:5: PLW0120 [*] `else` clause on loop without a `break
91 90 |
92 91 |

useless_else_on_loop.py:98:9: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:98:9: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
96 | for _ in range(3):
97 | pass
Expand All @@ -144,7 +144,7 @@ useless_else_on_loop.py:98:9: PLW0120 [*] `else` clause on loop without a `break
99 | if 1 < 2: # pylint: disable=comparison-of-constants
100 | break
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
95 95 | for _ in range(10):
Expand All @@ -159,7 +159,7 @@ useless_else_on_loop.py:98:9: PLW0120 [*] `else` clause on loop without a `break
102 101 | return True
103 102 | return False

useless_else_on_loop.py:144:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
useless_else_on_loop.py:144:5: PLW0120 [*] `else` clause on loop without a `break` statement; remove the `else` and dedent its contents
|
142 | for j in range(10):
143 | pass
Expand All @@ -168,7 +168,7 @@ useless_else_on_loop.py:144:5: PLW0120 [*] `else` clause on loop without a `brea
145 | # [useless-else-on-loop]
146 | print("fat chance")
|
= help: Remove redundant `else` clause
= help: Remove `else`

Safe fix
141 141 | """Retain the comment within the `else` block"""
Expand Down

0 comments on commit 3b9570d

Please sign in to comment.