5FRUf>B*}q}>0}%0BlHWMkUHNs%2({a_b>M&UP
z1ZDxbh8Qe$madvs9R^GNrUm30VzAVOx@uZ=7%cUs7LaR*!BWTSs%h0>u=HWh0&)!z
m*eDEXh2ZLG>QGr)dl?|-2$iM9m$RoSL}h99Wq_QcPWB7qT#MiU
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E701_E70.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E701_E70.py.snap
index a4bf3aaaf1..dcbcaa47a5 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E701_E70.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E701_E70.py.snap
@@ -1,142 +1,155 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E70.py:2:5: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:2:5
|
1 | #: E701:1:5
2 | if a: a = False
- | ^ E701
+ | ^
3 | #: E701:1:40
4 | if not header or header[:6] != 'bytes=': return
|
-E70.py:4:40: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:4:40
|
2 | if a: a = False
3 | #: E701:1:40
4 | if not header or header[:6] != 'bytes=': return
- | ^ E701
+ | ^
5 | #: E702:1:10
6 | a = False; b = True
|
-E70.py:25:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:25:8
|
23 | def f(x): return 2*x
24 | #: E704:1:8 E702:1:11 E703:1:14
25 | if True: x; y;
- | ^ E701
+ | ^
26 | #: E701:1:8
27 | if True: lambda a: b
|
-E70.py:27:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:27:8
|
25 | if True: x; y;
26 | #: E701:1:8
27 | if True: lambda a: b
- | ^ E701
+ | ^
28 | #: E701:1:10
29 | if a := 1: pass
|
-E70.py:29:10: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:29:10
|
27 | if True: lambda a: b
28 | #: E701:1:10
29 | if a := 1: pass
- | ^ E701
+ | ^
30 | # E701:1:4 E701:2:18 E701:3:8
31 | try: lambda foo: bar
|
-E70.py:31:4: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:31:4
|
29 | if a := 1: pass
30 | # E701:1:4 E701:2:18 E701:3:8
31 | try: lambda foo: bar
- | ^ E701
+ | ^
32 | except ValueError: pass
33 | finally: pass
|
-E70.py:32:18: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:32:18
|
30 | # E701:1:4 E701:2:18 E701:3:8
31 | try: lambda foo: bar
32 | except ValueError: pass
- | ^ E701
+ | ^
33 | finally: pass
34 | # E701:1:7
|
-E70.py:33:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:33:8
|
31 | try: lambda foo: bar
32 | except ValueError: pass
33 | finally: pass
- | ^ E701
+ | ^
34 | # E701:1:7
35 | class C: pass
|
-E70.py:35:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:35:8
|
33 | finally: pass
34 | # E701:1:7
35 | class C: pass
- | ^ E701
+ | ^
36 | # E701:1:7
37 | with C(): pass
|
-E70.py:37:9: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:37:9
|
35 | class C: pass
36 | # E701:1:7
37 | with C(): pass
- | ^ E701
+ | ^
38 | # E701:1:14
39 | async with C(): pass
|
-E70.py:39:15: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:39:15
|
37 | with C(): pass
38 | # E701:1:14
39 | async with C(): pass
- | ^ E701
+ | ^
40 | #:
41 | lambda a: b
|
-E70.py:54:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:54:8
|
52 | def f(): ...
53 | #: E701:1:8 E702:1:13
54 | class C: ...; x = 1
- | ^ E701
+ | ^
55 | #: E701:1:8 E702:1:13
56 | class C: ...; ...
|
-E70.py:56:8: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:56:8
|
54 | class C: ...; x = 1
55 | #: E701:1:8 E702:1:13
56 | class C: ...; ...
- | ^ E701
+ | ^
57 | #: E701:2:12
58 | match *0, 1, *2:
|
-E70.py:59:12: E701 Multiple statements on one line (colon)
+E701 Multiple statements on one line (colon)
+ --> E70.py:59:12
|
57 | #: E701:2:12
58 | match *0, 1, *2:
59 | case 0,: y = 0
- | ^ E701
+ | ^
60 | #:
61 | class Foo:
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E702_E70.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E702_E70.py.snap
index d3232a1b9c..272b2e4550 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E702_E70.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E702_E70.py.snap
@@ -1,73 +1,79 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E70.py:6:10: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:6:10
|
4 | if not header or header[:6] != 'bytes=': return
5 | #: E702:1:10
6 | a = False; b = True
- | ^ E702
+ | ^
7 | #: E702:1:17
8 | import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
|
-E70.py:8:17: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:8:17
|
6 | a = False; b = True
7 | #: E702:1:17
8 | import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
- | ^ E702
+ | ^
9 | #: E703:1:13
10 | import shlex;
|
-E70.py:12:9: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:12:9
|
10 | import shlex;
11 | #: E702:1:9 E703:1:23
12 | del a[:]; a.append(42);
- | ^ E702
+ | ^
13 | #: E704:1:1
14 | def f(x): return 2
|
-E70.py:25:11: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:25:11
|
23 | def f(x): return 2*x
24 | #: E704:1:8 E702:1:11 E703:1:14
25 | if True: x; y;
- | ^ E702
+ | ^
26 | #: E701:1:8
27 | if True: lambda a: b
|
-E70.py:54:13: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:54:13
|
52 | def f(): ...
53 | #: E701:1:8 E702:1:13
54 | class C: ...; x = 1
- | ^ E702
+ | ^
55 | #: E701:1:8 E702:1:13
56 | class C: ...; ...
|
-E70.py:56:13: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:56:13
|
54 | class C: ...; x = 1
55 | #: E701:1:8 E702:1:13
56 | class C: ...; ...
- | ^ E702
+ | ^
57 | #: E701:2:12
58 | match *0, 1, *2:
|
-E70.py:65:4: E702 Multiple statements on one line (semicolon)
+E702 Multiple statements on one line (semicolon)
+ --> E70.py:65:4
|
63 | #: E702:2:4
64 | while 1:
65 | 1;...
- | ^ E702
+ | ^
66 | #: E703:2:1
67 | 0\
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E70.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E70.py.snap
index 399f4bfbb5..9b62eb2ee9 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E70.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E70.py.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E70.py:10:13: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E70.py:10:13
|
8 | import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
9 | #: E703:1:13
10 | import shlex;
- | ^ E703
+ | ^
11 | #: E702:1:9 E703:1:23
12 | del a[:]; a.append(42);
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
7 7 | #: E702:1:17
@@ -23,16 +23,17 @@ E70.py:10:13: E703 [*] Statement ends with an unnecessary semicolon
12 12 | del a[:]; a.append(42);
13 13 | #: E704:1:1
-E70.py:12:23: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E70.py:12:23
|
10 | import shlex;
11 | #: E702:1:9 E703:1:23
12 | del a[:]; a.append(42);
- | ^ E703
+ | ^
13 | #: E704:1:1
14 | def f(x): return 2
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
9 9 | #: E703:1:13
@@ -44,16 +45,17 @@ E70.py:12:23: E703 [*] Statement ends with an unnecessary semicolon
14 14 | def f(x): return 2
15 15 | #: E704:1:1
-E70.py:25:14: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E70.py:25:14
|
23 | def f(x): return 2*x
24 | #: E704:1:8 E702:1:11 E703:1:14
25 | if True: x; y;
- | ^ E703
+ | ^
26 | #: E701:1:8
27 | if True: lambda a: b
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
22 22 | while all is round:
@@ -65,16 +67,17 @@ E70.py:25:14: E703 [*] Statement ends with an unnecessary semicolon
27 27 | if True: lambda a: b
28 28 | #: E701:1:10
-E70.py:68:1: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E70.py:68:1
|
66 | #: E703:2:1
67 | 0\
68 | ;
- | ^ E703
+ | ^
69 | #: E701:2:3
70 | a = \
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
64 64 | while 1:
@@ -87,16 +90,17 @@ E70.py:68:1: E703 [*] Statement ends with an unnecessary semicolon
70 69 | a = \
71 70 | 5;
-E70.py:71:4: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E70.py:71:4
|
69 | #: E701:2:3
70 | a = \
71 | 5;
- | ^ E703
+ | ^
72 | #:
73 | with x(y) as z: ...
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
68 68 | ;
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E703.ipynb.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E703.ipynb.snap
index 902265b169..03e8193c87 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E703.ipynb.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E703_E703.ipynb.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E703.ipynb:5:2: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E703.ipynb:5:2
|
3 | x;
4 | # Only skip the last expression
5 | x; # E703
- | ^ E703
+ | ^
6 | x;
7 | # Nested expressions isn't relevant
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
2 2 | # Simple case
@@ -23,16 +23,17 @@ E703.ipynb:5:2: E703 [*] Statement ends with an unnecessary semicolon
7 7 | # Nested expressions isn't relevant
8 8 | if True:
-E703.ipynb:9:6: E703 [*] Statement ends with an unnecessary semicolon
+E703 [*] Statement ends with an unnecessary semicolon
+ --> E703.ipynb:9:6
|
7 | # Nested expressions isn't relevant
8 | if True:
9 | x;
- | ^ E703
+ | ^
10 | # Semicolons with multiple expressions
11 | x; x;
|
- = help: Remove unnecessary semicolon
+help: Remove unnecessary semicolon
ℹ Safe fix
6 6 | x;
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap
index 133712eea9..ea67cff398 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> E711.py:2:11
|
1 | #: E711
2 | if res == None:
- | ^^^^ E711
+ | ^^^^
3 | pass
4 | #: E711
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
1 1 | #: E711
@@ -19,16 +20,17 @@ E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None`
4 4 | #: E711
5 5 | if res != None:
-E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None`
+E711 [*] Comparison to `None` should be `cond is not None`
+ --> E711.py:5:11
|
3 | pass
4 | #: E711
5 | if res != None:
- | ^^^^ E711
+ | ^^^^
6 | pass
7 | #: E711
|
- = help: Replace with `cond is not None`
+help: Replace with `cond is not None`
ℹ Unsafe fix
2 2 | if res == None:
@@ -40,16 +42,17 @@ E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None`
7 7 | #: E711
8 8 | if None == res:
-E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> E711.py:8:4
|
6 | pass
7 | #: E711
8 | if None == res:
- | ^^^^ E711
+ | ^^^^
9 | pass
10 | #: E711
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
5 5 | if res != None:
@@ -61,16 +64,17 @@ E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None`
10 10 | #: E711
11 11 | if None != res:
-E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None`
+E711 [*] Comparison to `None` should be `cond is not None`
+ --> E711.py:11:4
|
9 | pass
10 | #: E711
11 | if None != res:
- | ^^^^ E711
+ | ^^^^
12 | pass
13 | #: E711
|
- = help: Replace with `cond is not None`
+help: Replace with `cond is not None`
ℹ Unsafe fix
8 8 | if None == res:
@@ -82,16 +86,17 @@ E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None`
13 13 | #: E711
14 14 | if res[1] == None:
-E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> E711.py:14:14
|
12 | pass
13 | #: E711
14 | if res[1] == None:
- | ^^^^ E711
+ | ^^^^
15 | pass
16 | #: E711
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
11 11 | if None != res:
@@ -103,16 +108,17 @@ E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None`
16 16 | #: E711
17 17 | if res[1] != None:
-E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None`
+E711 [*] Comparison to `None` should be `cond is not None`
+ --> E711.py:17:14
|
15 | pass
16 | #: E711
17 | if res[1] != None:
- | ^^^^ E711
+ | ^^^^
18 | pass
19 | #: E711
|
- = help: Replace with `cond is not None`
+help: Replace with `cond is not None`
ℹ Unsafe fix
14 14 | if res[1] == None:
@@ -124,16 +130,17 @@ E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None`
19 19 | #: E711
20 20 | if None != res[1]:
-E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None`
+E711 [*] Comparison to `None` should be `cond is not None`
+ --> E711.py:20:4
|
18 | pass
19 | #: E711
20 | if None != res[1]:
- | ^^^^ E711
+ | ^^^^
21 | pass
22 | #: E711
|
- = help: Replace with `cond is not None`
+help: Replace with `cond is not None`
ℹ Unsafe fix
17 17 | if res[1] != None:
@@ -145,15 +152,16 @@ E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None`
22 22 | #: E711
23 23 | if None == res[1]:
-E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> E711.py:23:4
|
21 | pass
22 | #: E711
23 | if None == res[1]:
- | ^^^^ E711
+ | ^^^^
24 | pass
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
20 20 | if None != res[1]:
@@ -165,15 +173,16 @@ E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None`
25 25 |
26 26 | if x == None != None:
-E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> E711.py:26:9
|
24 | pass
25 |
26 | if x == None != None:
- | ^^^^ E711
+ | ^^^^
27 | pass
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
23 23 | if None == res[1]:
@@ -185,15 +194,16 @@ E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None`
28 28 |
29 29 | #: Okay
-E711.py:26:17: E711 [*] Comparison to `None` should be `cond is not None`
+E711 [*] Comparison to `None` should be `cond is not None`
+ --> E711.py:26:17
|
24 | pass
25 |
26 | if x == None != None:
- | ^^^^ E711
+ | ^^^^
27 | pass
|
- = help: Replace with `cond is not None`
+help: Replace with `cond is not None`
ℹ Unsafe fix
23 23 | if None == res[1]:
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap
index b540850623..502c3b1e2c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E712.py:2:4: E712 [*] Avoid equality comparisons to `True`; use `res:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `res:` for truth checks
+ --> E712.py:2:4
|
1 | #: E712
2 | if res == True:
- | ^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^
3 | pass
4 | #: E712
|
- = help: Replace with `res`
+help: Replace with `res`
ℹ Unsafe fix
1 1 | #: E712
@@ -19,16 +20,17 @@ E712.py:2:4: E712 [*] Avoid equality comparisons to `True`; use `res:` for truth
4 4 | #: E712
5 5 | if res != False:
-E712.py:5:4: E712 [*] Avoid inequality comparisons to `False`; use `res:` for truth checks
+E712 [*] Avoid inequality comparisons to `False`; use `res:` for truth checks
+ --> E712.py:5:4
|
3 | pass
4 | #: E712
5 | if res != False:
- | ^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^
6 | pass
7 | #: E712
|
- = help: Replace with `res`
+help: Replace with `res`
ℹ Unsafe fix
2 2 | if res == True:
@@ -40,16 +42,17 @@ E712.py:5:4: E712 [*] Avoid inequality comparisons to `False`; use `res:` for tr
7 7 | #: E712
8 8 | if True != res:
-E712.py:8:4: E712 [*] Avoid inequality comparisons to `True`; use `not res:` for false checks
+E712 [*] Avoid inequality comparisons to `True`; use `not res:` for false checks
+ --> E712.py:8:4
|
6 | pass
7 | #: E712
8 | if True != res:
- | ^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^
9 | pass
10 | #: E712
|
- = help: Replace with `not res`
+help: Replace with `not res`
ℹ Unsafe fix
5 5 | if res != False:
@@ -61,16 +64,17 @@ E712.py:8:4: E712 [*] Avoid inequality comparisons to `True`; use `not res:` for
10 10 | #: E712
11 11 | if False == res:
-E712.py:11:4: E712 [*] Avoid equality comparisons to `False`; use `not res:` for false checks
+E712 [*] Avoid equality comparisons to `False`; use `not res:` for false checks
+ --> E712.py:11:4
|
9 | pass
10 | #: E712
11 | if False == res:
- | ^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^
12 | pass
13 | #: E712
|
- = help: Replace with `not res`
+help: Replace with `not res`
ℹ Unsafe fix
8 8 | if True != res:
@@ -82,16 +86,17 @@ E712.py:11:4: E712 [*] Avoid equality comparisons to `False`; use `not res:` for
13 13 | #: E712
14 14 | if res[1] == True:
-E712.py:14:4: E712 [*] Avoid equality comparisons to `True`; use `res[1]:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `res[1]:` for truth checks
+ --> E712.py:14:4
|
12 | pass
13 | #: E712
14 | if res[1] == True:
- | ^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^
15 | pass
16 | #: E712
|
- = help: Replace with `res[1]`
+help: Replace with `res[1]`
ℹ Unsafe fix
11 11 | if False == res:
@@ -103,16 +108,17 @@ E712.py:14:4: E712 [*] Avoid equality comparisons to `True`; use `res[1]:` for t
16 16 | #: E712
17 17 | if res[1] != False:
-E712.py:17:4: E712 [*] Avoid inequality comparisons to `False`; use `res[1]:` for truth checks
+E712 [*] Avoid inequality comparisons to `False`; use `res[1]:` for truth checks
+ --> E712.py:17:4
|
15 | pass
16 | #: E712
17 | if res[1] != False:
- | ^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^
18 | pass
19 | #: E712
|
- = help: Replace with `res[1]`
+help: Replace with `res[1]`
ℹ Unsafe fix
14 14 | if res[1] == True:
@@ -124,16 +130,17 @@ E712.py:17:4: E712 [*] Avoid inequality comparisons to `False`; use `res[1]:` fo
19 19 | #: E712
20 20 | var = 1 if cond == True else -1 if cond == False else cond
-E712.py:20:12: E712 [*] Avoid equality comparisons to `True`; use `cond:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `cond:` for truth checks
+ --> E712.py:20:12
|
18 | pass
19 | #: E712
20 | var = 1 if cond == True else -1 if cond == False else cond
- | ^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^
21 | #: E712
22 | if (True) == TrueElement or x == TrueElement:
|
- = help: Replace with `cond`
+help: Replace with `cond`
ℹ Unsafe fix
17 17 | if res[1] != False:
@@ -145,16 +152,17 @@ E712.py:20:12: E712 [*] Avoid equality comparisons to `True`; use `cond:` for tr
22 22 | if (True) == TrueElement or x == TrueElement:
23 23 | pass
-E712.py:20:36: E712 [*] Avoid equality comparisons to `False`; use `not cond:` for false checks
+E712 [*] Avoid equality comparisons to `False`; use `not cond:` for false checks
+ --> E712.py:20:36
|
18 | pass
19 | #: E712
20 | var = 1 if cond == True else -1 if cond == False else cond
- | ^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^
21 | #: E712
22 | if (True) == TrueElement or x == TrueElement:
|
- = help: Replace with `not cond`
+help: Replace with `not cond`
ℹ Unsafe fix
17 17 | if res[1] != False:
@@ -166,15 +174,16 @@ E712.py:20:36: E712 [*] Avoid equality comparisons to `False`; use `not cond:` f
22 22 | if (True) == TrueElement or x == TrueElement:
23 23 | pass
-E712.py:22:4: E712 [*] Avoid equality comparisons to `True`; use `TrueElement:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `TrueElement:` for truth checks
+ --> E712.py:22:4
|
20 | var = 1 if cond == True else -1 if cond == False else cond
21 | #: E712
22 | if (True) == TrueElement or x == TrueElement:
- | ^^^^^^^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^^^^^^^
23 | pass
|
- = help: Replace with `TrueElement`
+help: Replace with `TrueElement`
ℹ Unsafe fix
19 19 | #: E712
@@ -186,15 +195,16 @@ E712.py:22:4: E712 [*] Avoid equality comparisons to `True`; use `TrueElement:`
24 24 |
25 25 | if res == True != False:
-E712.py:25:4: E712 [*] Avoid equality comparisons to `True` or `False`
+E712 [*] Avoid equality comparisons to `True` or `False`
+ --> E712.py:25:4
|
23 | pass
24 |
25 | if res == True != False:
- | ^^^^^^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^^^^^^
26 | pass
|
- = help: Replace comparison
+help: Replace comparison
ℹ Unsafe fix
22 22 | if (True) == TrueElement or x == TrueElement:
@@ -206,15 +216,16 @@ E712.py:25:4: E712 [*] Avoid equality comparisons to `True` or `False`
27 27 |
28 28 | if(True) == TrueElement or x == TrueElement:
-E712.py:25:4: E712 [*] Avoid equality comparisons to `True` or `False`
+E712 [*] Avoid equality comparisons to `True` or `False`
+ --> E712.py:25:4
|
23 | pass
24 |
25 | if res == True != False:
- | ^^^^^^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^^^^^^
26 | pass
|
- = help: Replace comparison
+help: Replace comparison
ℹ Unsafe fix
22 22 | if (True) == TrueElement or x == TrueElement:
@@ -226,15 +237,16 @@ E712.py:25:4: E712 [*] Avoid equality comparisons to `True` or `False`
27 27 |
28 28 | if(True) == TrueElement or x == TrueElement:
-E712.py:28:3: E712 [*] Avoid equality comparisons to `True`; use `TrueElement:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `TrueElement:` for truth checks
+ --> E712.py:28:3
|
26 | pass
27 |
28 | if(True) == TrueElement or x == TrueElement:
- | ^^^^^^^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^^^^^^^
29 | pass
|
- = help: Replace with `TrueElement`
+help: Replace with `TrueElement`
ℹ Unsafe fix
25 25 | if res == True != False:
@@ -246,15 +258,16 @@ E712.py:28:3: E712 [*] Avoid equality comparisons to `True`; use `TrueElement:`
30 30 |
31 31 | if (yield i) == True:
-E712.py:31:4: E712 [*] Avoid equality comparisons to `True`; use `yield i:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `yield i:` for truth checks
+ --> E712.py:31:4
|
29 | pass
30 |
31 | if (yield i) == True:
- | ^^^^^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^^^^^
32 | print("even")
|
- = help: Replace with `yield i`
+help: Replace with `yield i`
ℹ Unsafe fix
28 28 | if(True) == TrueElement or x == TrueElement:
@@ -266,14 +279,15 @@ E712.py:31:4: E712 [*] Avoid equality comparisons to `True`; use `yield i:` for
33 33 |
34 34 | #: Okay
-E712.py:58:4: E712 [*] Avoid equality comparisons to `True`; use `True:` for truth checks
+E712 [*] Avoid equality comparisons to `True`; use `True:` for truth checks
+ --> E712.py:58:4
|
57 | # https://github.com/astral-sh/ruff/issues/17582
58 | if True == True: # No duplicated diagnostic
- | ^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^
59 | pass
|
- = help: Replace with `True`
+help: Replace with `True`
ℹ Unsafe fix
55 55 | assert [42, not foo] in bar
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap
index 845fa441d9..a41a7572d6 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E713.py:2:8: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:2:8
|
1 | #: E713
2 | if not X in Y:
- | ^^^^^^ E713
+ | ^^^^^^
3 | pass
4 | #: E713
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
1 1 | #: E713
@@ -20,16 +20,17 @@ E713.py:2:8: E713 [*] Test for membership should be `not in`
4 4 | #: E713
5 5 | if not X.B in Y:
-E713.py:5:8: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:5:8
|
3 | pass
4 | #: E713
5 | if not X.B in Y:
- | ^^^^^^^^ E713
+ | ^^^^^^^^
6 | pass
7 | #: E713
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
2 2 | if not X in Y:
@@ -41,16 +42,17 @@ E713.py:5:8: E713 [*] Test for membership should be `not in`
7 7 | #: E713
8 8 | if not X in Y and Z == "zero":
-E713.py:8:8: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:8:8
|
6 | pass
7 | #: E713
8 | if not X in Y and Z == "zero":
- | ^^^^^^ E713
+ | ^^^^^^
9 | pass
10 | #: E713
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
5 5 | if not X.B in Y:
@@ -62,16 +64,17 @@ E713.py:8:8: E713 [*] Test for membership should be `not in`
10 10 | #: E713
11 11 | if X == "zero" or not Y in Z:
-E713.py:11:23: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:11:23
|
9 | pass
10 | #: E713
11 | if X == "zero" or not Y in Z:
- | ^^^^^^ E713
+ | ^^^^^^
12 | pass
13 | #: E713
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
8 8 | if not X in Y and Z == "zero":
@@ -83,15 +86,16 @@ E713.py:11:23: E713 [*] Test for membership should be `not in`
13 13 | #: E713
14 14 | if not (X in Y):
-E713.py:14:9: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:14:9
|
12 | pass
13 | #: E713
14 | if not (X in Y):
- | ^^^^^^ E713
+ | ^^^^^^
15 | pass
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
11 11 | if X == "zero" or not Y in Z:
@@ -103,14 +107,15 @@ E713.py:14:9: E713 [*] Test for membership should be `not in`
16 16 |
17 17 | #: Okay
-E713.py:40:12: E713 [*] Test for membership should be `not in`
+E713 [*] Test for membership should be `not in`
+ --> E713.py:40:12
|
38 | assert [42, not foo] in bar
39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
40 | assert not('name' in request)or not request['name']
- | ^^^^^^^^^^^^^^^^^ E713
+ | ^^^^^^^^^^^^^^^^^
|
- = help: Convert to `not in`
+help: Convert to `not in`
ℹ Safe fix
37 37 | assert {"x": not foo} in bar
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap
index 8b5df02535..3b9bfc27f3 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E714.py:2:8: E714 [*] Test for object identity should be `is not`
+E714 [*] Test for object identity should be `is not`
+ --> E714.py:2:8
|
1 | #: E714
2 | if not X is Y:
- | ^^^^^^ E714
+ | ^^^^^^
3 | pass
4 | #: E714
|
- = help: Convert to `is not`
+help: Convert to `is not`
ℹ Safe fix
1 1 | #: E714
@@ -20,15 +20,16 @@ E714.py:2:8: E714 [*] Test for object identity should be `is not`
4 4 | #: E714
5 5 | if not X.B is Y:
-E714.py:5:8: E714 [*] Test for object identity should be `is not`
+E714 [*] Test for object identity should be `is not`
+ --> E714.py:5:8
|
3 | pass
4 | #: E714
5 | if not X.B is Y:
- | ^^^^^^^^ E714
+ | ^^^^^^^^
6 | pass
|
- = help: Convert to `is not`
+help: Convert to `is not`
ℹ Safe fix
2 2 | if not X is Y:
@@ -40,14 +41,15 @@ E714.py:5:8: E714 [*] Test for object identity should be `is not`
7 7 |
8 8 | #: Okay
-E714.py:39:13: E714 [*] Test for object identity should be `is not`
+E714 [*] Test for object identity should be `is not`
+ --> E714.py:39:13
|
37 | assert {"x": not foo} in bar
38 | assert [42, not foo] in bar
39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E714
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Convert to `is not`
+help: Convert to `is not`
ℹ Safe fix
36 36 | assert (not foo) in bar
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E721_E721.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E721_E721.py.snap
index 0e257342a9..a41e91b05f 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E721_E721.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E721_E721.py.snap
@@ -1,158 +1,174 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E721.py:2:4: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:2:4
|
1 | #: E721
2 | if type(res) == type(42):
- | ^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^
3 | pass
4 | #: E721
|
-E721.py:5:4: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:5:4
|
3 | pass
4 | #: E721
5 | if type(res) != type(""):
- | ^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^
6 | pass
7 | #: E721
|
-E721.py:8:4: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:8:4
|
6 | pass
7 | #: E721
8 | if type(res) == memoryview:
- | ^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^
9 | pass
10 | #: Okay
|
-E721.py:21:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:21:8
|
19 | pass
20 | #: E721
21 | assert type(res) == type(False) or type(res) == type(None)
- | ^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
22 | #: E721
23 | assert type(res) == type([])
|
-E721.py:21:36: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:21:36
|
19 | pass
20 | #: E721
21 | assert type(res) == type(False) or type(res) == type(None)
- | ^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^
22 | #: E721
23 | assert type(res) == type([])
|
-E721.py:23:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:23:8
|
21 | assert type(res) == type(False) or type(res) == type(None)
22 | #: E721
23 | assert type(res) == type([])
- | ^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^
24 | #: E721
25 | assert type(res) == type(())
|
-E721.py:25:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:25:8
|
23 | assert type(res) == type([])
24 | #: E721
25 | assert type(res) == type(())
- | ^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^
26 | #: E721
27 | assert type(res) == type((0,))
|
-E721.py:27:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:27:8
|
25 | assert type(res) == type(())
26 | #: E721
27 | assert type(res) == type((0,))
- | ^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^
28 | #: E721
29 | assert type(res) == type((0))
|
-E721.py:29:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:29:8
|
27 | assert type(res) == type((0,))
28 | #: E721
29 | assert type(res) == type((0))
- | ^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^
30 | #: E721
31 | assert type(res) != type((1, ))
|
-E721.py:31:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:31:8
|
29 | assert type(res) == type((0))
30 | #: E721
31 | assert type(res) != type((1, ))
- | ^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
32 | #: Okay
33 | assert type(res) is type((1, ))
|
-E721.py:37:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:37:8
|
35 | assert type(res) is not type((1, ))
36 | #: E211 E721
37 | assert type(res) == type ([2, ])
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
38 | #: E201 E201 E202 E721
39 | assert type(res) == type( ( ) )
|
-E721.py:39:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:39:8
|
37 | assert type(res) == type ([2, ])
38 | #: E201 E201 E202 E721
39 | assert type(res) == type( ( ) )
- | ^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
40 | #: E201 E202 E721
41 | assert type(res) == type( (0, ) )
|
-E721.py:41:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:41:8
|
39 | assert type(res) == type( ( ) )
40 | #: E201 E202 E721
41 | assert type(res) == type( (0, ) )
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
42 | #:
|
-E721.py:59:4: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:59:4
|
57 | pass
58 | #: E721
59 | if type(res) == type:
- | ^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^
60 | pass
61 | #: Okay
|
-E721.py:140:1: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:140:1
|
139 | #: E721
140 | dtype == float
- | ^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^
141 |
142 | import builtins
|
-E721.py:144:4: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
+ --> E721.py:144:4
|
142 | import builtins
143 |
144 | if builtins.type(res) == memoryview: # E721
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145 | pass
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E722_E722.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E722_E722.py.snap
index 48d10268e4..b52dcc588e 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E722_E722.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E722_E722.py.snap
@@ -1,33 +1,35 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E722.py:4:1: E722 Do not use bare `except`
+E722 Do not use bare `except`
+ --> E722.py:4:1
|
2 | try:
3 | pass
4 | except:
- | ^^^^^^ E722
+ | ^^^^^^
5 | pass
6 | #: E722
|
-E722.py:11:1: E722 Do not use bare `except`
+E722 Do not use bare `except`
+ --> E722.py:11:1
|
9 | except Exception:
10 | pass
11 | except:
- | ^^^^^^ E722
+ | ^^^^^^
12 | pass
13 | #: E722
|
-E722.py:16:1: E722 Do not use bare `except`
+E722 Do not use bare `except`
+ --> E722.py:16:1
|
14 | try:
15 | pass
16 | except:
- | ^^^^^^ E722
+ | ^^^^^^
17 | pass
18 | #: Okay
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap
index d80f8fca96..9b7e9c54c8 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E731.py:3:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:3:5
|
1 | def scope():
2 | # E731
3 | f = lambda x: 2 * x
- | ^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
1 1 | def scope():
@@ -20,14 +21,15 @@ E731.py:3:5: E731 [*] Do not assign a `lambda` expression, use a `def`
5 6 |
6 7 | def scope():
-E731.py:8:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:8:5
|
6 | def scope():
7 | # E731
8 | f = lambda x: 2 * x
- | ^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
5 5 |
@@ -40,14 +42,15 @@ E731.py:8:5: E731 [*] Do not assign a `lambda` expression, use a `def`
10 11 |
11 12 | def scope():
-E731.py:14:9: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:14:9
|
12 | # E731
13 | while False:
14 | this = lambda y, z: 2 * x
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `this` as a `def`
+help: Rewrite `this` as a `def`
ℹ Unsafe fix
11 11 | def scope():
@@ -60,14 +63,15 @@ E731.py:14:9: E731 [*] Do not assign a `lambda` expression, use a `def`
16 17 |
17 18 | def scope():
-E731.py:19:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:19:5
|
17 | def scope():
18 | # E731
19 | f = lambda: (yield 1)
- | ^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
16 16 |
@@ -80,14 +84,15 @@ E731.py:19:5: E731 [*] Do not assign a `lambda` expression, use a `def`
21 22 |
22 23 | def scope():
-E731.py:24:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:24:5
|
22 | def scope():
23 | # E731
24 | f = lambda: (yield from g())
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
21 21 |
@@ -100,14 +105,15 @@ E731.py:24:5: E731 [*] Do not assign a `lambda` expression, use a `def`
26 27 |
27 28 | def scope():
-E731.py:57:5: E731 Do not assign a `lambda` expression, use a `def`
+E731 Do not assign a `lambda` expression, use a `def`
+ --> E731.py:57:5
|
55 | class Scope:
56 | # E731
57 | f = lambda x: 2 * x
- | ^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Display-only fix
54 54 |
@@ -120,16 +126,17 @@ E731.py:57:5: E731 Do not assign a `lambda` expression, use a `def`
59 60 |
60 61 | class Scope:
-E731.py:73:9: E731 Do not assign a `lambda` expression, use a `def`
+E731 Do not assign a `lambda` expression, use a `def`
+ --> E731.py:73:9
|
71 | x: Callable[[int], int]
72 | if True:
73 | x = lambda: 1
- | ^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^
74 | else:
75 | x = lambda: 2
|
- = help: Rewrite `x` as a `def`
+help: Rewrite `x` as a `def`
ℹ Display-only fix
70 70 |
@@ -142,15 +149,16 @@ E731.py:73:9: E731 Do not assign a `lambda` expression, use a `def`
75 76 | x = lambda: 2
76 77 | return x
-E731.py:75:9: E731 Do not assign a `lambda` expression, use a `def`
+E731 Do not assign a `lambda` expression, use a `def`
+ --> E731.py:75:9
|
73 | x = lambda: 1
74 | else:
75 | x = lambda: 2
- | ^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^
76 | return x
|
- = help: Rewrite `x` as a `def`
+help: Rewrite `x` as a `def`
ℹ Display-only fix
72 72 | if True:
@@ -163,14 +171,15 @@ E731.py:75:9: E731 Do not assign a `lambda` expression, use a `def`
77 78 |
78 79 |
-E731.py:86:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:86:5
|
84 | # ParamSpec cannot be used in this context, so do not preserve the annotation.
85 | P = ParamSpec("P")
86 | f: Callable[P, int] = lambda *args: len(args)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
83 83 |
@@ -183,14 +192,15 @@ E731.py:86:5: E731 [*] Do not assign a `lambda` expression, use a `def`
88 89 |
89 90 | def scope():
-E731.py:94:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:94:5
|
92 | from typing import Callable
93 |
94 | f: Callable[[], None] = lambda: None
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
91 91 |
@@ -203,14 +213,15 @@ E731.py:94:5: E731 [*] Do not assign a `lambda` expression, use a `def`
96 97 |
97 98 | def scope():
-E731.py:102:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:102:5
|
100 | from typing import Callable
101 |
102 | f: Callable[..., None] = lambda a, b: None
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
99 99 |
@@ -223,14 +234,15 @@ E731.py:102:5: E731 [*] Do not assign a `lambda` expression, use a `def`
104 105 |
105 106 | def scope():
-E731.py:110:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:110:5
|
108 | from typing import Callable
109 |
110 | f: Callable[[int], int] = lambda x: 2 * x
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
107 107 |
@@ -243,14 +255,15 @@ E731.py:110:5: E731 [*] Do not assign a `lambda` expression, use a `def`
112 113 |
113 114 | # Let's use the `Callable` type from `collections.abc` instead.
-E731.py:119:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:119:5
|
117 | from collections.abc import Callable
118 |
119 | f: Callable[[str, int], str] = lambda a, b: a * b
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
116 116 |
@@ -263,14 +276,15 @@ E731.py:119:5: E731 [*] Do not assign a `lambda` expression, use a `def`
121 122 |
122 123 | def scope():
-E731.py:127:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:127:5
|
125 | from collections.abc import Callable
126 |
127 | f: Callable[[str, int], tuple[str, int]] = lambda a, b: (a, b)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
124 124 |
@@ -283,14 +297,15 @@ E731.py:127:5: E731 [*] Do not assign a `lambda` expression, use a `def`
129 130 |
130 131 | def scope():
-E731.py:135:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:135:5
|
133 | from collections.abc import Callable
134 |
135 | f: Callable[[str, int, list[str]], list[str]] = lambda a, b, /, c: [*c, a * b]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
132 132 |
@@ -303,14 +318,15 @@ E731.py:135:5: E731 [*] Do not assign a `lambda` expression, use a `def`
137 138 |
138 139 | class TemperatureScales(Enum):
-E731.py:139:5: E731 Do not assign a `lambda` expression, use a `def`
+E731 Do not assign a `lambda` expression, use a `def`
+ --> E731.py:139:5
|
138 | class TemperatureScales(Enum):
139 | CELSIUS = (lambda deg_c: deg_c)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140 | FAHRENHEIT = (lambda deg_c: deg_c * 9 / 5 + 32)
|
- = help: Rewrite `CELSIUS` as a `def`
+help: Rewrite `CELSIUS` as a `def`
ℹ Display-only fix
136 136 |
@@ -323,14 +339,15 @@ E731.py:139:5: E731 Do not assign a `lambda` expression, use a `def`
141 142 |
142 143 |
-E731.py:140:5: E731 Do not assign a `lambda` expression, use a `def`
+E731 Do not assign a `lambda` expression, use a `def`
+ --> E731.py:140:5
|
138 | class TemperatureScales(Enum):
139 | CELSIUS = (lambda deg_c: deg_c)
140 | FAHRENHEIT = (lambda deg_c: deg_c * 9 / 5 + 32)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Rewrite `FAHRENHEIT` as a `def`
+help: Rewrite `FAHRENHEIT` as a `def`
ℹ Display-only fix
137 137 |
@@ -343,16 +360,17 @@ E731.py:140:5: E731 Do not assign a `lambda` expression, use a `def`
142 143 |
143 144 | # Regression test for: https://github.com/astral-sh/ruff/issues/7141
-E731.py:147:5: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:147:5
|
145 | # E731
146 |
147 | / f = lambda: (
148 | | i := 1,
149 | | )
- | |_____^ E731
+ | |_____^
|
- = help: Rewrite `f` as a `def`
+help: Rewrite `f` as a `def`
ℹ Unsafe fix
144 144 | def scope():
@@ -369,7 +387,8 @@ E731.py:147:5: E731 [*] Do not assign a `lambda` expression, use a `def`
151 152 |
152 153 | from dataclasses import dataclass
-E731.py:163:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:163:1
|
161 | # Regression tests for:
162 | # * https://github.com/astral-sh/ruff/issues/7720
@@ -377,11 +396,11 @@ E731.py:163:1: E731 [*] Do not assign a `lambda` expression, use a `def`
164 | | a
165 | | b
166 | | """
- | |___^ E731
+ | |___^
167 |
168 | # * https://github.com/astral-sh/ruff/issues/10277
|
- = help: Rewrite `x` as a `def`
+help: Rewrite `x` as a `def`
ℹ Unsafe fix
160 160 |
@@ -394,15 +413,16 @@ E731.py:163:1: E731 [*] Do not assign a `lambda` expression, use a `def`
165 166 | b
166 167 | """
-E731.py:169:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:169:1
|
168 | # * https://github.com/astral-sh/ruff/issues/10277
169 | at_least_one_million = lambda _: _ >= 1_000_000
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E731
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170 |
171 | x = lambda: (
|
- = help: Rewrite `at_least_one_million` as a `def`
+help: Rewrite `at_least_one_million` as a `def`
ℹ Unsafe fix
166 166 | """
@@ -415,7 +435,8 @@ E731.py:169:1: E731 [*] Do not assign a `lambda` expression, use a `def`
171 172 | x = lambda: (
172 173 | # comment
-E731.py:171:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:171:1
|
169 | at_least_one_million = lambda _: _ >= 1_000_000
170 |
@@ -423,11 +444,11 @@ E731.py:171:1: E731 [*] Do not assign a `lambda` expression, use a `def`
172 | | # comment
173 | | 5 + 10
174 | | )
- | |_^ E731
+ | |_^
175 |
176 | x = lambda: (
|
- = help: Rewrite `x` as a `def`
+help: Rewrite `x` as a `def`
ℹ Unsafe fix
168 168 | # * https://github.com/astral-sh/ruff/issues/10277
@@ -440,7 +461,8 @@ E731.py:171:1: E731 [*] Do not assign a `lambda` expression, use a `def`
173 174 | 5 + 10
174 175 | )
-E731.py:176:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:176:1
|
174 | )
175 |
@@ -448,11 +470,11 @@ E731.py:176:1: E731 [*] Do not assign a `lambda` expression, use a `def`
177 | | # comment
178 | | y := 10
179 | | )
- | |_^ E731
+ | |_^
180 |
181 | # https://github.com/astral-sh/ruff/issues/18475
|
- = help: Rewrite `x` as a `def`
+help: Rewrite `x` as a `def`
ℹ Unsafe fix
173 173 | 5 + 10
@@ -465,7 +487,8 @@ E731.py:176:1: E731 [*] Do not assign a `lambda` expression, use a `def`
178 179 | y := 10
179 180 | )
-E731.py:182:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:182:1
|
181 | # https://github.com/astral-sh/ruff/issues/18475
182 | / foo_tooltip = (
@@ -473,11 +496,11 @@ E731.py:182:1: E731 [*] Do not assign a `lambda` expression, use a `def`
184 | | if data["foo"] is not None
185 | | else ""
186 | | )
- | |_^ E731
+ | |_^
187 |
188 | foo_tooltip = (
|
- = help: Rewrite `foo_tooltip` as a `def`
+help: Rewrite `foo_tooltip` as a `def`
ℹ Unsafe fix
179 179 | )
@@ -495,7 +518,8 @@ E731.py:182:1: E731 [*] Do not assign a `lambda` expression, use a `def`
188 187 | foo_tooltip = (
189 188 | lambda x, data: f"\nfoo: {data['foo'][int(x)]}" +
-E731.py:188:1: E731 [*] Do not assign a `lambda` expression, use a `def`
+E731 [*] Do not assign a `lambda` expression, use a `def`
+ --> E731.py:188:1
|
186 | )
187 |
@@ -504,9 +528,9 @@ E731.py:188:1: E731 [*] Do not assign a `lambda` expression, use a `def`
190 | | more
191 | |
192 | | )
- | |_^ E731
+ | |_^
|
- = help: Rewrite `foo_tooltip` as a `def`
+help: Rewrite `foo_tooltip` as a `def`
ℹ Unsafe fix
185 185 | else ""
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap
index 75db1277a6..70e66d2aec 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap
@@ -1,211 +1,236 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E741.py:3:1: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:3:1
|
1 | from contextlib import contextmanager
2 |
3 | l = 0
- | ^ E741
+ | ^
4 | I = 0
5 | O = 0
|
-E741.py:4:1: E741 Ambiguous variable name: `I`
+E741 Ambiguous variable name: `I`
+ --> E741.py:4:1
|
3 | l = 0
4 | I = 0
- | ^ E741
+ | ^
5 | O = 0
6 | l: int = 0
|
-E741.py:5:1: E741 Ambiguous variable name: `O`
+E741 Ambiguous variable name: `O`
+ --> E741.py:5:1
|
3 | l = 0
4 | I = 0
5 | O = 0
- | ^ E741
+ | ^
6 | l: int = 0
|
-E741.py:6:1: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:6:1
|
4 | I = 0
5 | O = 0
6 | l: int = 0
- | ^ E741
+ | ^
7 |
8 | a, l = 0, 1
|
-E741.py:8:4: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:8:4
|
6 | l: int = 0
7 |
8 | a, l = 0, 1
- | ^ E741
+ | ^
9 | [a, l] = 0, 1
10 | a, *l = 0, 1, 2
|
-E741.py:9:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:9:5
|
8 | a, l = 0, 1
9 | [a, l] = 0, 1
- | ^ E741
+ | ^
10 | a, *l = 0, 1, 2
11 | a = l = 0
|
-E741.py:10:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:10:5
|
8 | a, l = 0, 1
9 | [a, l] = 0, 1
10 | a, *l = 0, 1, 2
- | ^ E741
+ | ^
11 | a = l = 0
|
-E741.py:11:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:11:5
|
9 | [a, l] = 0, 1
10 | a, *l = 0, 1, 2
11 | a = l = 0
- | ^ E741
+ | ^
12 |
13 | o = 0
|
-E741.py:16:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:16:5
|
14 | i = 0
15 |
16 | for l in range(3):
- | ^ E741
+ | ^
17 | pass
|
-E741.py:20:8: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:20:8
|
20 | for a, l in zip(range(3), range(3)):
- | ^ E741
+ | ^
21 | pass
|
-E741.py:25:12: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:25:12
|
24 | def f1():
25 | global l
- | ^ E741
+ | ^
26 | l = 0
|
-E741.py:26:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:26:5
|
24 | def f1():
25 | global l
26 | l = 0
- | ^ E741
+ | ^
|
-E741.py:30:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:30:5
|
29 | def f2():
30 | l = 0
- | ^ E741
+ | ^
31 |
32 | def f3():
|
-E741.py:33:18: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:33:18
|
32 | def f3():
33 | nonlocal l
- | ^ E741
+ | ^
34 | l = 1
|
-E741.py:34:9: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:34:9
|
32 | def f3():
33 | nonlocal l
34 | l = 1
- | ^ E741
+ | ^
35 |
36 | f3()
|
-E741.py:40:8: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:40:8
|
40 | def f4(l, /, I):
- | ^ E741
+ | ^
41 | return l, I, O
|
-E741.py:40:14: E741 Ambiguous variable name: `I`
+E741 Ambiguous variable name: `I`
+ --> E741.py:40:14
|
40 | def f4(l, /, I):
- | ^ E741
+ | ^
41 | return l, I, O
|
-E741.py:44:8: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:44:8
|
44 | def f5(l=0, *, I=1):
- | ^ E741
+ | ^
45 | return l, I
|
-E741.py:44:16: E741 Ambiguous variable name: `I`
+E741 Ambiguous variable name: `I`
+ --> E741.py:44:16
|
44 | def f5(l=0, *, I=1):
- | ^ E741
+ | ^
45 | return l, I
|
-E741.py:48:9: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:48:9
|
48 | def f6(*l, **I):
- | ^ E741
+ | ^
49 | return l, I
|
-E741.py:48:14: E741 Ambiguous variable name: `I`
+E741 Ambiguous variable name: `I`
+ --> E741.py:48:14
|
48 | def f6(*l, **I):
- | ^ E741
+ | ^
49 | return l, I
|
-E741.py:57:16: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:57:16
|
57 | with ctx1() as l:
- | ^ E741
+ | ^
58 | pass
|
-E741.py:66:20: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:66:20
|
66 | with ctx2() as (a, l):
- | ^ E741
+ | ^
67 | pass
|
-E741.py:71:22: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:71:22
|
69 | try:
70 | pass
71 | except ValueError as l:
- | ^ E741
+ | ^
72 | pass
|
-E741.py:74:5: E741 Ambiguous variable name: `l`
+E741 Ambiguous variable name: `l`
+ --> E741.py:74:5
|
72 | pass
73 |
74 | if (l := 5) > 0:
- | ^ E741
+ | ^
75 | pass
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E742_E742.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E742_E742.py.snap
index abfdba447e..533d909a31 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E742_E742.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E742_E742.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E742.py:1:7: E742 Ambiguous class name: `l`
+E742 Ambiguous class name: `l`
+ --> E742.py:1:7
|
1 | class l:
- | ^ E742
+ | ^
2 | pass
|
-E742.py:5:7: E742 Ambiguous class name: `I`
+E742 Ambiguous class name: `I`
+ --> E742.py:5:7
|
5 | class I:
- | ^ E742
+ | ^
6 | pass
|
-E742.py:9:7: E742 Ambiguous class name: `O`
+E742 Ambiguous class name: `O`
+ --> E742.py:9:7
|
9 | class O:
- | ^ E742
+ | ^
10 | pass
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E743_E743.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E743_E743.py.snap
index 0a80ad2cf8..702bbfa215 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E743_E743.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E743_E743.py.snap
@@ -1,25 +1,27 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E743.py:1:5: E743 Ambiguous function name: `l`
+E743 Ambiguous function name: `l`
+ --> E743.py:1:5
|
1 | def l():
- | ^ E743
+ | ^
2 | pass
|
-E743.py:5:5: E743 Ambiguous function name: `I`
+E743 Ambiguous function name: `I`
+ --> E743.py:5:5
|
5 | def I():
- | ^ E743
+ | ^
6 | pass
|
-E743.py:10:9: E743 Ambiguous function name: `O`
+E743 Ambiguous function name: `O`
+ --> E743.py:10:9
|
9 | class X:
10 | def O(self):
- | ^ E743
+ | ^
11 | pass
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap
index b1fce5b6a5..8d88eef99b 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap
@@ -1,21 +1,24 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W19.py:1:1: W191 Indentation contains tabs
- |
-1 | '''File starts with a tab
- | ^^^^ W191
-2 | multiline string with tab in it'''
- |
-
-W19.py:1:1: invalid-syntax: Unexpected indentation
+W191 Indentation contains tabs
+ --> W19.py:1:1
|
1 | '''File starts with a tab
| ^^^^
2 | multiline string with tab in it'''
|
-W19.py:5:1: invalid-syntax: Expected a statement
+invalid-syntax: Unexpected indentation
+ --> W19.py:1:1
+ |
+1 | '''File starts with a tab
+ | ^^^^
+2 | multiline string with tab in it'''
+ |
+
+invalid-syntax: Expected a statement
+ --> W19.py:5:1
|
4 | #: W191
5 | if False:
@@ -24,359 +27,396 @@ W19.py:5:1: invalid-syntax: Expected a statement
7 | #:
|
-W19.py:6:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:6:1
|
4 | #: W191
5 | if False:
6 | print # indented with 1 tab
- | ^^^^ W191
+ | ^^^^
7 | #:
|
-W19.py:12:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:12:1
|
10 | #: W191
11 | y = x == 2 \
12 | or x == 3
- | ^^^^ W191
+ | ^^^^
13 | #: E101 W191 W504
14 | if (
|
-W19.py:19:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:19:1
|
17 | ) or
18 | y == 4):
19 | pass
- | ^^^^ W191
+ | ^^^^
20 | #: E101 W191
21 | if x == 2 \
|
-W19.py:24:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:24:1
|
22 | or y > 1 \
23 | or x == 3:
24 | pass
- | ^^^^ W191
+ | ^^^^
25 | #: E101 W191
26 | if x == 2 \
|
-W19.py:29:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:29:1
|
27 | or y > 1 \
28 | or x == 3:
29 | pass
- | ^^^^ W191
+ | ^^^^
30 | #:
|
-W19.py:35:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:35:1
|
33 | if (foo == bar and
34 | baz == bop):
35 | pass
- | ^^^^ W191
+ | ^^^^
36 | #: E101 W191 W504
37 | if (
|
-W19.py:41:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:41:1
|
39 | baz == bop
40 | ):
41 | pass
- | ^^^^ W191
+ | ^^^^
42 | #:
|
-W19.py:47:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:47:1
|
45 | if start[1] > end_col and not (
46 | over_indent == 4 and indent_next):
47 | return (0, "E121 continuation line over-"
- | ^^^^ W191
+ | ^^^^
48 | "indented for visual indent")
49 | #:
|
-W19.py:48:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:48:1
|
46 | over_indent == 4 and indent_next):
47 | return (0, "E121 continuation line over-"
48 | "indented for visual indent")
- | ^^^^^^^^^^^^ W191
+ | ^^^^^^^^^^^^
49 | #:
|
-W19.py:57:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:57:1
|
55 | var_one, var_two, var_three,
56 | var_four):
57 | print(var_one)
- | ^^^^ W191
+ | ^^^^
58 | #: E101 W191 W504
59 | if ((row < 0 or self.moduleCount <= row or
|
-W19.py:61:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:61:1
|
59 | if ((row < 0 or self.moduleCount <= row or
60 | col < 0 or self.moduleCount <= col)):
61 | raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
- | ^^^^ W191
+ | ^^^^
62 | #: E101 E101 E101 E101 W191 W191 W191 W191 W191 W191
63 | if bar:
|
-W19.py:64:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:64:1
|
62 | #: E101 E101 E101 E101 W191 W191 W191 W191 W191 W191
63 | if bar:
64 | return (
- | ^^^^ W191
+ | ^^^^
65 | start, 'E121 lines starting with a '
66 | 'closing bracket should be indented '
|
-W19.py:65:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:65:1
|
63 | if bar:
64 | return (
65 | start, 'E121 lines starting with a '
- | ^^^^^^^^ W191
+ | ^^^^^^^^
66 | 'closing bracket should be indented '
67 | "to match that of the opening "
|
-W19.py:66:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:66:1
|
64 | return (
65 | start, 'E121 lines starting with a '
66 | 'closing bracket should be indented '
- | ^^^^^^^^ W191
+ | ^^^^^^^^
67 | "to match that of the opening "
68 | "bracket's line"
|
-W19.py:67:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:67:1
|
65 | start, 'E121 lines starting with a '
66 | 'closing bracket should be indented '
67 | "to match that of the opening "
- | ^^^^^^^^ W191
+ | ^^^^^^^^
68 | "bracket's line"
69 | )
|
-W19.py:68:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:68:1
|
66 | 'closing bracket should be indented '
67 | "to match that of the opening "
68 | "bracket's line"
- | ^^^^^^^^ W191
+ | ^^^^^^^^
69 | )
70 | #
|
-W19.py:69:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:69:1
|
67 | "to match that of the opening "
68 | "bracket's line"
69 | )
- | ^^^^ W191
+ | ^^^^
70 | #
71 | #: E101 W191 W504
|
-W19.py:76:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:76:1
|
74 | foo.bar("bop")
75 | )):
76 | print("yes")
- | ^^^^ W191
+ | ^^^^
77 | #: E101 W191 W504
78 | # also ok, but starting to look like LISP
|
-W19.py:81:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:81:1
|
79 | if ((foo.bar("baz") and
80 | foo.bar("bop"))):
81 | print("yes")
- | ^^^^ W191
+ | ^^^^
82 | #: E101 W191 W504
83 | if (a == 2 or
|
-W19.py:86:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:86:1
|
84 | b == "abc def ghi"
85 | "jkl mno"):
86 | return True
- | ^^^^ W191
+ | ^^^^
87 | #: E101 W191 W504
88 | if (a == 2 or
|
-W19.py:91:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:91:1
|
89 | b == """abc def ghi
90 | jkl mno"""):
91 | return True
- | ^^^^ W191
+ | ^^^^
92 | #: W191:2:1 W191:3:1 E101:3:2
93 | if length > options.max_line_length:
|
-W19.py:94:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:94:1
|
92 | #: W191:2:1 W191:3:1 E101:3:2
93 | if length > options.max_line_length:
94 | return options.max_line_length, \
- | ^^^^ W191
+ | ^^^^
95 | "E501 line too long (%d characters)" % length
|
-W19.py:95:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:95:1
|
93 | if length > options.max_line_length:
94 | return options.max_line_length, \
95 | "E501 line too long (%d characters)" % length
- | ^^^^^^^^ W191
+ | ^^^^^^^^
|
-W19.py:101:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:101:1
|
99 | #: E101 W191 W191 W504
100 | if os.path.exists(os.path.join(path, PEP8_BIN)):
101 | cmd = ([os.path.join(path, PEP8_BIN)] +
- | ^^^^ W191
+ | ^^^^
102 | self._pep8_options(targetfile))
103 | #: W191 - okay
|
-W19.py:102:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:102:1
|
100 | if os.path.exists(os.path.join(path, PEP8_BIN)):
101 | cmd = ([os.path.join(path, PEP8_BIN)] +
102 | self._pep8_options(targetfile))
- | ^^^^^^^^^^^ W191
+ | ^^^^^^^^^^^
103 | #: W191 - okay
104 | '''
|
-W19.py:128:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:128:1
|
126 | if foo is None and bar is "bop" and \
127 | blah == 'yeah':
128 | blah = 'yeahnah'
- | ^^^^ W191
+ | ^^^^
|
-W19.py:134:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:134:1
|
132 | #: W191 W191 W191
133 | if True:
134 | foo(
- | ^^^^ W191
+ | ^^^^
135 | 1,
136 | 2)
|
-W19.py:135:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:135:1
|
133 | if True:
134 | foo(
135 | 1,
- | ^^^^^^^^ W191
+ | ^^^^^^^^
136 | 2)
137 | #: W191 W191 W191 W191 W191
|
-W19.py:136:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:136:1
|
134 | foo(
135 | 1,
136 | 2)
- | ^^^^^^^^ W191
+ | ^^^^^^^^
137 | #: W191 W191 W191 W191 W191
138 | def test_keys(self):
|
-W19.py:139:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:139:1
|
137 | #: W191 W191 W191 W191 W191
138 | def test_keys(self):
139 | """areas.json - All regions are accounted for."""
- | ^^^^ W191
+ | ^^^^
140 | expected = set([
141 | u'Norrbotten',
|
-W19.py:140:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:140:1
|
138 | def test_keys(self):
139 | """areas.json - All regions are accounted for."""
140 | expected = set([
- | ^^^^ W191
+ | ^^^^
141 | u'Norrbotten',
142 | u'V\xe4sterbotten',
|
-W19.py:141:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:141:1
|
139 | """areas.json - All regions are accounted for."""
140 | expected = set([
141 | u'Norrbotten',
- | ^^^^^^^^ W191
+ | ^^^^^^^^
142 | u'V\xe4sterbotten',
143 | ])
|
-W19.py:142:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:142:1
|
140 | expected = set([
141 | u'Norrbotten',
142 | u'V\xe4sterbotten',
- | ^^^^^^^^ W191
+ | ^^^^^^^^
143 | ])
144 | #: W191
|
-W19.py:143:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:143:1
|
141 | u'Norrbotten',
142 | u'V\xe4sterbotten',
143 | ])
- | ^^^^ W191
+ | ^^^^
144 | #: W191
145 | x = [
|
-W19.py:146:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:146:1
|
144 | #: W191
145 | x = [
146 | 'abc'
- | ^^^^ W191
+ | ^^^^
147 | ]
148 | #: W191 - okay
|
-W19.py:157:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:157:1
|
156 | f"test{
157 | tab_indented_should_be_flagged
- | ^^^^ W191
+ | ^^^^
158 | } <- this tab is fine"
|
-W19.py:161:1: W191 Indentation contains tabs
+W191 Indentation contains tabs
+ --> W19.py:161:1
|
160 | f"""test{
161 | tab_indented_should_be_flagged
- | ^^^^ W191
+ | ^^^^
162 | } <- this tab is fine"""
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W29.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W29.py.snap
index caf6753099..837470c93c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W29.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W29.py.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-W29.py:4:6: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W29.py:4:6
|
2 | # 情
3 | #: W291:1:6
4 | print
- | ^ W291
+ | ^
5 | #: W293:2:1
6 | class Foo(object):
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Safe fix
1 1 | #: Okay
@@ -23,16 +23,17 @@ W29.py:4:6: W291 [*] Trailing whitespace
6 6 | class Foo(object):
7 7 |
-W29.py:11:35: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W29.py:11:35
|
9 | #: W291:2:35
10 | '''multiline
11 | string with trailing whitespace'''
- | ^^^ W291
+ | ^^^
12 | #: W291 W292 noeol
13 | x = 1
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Safe fix
8 8 | bang = 12
@@ -44,16 +45,17 @@ W29.py:11:35: W291 [*] Trailing whitespace
13 13 | x = 1
14 14 | #: W191 W292 noeol
-W29.py:13:6: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W29.py:13:6
|
11 | string with trailing whitespace'''
12 | #: W291 W292 noeol
13 | x = 1
- | ^^^ W291
+ | ^^^
14 | #: W191 W292 noeol
15 | if False:
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Safe fix
10 10 | '''multiline
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W291.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W291.py.snap
index 0f59c043ac..a349223f9c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W291.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W291_W291.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W291.py:1:23: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W291.py:1:23
|
1 | '''trailing whitespace
- | ^ W291
+ | ^
2 | inside a multiline string'''
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Unsafe fix
1 |-'''trailing whitespace
@@ -16,15 +17,16 @@ W291.py:1:23: W291 [*] Trailing whitespace
3 3 |
4 4 | f'''trailing whitespace
-W291.py:4:24: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W291.py:4:24
|
2 | inside a multiline string'''
3 |
4 | f'''trailing whitespace
- | ^ W291
+ | ^
5 | inside a multiline f-string'''
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Unsafe fix
1 1 | '''trailing whitespace
@@ -36,15 +38,16 @@ W291.py:4:24: W291 [*] Trailing whitespace
6 6 |
7 7 | # Trailing whitespace after `{`
-W291.py:8:8: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W291.py:8:8
|
7 | # Trailing whitespace after `{`
8 | f'abc {
- | ^ W291
+ | ^
9 | 1 + 2
10 | }'
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Safe fix
5 5 | inside a multiline f-string'''
@@ -56,15 +59,16 @@ W291.py:8:8: W291 [*] Trailing whitespace
10 10 | }'
11 11 |
-W291.py:14:10: W291 [*] Trailing whitespace
+W291 [*] Trailing whitespace
+ --> W291.py:14:10
|
12 | # Trailing whitespace after `2`
13 | f'abc {
14 | 1 + 2
- | ^ W291
+ | ^
15 | }'
|
- = help: Remove trailing whitespace
+help: Remove trailing whitespace
ℹ Safe fix
11 11 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap
index 93800dbe5b..404fb9c25e 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W292_0.py:2:9: W292 [*] No newline at end of file
+W292 [*] No newline at end of file
+ --> W292_0.py:2:9
|
1 | def fn() -> None:
2 | pass
- | ^ W292
+ | ^
|
- = help: Add trailing newline
+help: Add trailing newline
ℹ Safe fix
1 1 | def fn() -> None:
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W29.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W29.py.snap
index 4818cd126b..03b3a090bc 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W29.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W29.py.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-W29.py:7:1: W293 [*] Blank line contains whitespace
+W293 [*] Blank line contains whitespace
+ --> W29.py:7:1
|
5 | #: W293:2:1
6 | class Foo(object):
7 |
- | ^^^^ W293
+ | ^^^^
8 | bang = 12
9 | #: W291:2:35
|
- = help: Remove whitespace from blank line
+help: Remove whitespace from blank line
ℹ Safe fix
4 4 | print
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap
index f94b873549..7fc13aa2f1 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-W293.py:4:1: W293 [*] Blank line contains whitespace
+W293 [*] Blank line contains whitespace
+ --> W293.py:4:1
|
2 | class Chassis(RobotModuleTemplate):
3 | """底盘信息推送控制
4 |
- | ^^^^ W293
+ | ^^^^
5 | """\
|
- = help: Remove whitespace from blank line
+help: Remove whitespace from blank line
ℹ Unsafe fix
1 1 | # See: https://github.com/astral-sh/ruff/issues/9323
@@ -22,14 +22,15 @@ W293.py:4:1: W293 [*] Blank line contains whitespace
6 6 |
7 7 |
-W293.py:10:1: W293 [*] Blank line contains whitespace
+W293 [*] Blank line contains whitespace
+ --> W293.py:10:1
|
8 | """""" \
9 | \
10 |
- | ^^^^ W293
+ | ^^^^
|
- = help: Remove whitespace from blank line
+help: Remove whitespace from blank line
ℹ Safe fix
5 5 | """\
@@ -43,15 +44,16 @@ W293.py:10:1: W293 [*] Blank line contains whitespace
12 10 |
13 11 | "abc\
-W293.py:16:1: W293 [*] Blank line contains whitespace
+W293 [*] Blank line contains whitespace
+ --> W293.py:16:1
|
14 | " \
15 | \
16 |
- | ^^^^ W293
+ | ^^^^
17 | '''blank line with whitespace
|
- = help: Remove whitespace from blank line
+help: Remove whitespace from blank line
ℹ Safe fix
11 11 |
@@ -65,14 +67,15 @@ W293.py:16:1: W293 [*] Blank line contains whitespace
18 16 |
19 17 | inside a multiline string'''
-W293.py:18:1: W293 [*] Blank line contains whitespace
+W293 [*] Blank line contains whitespace
+ --> W293.py:18:1
|
17 | '''blank line with whitespace
18 |
- | ^ W293
+ | ^
19 | inside a multiline string'''
|
- = help: Remove whitespace from blank line
+help: Remove whitespace from blank line
ℹ Unsafe fix
15 15 | \
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap
index 8da92669c3..6b64fdb629 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W605_0.py:2:10: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:2:10
|
1 | #: W605:1:10
2 | regex = '\.png$'
- | ^^ W605
+ | ^^
3 |
4 | #: W605:2:1
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
1 1 | #: W605:1:10
@@ -19,15 +20,16 @@ W605_0.py:2:10: W605 [*] Invalid escape sequence: `\.`
4 4 | #: W605:2:1
5 5 | regex = '''
-W605_0.py:6:1: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:6:1
|
4 | #: W605:2:1
5 | regex = '''
6 | \.png$
- | ^^ W605
+ | ^^
7 | '''
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
2 2 | regex = '\.png$'
@@ -39,15 +41,16 @@ W605_0.py:6:1: W605 [*] Invalid escape sequence: `\.`
7 7 | '''
8 8 |
-W605_0.py:11:6: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_0.py:11:6
|
9 | #: W605:2:6
10 | f(
11 | '\_'
- | ^^ W605
+ | ^^
12 | )
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
8 8 |
@@ -59,16 +62,17 @@ W605_0.py:11:6: W605 [*] Invalid escape sequence: `\_`
13 13 |
14 14 | #: W605:4:6
-W605_0.py:18:6: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_0.py:18:6
|
16 | multi-line
17 | literal
18 | with \_ somewhere
- | ^^ W605
+ | ^^
19 | in the middle
20 | """
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
12 12 | )
@@ -80,13 +84,14 @@ W605_0.py:18:6: W605 [*] Invalid escape sequence: `\_`
17 17 | literal
18 18 | with \_ somewhere
-W605_0.py:23:39: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_0.py:23:39
|
22 | #: W605:1:38
23 | value = 'new line\nand invalid escape \_ here'
- | ^^ W605
+ | ^^
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
20 20 | """
@@ -98,16 +103,17 @@ W605_0.py:23:39: W605 [*] Invalid escape sequence: `\_`
25 25 |
26 26 | def f():
-W605_0.py:28:12: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:28:12
|
26 | def f():
27 | #: W605:1:11
28 | return'\.png$'
- | ^^ W605
+ | ^^
29 |
30 | #: Okay
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
25 25 |
@@ -119,16 +125,17 @@ W605_0.py:28:12: W605 [*] Invalid escape sequence: `\.`
30 30 | #: Okay
31 31 | regex = r'\.png$'
-W605_0.py:45:12: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_0.py:45:12
|
43 | ''' # noqa
44 |
45 | regex = '\\\_'
- | ^^ W605
+ | ^^
46 |
47 | #: W605:1:7
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
42 42 | \w
@@ -140,15 +147,16 @@ W605_0.py:45:12: W605 [*] Invalid escape sequence: `\_`
47 47 | #: W605:1:7
48 48 | u'foo\ bar'
-W605_0.py:48:6: W605 [*] Invalid escape sequence: `\ `
+W605 [*] Invalid escape sequence: `\ `
+ --> W605_0.py:48:6
|
47 | #: W605:1:7
48 | u'foo\ bar'
- | ^^ W605
+ | ^^
49 |
50 | #: W605:1:13
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
45 45 | regex = '\\\_'
@@ -160,15 +168,16 @@ W605_0.py:48:6: W605 [*] Invalid escape sequence: `\ `
50 50 | #: W605:1:13
51 51 | (
-W605_0.py:53:9: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:53:9
|
51 | (
52 | "foo \
53 | bar \. baz"
- | ^^ W605
+ | ^^
54 | )
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
50 50 | #: W605:1:13
@@ -180,15 +189,16 @@ W605_0.py:53:9: W605 [*] Invalid escape sequence: `\.`
55 55 |
56 56 | #: W605:1:6
-W605_0.py:57:6: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:57:6
|
56 | #: W605:1:6
57 | "foo \. bar \t"
- | ^^ W605
+ | ^^
58 |
59 | #: W605:1:13
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
54 54 | )
@@ -200,13 +210,14 @@ W605_0.py:57:6: W605 [*] Invalid escape sequence: `\.`
59 59 | #: W605:1:13
60 60 | "foo \t bar \."
-W605_0.py:60:13: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_0.py:60:13
|
59 | #: W605:1:13
60 | "foo \t bar \."
- | ^^ W605
+ | ^^
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
57 57 | "foo \. bar \t"
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap
index 4ca58ba4ec..efee7333ef 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W605_1.py:4:11: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_1.py:4:11
|
3 | #: W605:1:10
4 | regex = f'\.png$'
- | ^^ W605
+ | ^^
5 |
6 | #: W605:2:1
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
1 1 | # Same as `W605_0.py` but using f-strings and t-strings instead.
@@ -21,15 +22,16 @@ W605_1.py:4:11: W605 [*] Invalid escape sequence: `\.`
6 6 | #: W605:2:1
7 7 | regex = f'''
-W605_1.py:8:1: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_1.py:8:1
|
6 | #: W605:2:1
7 | regex = f'''
8 | \.png$
- | ^^ W605
+ | ^^
9 | '''
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
4 4 | regex = f'\.png$'
@@ -41,15 +43,16 @@ W605_1.py:8:1: W605 [*] Invalid escape sequence: `\.`
9 9 | '''
10 10 |
-W605_1.py:13:7: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:13:7
|
11 | #: W605:2:6
12 | f(
13 | f'\_'
- | ^^ W605
+ | ^^
14 | )
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
10 10 |
@@ -61,16 +64,17 @@ W605_1.py:13:7: W605 [*] Invalid escape sequence: `\_`
15 15 |
16 16 | #: W605:4:6
-W605_1.py:20:6: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:20:6
|
18 | multi-line
19 | literal
20 | with \_ somewhere
- | ^^ W605
+ | ^^
21 | in the middle
22 | """
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
14 14 | )
@@ -82,13 +86,14 @@ W605_1.py:20:6: W605 [*] Invalid escape sequence: `\_`
19 19 | literal
20 20 | with \_ somewhere
-W605_1.py:25:40: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:25:40
|
24 | #: W605:1:38
25 | value = f'new line\nand invalid escape \_ here'
- | ^^ W605
+ | ^^
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
22 22 | """
@@ -100,16 +105,17 @@ W605_1.py:25:40: W605 [*] Invalid escape sequence: `\_`
27 27 |
28 28 | #: Okay
-W605_1.py:43:13: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:43:13
|
41 | ''' # noqa
42 |
43 | regex = f'\\\_'
- | ^^ W605
+ | ^^
44 | value = f'\{{1}}'
45 | value = f'\{1}'
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
40 40 | \w
@@ -121,15 +127,16 @@ W605_1.py:43:13: W605 [*] Invalid escape sequence: `\_`
45 45 | value = f'\{1}'
46 46 | value = f'{1:\}'
-W605_1.py:44:11: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:44:11
|
43 | regex = f'\\\_'
44 | value = f'\{{1}}'
- | ^^ W605
+ | ^^
45 | value = f'\{1}'
46 | value = f'{1:\}'
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
41 41 | ''' # noqa
@@ -141,16 +148,17 @@ W605_1.py:44:11: W605 [*] Invalid escape sequence: `\{`
46 46 | value = f'{1:\}'
47 47 | value = f"{f"\{1}"}"
-W605_1.py:45:11: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:45:11
|
43 | regex = f'\\\_'
44 | value = f'\{{1}}'
45 | value = f'\{1}'
- | ^^ W605
+ | ^^
46 | value = f'{1:\}'
47 | value = f"{f"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
42 42 |
@@ -162,16 +170,17 @@ W605_1.py:45:11: W605 [*] Invalid escape sequence: `\{`
47 47 | value = f"{f"\{1}"}"
48 48 | value = rf"{f"\{1}"}"
-W605_1.py:46:14: W605 [*] Invalid escape sequence: `\}`
+W605 [*] Invalid escape sequence: `\}`
+ --> W605_1.py:46:14
|
44 | value = f'\{{1}}'
45 | value = f'\{1}'
46 | value = f'{1:\}'
- | ^^ W605
+ | ^^
47 | value = f"{f"\{1}"}"
48 | value = rf"{f"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
43 43 | regex = f'\\\_'
@@ -183,15 +192,16 @@ W605_1.py:46:14: W605 [*] Invalid escape sequence: `\}`
48 48 | value = rf"{f"\{1}"}"
49 49 |
-W605_1.py:47:14: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:47:14
|
45 | value = f'\{1}'
46 | value = f'{1:\}'
47 | value = f"{f"\{1}"}"
- | ^^ W605
+ | ^^
48 | value = rf"{f"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
44 44 | value = f'\{{1}}'
@@ -203,16 +213,17 @@ W605_1.py:47:14: W605 [*] Invalid escape sequence: `\{`
49 49 |
50 50 | # Okay
-W605_1.py:48:15: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:48:15
|
46 | value = f'{1:\}'
47 | value = f"{f"\{1}"}"
48 | value = rf"{f"\{1}"}"
- | ^^ W605
+ | ^^
49 |
50 | # Okay
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
45 45 | value = f'\{1}'
@@ -224,15 +235,16 @@ W605_1.py:48:15: W605 [*] Invalid escape sequence: `\{`
50 50 | # Okay
51 51 | value = rf'\{{1}}'
-W605_1.py:57:9: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:57:9
|
56 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
57 | f"{{}}+-\d"
- | ^^ W605
+ | ^^
58 | f"\n{{}}+-\d+"
59 | f"\n{{}}�+-\d+"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
54 54 | value = f"{rf"\{1}"}"
@@ -244,15 +256,16 @@ W605_1.py:57:9: W605 [*] Invalid escape sequence: `\d`
59 59 | f"\n{{}}�+-\d+"
60 60 |
-W605_1.py:58:11: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:58:11
|
56 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
57 | f"{{}}+-\d"
58 | f"\n{{}}+-\d+"
- | ^^ W605
+ | ^^
59 | f"\n{{}}�+-\d+"
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
55 55 |
@@ -264,16 +277,17 @@ W605_1.py:58:11: W605 [*] Invalid escape sequence: `\d`
60 60 |
61 61 | # See https://github.com/astral-sh/ruff/issues/11491
-W605_1.py:59:12: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:59:12
|
57 | f"{{}}+-\d"
58 | f"\n{{}}+-\d+"
59 | f"\n{{}}�+-\d+"
- | ^^ W605
+ | ^^
60 |
61 | # See https://github.com/astral-sh/ruff/issues/11491
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
56 56 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
@@ -285,16 +299,17 @@ W605_1.py:59:12: W605 [*] Invalid escape sequence: `\d`
61 61 | # See https://github.com/astral-sh/ruff/issues/11491
62 62 | total = 10
-W605_1.py:65:31: W605 [*] Invalid escape sequence: `\I`
+W605 [*] Invalid escape sequence: `\I`
+ --> W605_1.py:65:31
|
63 | ok = 7
64 | incomplete = 3
65 | s = f"TOTAL: {total}\nOK: {ok}\INCOMPLETE: {incomplete}\n"
- | ^^ W605
+ | ^^
66 |
67 | # Debug text (should trigger)
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
62 62 | total = 10
@@ -306,13 +321,14 @@ W605_1.py:65:31: W605 [*] Invalid escape sequence: `\I`
67 67 | # Debug text (should trigger)
68 68 | t = f"{'\InHere'=}"
-W605_1.py:68:9: W605 [*] Invalid escape sequence: `\I`
+W605 [*] Invalid escape sequence: `\I`
+ --> W605_1.py:68:9
|
67 | # Debug text (should trigger)
68 | t = f"{'\InHere'=}"
- | ^^ W605
+ | ^^
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
65 65 | s = f"TOTAL: {total}\nOK: {ok}\INCOMPLETE: {incomplete}\n"
@@ -324,15 +340,16 @@ W605_1.py:68:9: W605 [*] Invalid escape sequence: `\I`
70 70 |
71 71 |
-W605_1.py:73:11: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_1.py:73:11
|
72 | #: W605:1:10
73 | regex = t'\.png$'
- | ^^ W605
+ | ^^
74 |
75 | #: W605:2:1
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
70 70 |
@@ -344,15 +361,16 @@ W605_1.py:73:11: W605 [*] Invalid escape sequence: `\.`
75 75 | #: W605:2:1
76 76 | regex = t'''
-W605_1.py:77:1: W605 [*] Invalid escape sequence: `\.`
+W605 [*] Invalid escape sequence: `\.`
+ --> W605_1.py:77:1
|
75 | #: W605:2:1
76 | regex = t'''
77 | \.png$
- | ^^ W605
+ | ^^
78 | '''
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
73 73 | regex = t'\.png$'
@@ -364,15 +382,16 @@ W605_1.py:77:1: W605 [*] Invalid escape sequence: `\.`
78 78 | '''
79 79 |
-W605_1.py:82:7: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:82:7
|
80 | #: W605:2:6
81 | f(
82 | t'\_'
- | ^^ W605
+ | ^^
83 | )
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
79 79 |
@@ -384,16 +403,17 @@ W605_1.py:82:7: W605 [*] Invalid escape sequence: `\_`
84 84 |
85 85 | #: W605:4:6
-W605_1.py:89:6: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:89:6
|
87 | multi-line
88 | literal
89 | with \_ somewhere
- | ^^ W605
+ | ^^
90 | in the middle
91 | """
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
83 83 | )
@@ -405,13 +425,14 @@ W605_1.py:89:6: W605 [*] Invalid escape sequence: `\_`
88 88 | literal
89 89 | with \_ somewhere
-W605_1.py:94:40: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:94:40
|
93 | #: W605:1:38
94 | value = t'new line\nand invalid escape \_ here'
- | ^^ W605
+ | ^^
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
91 91 | """
@@ -423,15 +444,16 @@ W605_1.py:94:40: W605 [*] Invalid escape sequence: `\_`
96 96 |
97 97 | #: Okay
-W605_1.py:109:1: W605 [*] Invalid escape sequence: `\w`
+W605 [*] Invalid escape sequence: `\w`
+ --> W605_1.py:109:1
|
107 | regex = t'\w' # noqa
108 | regex = t'''
109 | \w
- | ^^ W605
+ | ^^
110 | ''' # noqa
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
105 105 | '''
@@ -443,16 +465,17 @@ W605_1.py:109:1: W605 [*] Invalid escape sequence: `\w`
110 110 | ''' # noqa
111 111 |
-W605_1.py:112:13: W605 [*] Invalid escape sequence: `\_`
+W605 [*] Invalid escape sequence: `\_`
+ --> W605_1.py:112:13
|
110 | ''' # noqa
111 |
112 | regex = t'\\\_'
- | ^^ W605
+ | ^^
113 | value = t'\{{1}}'
114 | value = t'\{1}'
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
109 109 | \w
@@ -464,15 +487,16 @@ W605_1.py:112:13: W605 [*] Invalid escape sequence: `\_`
114 114 | value = t'\{1}'
115 115 | value = t'{1:\}'
-W605_1.py:113:11: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:113:11
|
112 | regex = t'\\\_'
113 | value = t'\{{1}}'
- | ^^ W605
+ | ^^
114 | value = t'\{1}'
115 | value = t'{1:\}'
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
110 110 | ''' # noqa
@@ -484,16 +508,17 @@ W605_1.py:113:11: W605 [*] Invalid escape sequence: `\{`
115 115 | value = t'{1:\}'
116 116 | value = t"{t"\{1}"}"
-W605_1.py:114:11: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:114:11
|
112 | regex = t'\\\_'
113 | value = t'\{{1}}'
114 | value = t'\{1}'
- | ^^ W605
+ | ^^
115 | value = t'{1:\}'
116 | value = t"{t"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
111 111 |
@@ -505,16 +530,17 @@ W605_1.py:114:11: W605 [*] Invalid escape sequence: `\{`
116 116 | value = t"{t"\{1}"}"
117 117 | value = rt"{t"\{1}"}"
-W605_1.py:115:14: W605 [*] Invalid escape sequence: `\}`
+W605 [*] Invalid escape sequence: `\}`
+ --> W605_1.py:115:14
|
113 | value = t'\{{1}}'
114 | value = t'\{1}'
115 | value = t'{1:\}'
- | ^^ W605
+ | ^^
116 | value = t"{t"\{1}"}"
117 | value = rt"{t"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
112 112 | regex = t'\\\_'
@@ -526,15 +552,16 @@ W605_1.py:115:14: W605 [*] Invalid escape sequence: `\}`
117 117 | value = rt"{t"\{1}"}"
118 118 |
-W605_1.py:116:14: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:116:14
|
114 | value = t'\{1}'
115 | value = t'{1:\}'
116 | value = t"{t"\{1}"}"
- | ^^ W605
+ | ^^
117 | value = rt"{t"\{1}"}"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
113 113 | value = t'\{{1}}'
@@ -546,16 +573,17 @@ W605_1.py:116:14: W605 [*] Invalid escape sequence: `\{`
118 118 |
119 119 | # Okay
-W605_1.py:117:15: W605 [*] Invalid escape sequence: `\{`
+W605 [*] Invalid escape sequence: `\{`
+ --> W605_1.py:117:15
|
115 | value = t'{1:\}'
116 | value = t"{t"\{1}"}"
117 | value = rt"{t"\{1}"}"
- | ^^ W605
+ | ^^
118 |
119 | # Okay
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
114 114 | value = t'\{1}'
@@ -567,15 +595,16 @@ W605_1.py:117:15: W605 [*] Invalid escape sequence: `\{`
119 119 | # Okay
120 120 | value = rt'\{{1}}'
-W605_1.py:126:9: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:126:9
|
125 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
126 | t"{{}}+-\d"
- | ^^ W605
+ | ^^
127 | t"\n{{}}+-\d+"
128 | t"\n{{}}�+-\d+"
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
123 123 | value = t"{rt"\{1}"}"
@@ -587,15 +616,16 @@ W605_1.py:126:9: W605 [*] Invalid escape sequence: `\d`
128 128 | t"\n{{}}�+-\d+"
129 129 |
-W605_1.py:127:11: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:127:11
|
125 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
126 | t"{{}}+-\d"
127 | t"\n{{}}+-\d+"
- | ^^ W605
+ | ^^
128 | t"\n{{}}�+-\d+"
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
124 124 |
@@ -607,16 +637,17 @@ W605_1.py:127:11: W605 [*] Invalid escape sequence: `\d`
129 129 |
130 130 | # See https://github.com/astral-sh/ruff/issues/11491
-W605_1.py:128:12: W605 [*] Invalid escape sequence: `\d`
+W605 [*] Invalid escape sequence: `\d`
+ --> W605_1.py:128:12
|
126 | t"{{}}+-\d"
127 | t"\n{{}}+-\d+"
128 | t"\n{{}}�+-\d+"
- | ^^ W605
+ | ^^
129 |
130 | # See https://github.com/astral-sh/ruff/issues/11491
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
125 125 | # Regression tests for https://github.com/astral-sh/ruff/issues/10434
@@ -628,16 +659,17 @@ W605_1.py:128:12: W605 [*] Invalid escape sequence: `\d`
130 130 | # See https://github.com/astral-sh/ruff/issues/11491
131 131 | total = 10
-W605_1.py:134:31: W605 [*] Invalid escape sequence: `\I`
+W605 [*] Invalid escape sequence: `\I`
+ --> W605_1.py:134:31
|
132 | ok = 7
133 | incomplete = 3
134 | s = t"TOTAL: {total}\nOK: {ok}\INCOMPLETE: {incomplete}\n"
- | ^^ W605
+ | ^^
135 |
136 | # Debug text (should trigger)
|
- = help: Add backslash to escape sequence
+help: Add backslash to escape sequence
ℹ Safe fix
131 131 | total = 10
@@ -649,13 +681,14 @@ W605_1.py:134:31: W605 [*] Invalid escape sequence: `\I`
136 136 | # Debug text (should trigger)
137 137 | t = t"{'\InHere'=}"
-W605_1.py:137:9: W605 [*] Invalid escape sequence: `\I`
+W605 [*] Invalid escape sequence: `\I`
+ --> W605_1.py:137:9
|
136 | # Debug text (should trigger)
137 | t = t"{'\InHere'=}"
- | ^^ W605
+ | ^^
|
- = help: Use a raw string literal
+help: Use a raw string literal
ℹ Safe fix
134 134 | s = t"TOTAL: {total}\nOK: {ok}\INCOMPLETE: {incomplete}\n"
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E301_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E301_notebook.snap
index b8baafb5cd..e7db6cbc5d 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E301_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E301_notebook.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E30.ipynb:13:5: E301 [*] Expected 1 blank line, found 0
+E301 [*] Expected 1 blank line, found 0
+ --> E30.ipynb:13:5
|
11 | def method(cls) -> None:
12 | pass
13 | @classmethod
- | ^ E301
+ | ^
14 | def cls_method(cls) -> None:
15 | pass
|
- = help: Add missing blank line
+help: Add missing blank line
ℹ Safe fix
10 10 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E302_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E302_notebook.snap
index 3a2fa4505d..8a5cfb44fb 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E302_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E302_notebook.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30.ipynb:21:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30.ipynb:21:1
|
19 | pass
20 |
21 | def b():
- | ^^^ E302
+ | ^^^
22 | pass
23 | # end
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
18 18 | def a():
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_notebook.snap
index 2ccc9b5a56..977af3e324 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_notebook.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30.ipynb:29:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30.ipynb:29:5
|
29 | # arbitrary comment
- | ^^^^^^^^^^^^^^^^^^^ E303
+ | ^^^^^^^^^^^^^^^^^^^
30 |
31 | def inner(): # E306 not expected (pycodestyle detects E306)
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
25 25 | def fn():
@@ -19,14 +20,15 @@ E30.ipynb:29:5: E303 [*] Too many blank lines (2)
30 29 |
31 30 | def inner(): # E306 not expected (pycodestyle detects E306)
-E30.ipynb:39:1: E303 [*] Too many blank lines (4)
+E303 [*] Too many blank lines (4)
+ --> E30.ipynb:39:1
|
39 | def fn():
- | ^^^ E303
+ | ^^^
40 | pass
41 | # end
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
34 34 | # E303
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_typing_stub.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_typing_stub.snap
index b302d784da..c8f3e76104 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_typing_stub.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E303_typing_stub.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E30.pyi:17:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30.pyi:17:1
|
17 | def grouped1(): ...
- | ^^^ E303
+ | ^^^
18 | def grouped2(): ...
19 | def grouped3( ): ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
13 13 | @overload
@@ -20,14 +20,15 @@ E30.pyi:17:1: E303 [*] Too many blank lines (2)
18 17 | def grouped2(): ...
19 18 | def grouped3( ): ...
-E30.pyi:22:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30.pyi:22:1
|
22 | class BackendProxy:
- | ^^^^^ E303
+ | ^^^^^
23 | backend_module: str
24 | backend_object: str | None
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
18 18 | def grouped2(): ...
@@ -38,13 +39,14 @@ E30.pyi:22:1: E303 [*] Too many blank lines (2)
23 22 | backend_module: str
24 23 | backend_object: str | None
-E30.pyi:35:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30.pyi:35:5
|
35 | def ungrouped(): ...
- | ^^^ E303
+ | ^^^
36 | a = "test"
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
31 31 |
@@ -55,14 +57,15 @@ E30.pyi:35:5: E303 [*] Too many blank lines (2)
36 35 | a = "test"
37 36 |
-E30.pyi:43:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30.pyi:43:1
|
43 | def outer():
- | ^^^ E303
+ | ^^^
44 | def inner():
45 | pass
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
39 39 | pass
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_notebook.snap
index 39fbc5b80f..3d9f4f8434 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_notebook.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30.ipynb:45:1: E304 [*] Blank lines found after function decorator (1)
+E304 [*] Blank lines found after function decorator (1)
+ --> E30.ipynb:45:1
|
43 | @decorator
44 |
45 | def function():
- | ^^^ E304
+ | ^^^
46 | pass
47 | # end
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
41 41 | # end
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap
index 49ab3a3246..5b83ab47b2 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E30.pyi:32:5: E304 [*] Blank lines found after function decorator (1)
+E304 [*] Blank lines found after function decorator (1)
+ --> E30.pyi:32:5
|
30 | @decorated
31 |
32 | def with_blank_line(): ...
- | ^^^ E304
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
28 28 | def grouped2(): ...
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E305_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E305_notebook.snap
index ef27833ff3..250640539c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E305_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E305_notebook.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E30.ipynb:55:1: E305 [*] Expected 2 blank lines after class or function definition, found (1)
+E305 [*] Expected 2 blank lines after class or function definition, found (1)
+ --> E30.ipynb:55:1
|
54 | # another comment
55 | fn()
- | ^^ E305
+ | ^^
56 | # end
57 | # E306:3:5
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
52 52 | # comment
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E306_notebook.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E306_notebook.snap
index a5675e1a55..342b178c56 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E306_notebook.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E306_notebook.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-E30.ipynb:60:5: E306 [*] Expected 1 blank line before a nested definition, found 0
+E306 [*] Expected 1 blank line before a nested definition, found 0
+ --> E30.ipynb:60:5
|
58 | def a():
59 | x = 1
60 | def b():
- | ^^^ E306
+ | ^^^
61 | pass
62 | # end
|
- = help: Add missing blank line
+help: Add missing blank line
ℹ Safe fix
57 57 | # E306:3:5
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap
index fa3511086f..8a04a07b58 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -21,16 +22,17 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
6 3 |
7 4 |
-E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:23:1
|
21 | abcd.foo()
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
- | ^^^ E302
+ | ^^^
24 |
25 | if TYPE_CHECKING:
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
20 20 |
@@ -41,7 +43,8 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
24 25 |
25 26 | if TYPE_CHECKING:
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -49,9 +52,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -63,15 +66,16 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:35:1
|
33 | abcd.foo()
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
36 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
32 32 |
@@ -82,15 +86,16 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
36 37 | ...
37 38 |
-E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:41:1
|
39 | from typing_extensions import TypeAlias
40 |
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
42 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
38 38 | if TYPE_CHECKING:
@@ -101,14 +106,15 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
42 43 | ...
43 44 |
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
59 59 |
@@ -117,14 +123,15 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
62 |+
62 63 | class MissingCommand(TypeError): ... # noqa: N818
-E30_isort.py:62:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:62:1
|
60 | from typing import Any, Sequence
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E302
+ | ^^^^^
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
59 59 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap
index e66c54a48d..9c480c19a2 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -24,16 +25,17 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
9 4 |
10 5 |
-E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:23:1
|
21 | abcd.foo()
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
- | ^^^ E302
+ | ^^^
24 |
25 | if TYPE_CHECKING:
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
20 20 |
@@ -44,7 +46,8 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
24 25 |
25 26 | if TYPE_CHECKING:
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -52,9 +55,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -66,15 +69,16 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:35:1
|
33 | abcd.foo()
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
36 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
32 32 |
@@ -85,15 +89,16 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
36 37 | ...
37 38 |
-E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:41:1
|
39 | from typing_extensions import TypeAlias
40 |
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
42 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
38 38 | if TYPE_CHECKING:
@@ -104,14 +109,15 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
42 43 | ...
43 44 |
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
58 58 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap
index 9434c2cc11..5c84b8e63e 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -23,16 +24,17 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
8 5 | class MissingCommand(TypeError): ... # noqa: N818
9 6 |
-E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:23:1
|
21 | abcd.foo()
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
- | ^^^ E302
+ | ^^^
24 |
25 | if TYPE_CHECKING:
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
20 20 |
@@ -43,7 +45,8 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
24 25 |
25 26 | if TYPE_CHECKING:
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -51,9 +54,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -65,15 +68,16 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:35:1
|
33 | abcd.foo()
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
36 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
32 32 |
@@ -84,15 +88,16 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
36 37 | ...
37 38 |
-E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:41:1
|
39 | from typing_extensions import TypeAlias
40 |
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
42 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
38 38 | if TYPE_CHECKING:
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap
index 1c6425457e..b3900e15ed 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
2 2 |
@@ -26,12 +27,13 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
9 12 |
10 13 |
-E30_isort.py:8:1: E302 [*] Expected 4 blank lines, found 2
+E302 [*] Expected 4 blank lines, found 2
+ --> E30_isort.py:8:1
|
8 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E302
+ | ^^^^^
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
5 5 | from typing import Any, Sequence
@@ -43,16 +45,17 @@ E30_isort.py:8:1: E302 [*] Expected 4 blank lines, found 2
9 11 |
10 12 |
-E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:23:1
|
21 | abcd.foo()
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
- | ^^^ E302
+ | ^^^
24 |
25 | if TYPE_CHECKING:
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
20 20 |
@@ -63,7 +66,8 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
24 25 |
25 26 | if TYPE_CHECKING:
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -71,9 +75,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -85,15 +89,16 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:35:1
|
33 | abcd.foo()
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
36 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
32 32 |
@@ -104,15 +109,16 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
36 37 | ...
37 38 |
-E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
+E302 [*] Expected 2 blank lines, found 1
+ --> E30_isort.py:41:1
|
39 | from typing_extensions import TypeAlias
40 |
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
- | ^^^ E302
+ | ^^^
42 | ...
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
38 38 | if TYPE_CHECKING:
@@ -123,14 +129,15 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
42 43 | ...
43 44 |
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
59 59 |
@@ -141,14 +148,15 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
64 |+
62 65 | class MissingCommand(TypeError): ... # noqa: N818
-E30_isort.py:62:1: E302 [*] Expected 4 blank lines, found 1
+E302 [*] Expected 4 blank lines, found 1
+ --> E30_isort.py:62:1
|
60 | from typing import Any, Sequence
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E302
+ | ^^^^^
|
- = help: Add missing blank line(s)
+help: Add missing blank line(s)
ℹ Safe fix
59 59 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap
index dc10a907bc..941e55ca08 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.pyi:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -23,12 +24,13 @@ E30_isort.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted
8 4 | class MissingCommand(TypeError): ... # noqa: N818
9 5 |
-E30_isort.pyi:5:1: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.pyi:5:1
|
5 | from typing import Any, Sequence
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
1 1 | import json
@@ -39,12 +41,13 @@ E30_isort.pyi:5:1: E303 [*] Too many blank lines (3)
6 4 |
7 5 |
-E30_isort.pyi:8:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:8:1
|
8 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E303
+ | ^^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
4 4 |
@@ -55,14 +58,15 @@ E30_isort.pyi:8:1: E303 [*] Too many blank lines (2)
9 8 |
10 9 |
-E30_isort.pyi:11:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:11:1
|
11 | class BackendProxy:
- | ^^^^^ E303
+ | ^^^^^
12 | backend_module: str
13 | backend_object: str | None
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
7 7 |
@@ -73,13 +77,14 @@ E30_isort.pyi:11:1: E303 [*] Too many blank lines (2)
12 11 | backend_module: str
13 12 | backend_object: str | None
-E30_isort.pyi:17:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:17:1
|
17 | if __name__ == "__main__":
- | ^^ E303
+ | ^^
18 | import abcd
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
13 13 | backend_object: str | None
@@ -90,14 +95,15 @@ E30_isort.pyi:17:1: E303 [*] Too many blank lines (2)
18 17 | import abcd
19 18 |
-E30_isort.pyi:21:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:21:5
|
21 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
17 17 | if __name__ == "__main__":
@@ -108,7 +114,8 @@ E30_isort.pyi:21:5: E303 [*] Too many blank lines (2)
22 21 |
23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
-E30_isort.pyi:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.pyi:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -116,9 +123,9 @@ E30_isort.pyi:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -130,12 +137,13 @@ E30_isort.pyi:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.pyi:30:5: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.pyi:30:5
|
30 | from typing_extensions import TypeAlias
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -147,14 +155,15 @@ E30_isort.pyi:30:5: E303 [*] Too many blank lines (3)
31 29 |
32 30 |
-E30_isort.pyi:33:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:33:5
|
33 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
29 29 |
@@ -165,12 +174,13 @@ E30_isort.pyi:33:5: E303 [*] Too many blank lines (2)
34 33 |
35 34 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
-E30_isort.pyi:45:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:45:1
|
45 | def _exit(self) -> None: ...
- | ^^^ E303
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
41 41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
@@ -181,12 +191,13 @@ E30_isort.pyi:45:1: E303 [*] Too many blank lines (2)
46 45 |
47 46 |
-E30_isort.pyi:48:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:48:1
|
48 | def _optional_commands(self) -> dict[str, bool]: ...
- | ^^^ E303
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
44 44 |
@@ -197,12 +208,13 @@ E30_isort.pyi:48:1: E303 [*] Too many blank lines (2)
49 48 |
50 49 |
-E30_isort.pyi:51:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:51:1
|
51 | def run(argv: Sequence[str]) -> int: ...
- | ^^^ E303
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
47 47 |
@@ -213,12 +225,13 @@ E30_isort.pyi:51:1: E303 [*] Too many blank lines (2)
52 51 |
53 52 |
-E30_isort.pyi:54:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:54:1
|
54 | def read_line(fd: int = 0) -> bytearray: ...
- | ^^^ E303
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
50 50 |
@@ -229,12 +242,13 @@ E30_isort.pyi:54:1: E303 [*] Too many blank lines (2)
55 54 |
56 55 |
-E30_isort.pyi:57:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:57:1
|
57 | def flush() -> None: ...
- | ^^^ E303
+ | ^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
53 53 |
@@ -245,14 +259,15 @@ E30_isort.pyi:57:1: E303 [*] Too many blank lines (2)
58 57 |
59 58 |
-E30_isort.pyi:60:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.pyi:60:1
|
60 | from typing import Any, Sequence
- | ^^^^ E303
+ | ^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
56 56 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap
index 89296988de..cbd129d821 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-constant_literals.py:4:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:4:4
|
2 | # Errors
3 | ###
4 | if "abc" is "def": # F632 (fix)
- | ^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^
5 | pass
6 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
1 1 | ###
@@ -22,16 +23,17 @@ constant_literals.py:4:4: F632 [*] Use `==` to compare constant literals
6 6 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711)
7 7 | pass
-constant_literals.py:6:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:6:4
|
4 | if "abc" is "def": # F632 (fix)
5 | pass
6 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711)
- | ^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^
7 | pass
8 | if None is "abc": # F632 (fix, but leaves behind unfixable E711)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
3 3 | ###
@@ -43,16 +45,17 @@ constant_literals.py:6:4: F632 [*] Use `==` to compare constant literals
8 8 | if None is "abc": # F632 (fix, but leaves behind unfixable E711)
9 9 | pass
-constant_literals.py:8:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:8:4
|
6 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711)
7 | pass
8 | if None is "abc": # F632 (fix, but leaves behind unfixable E711)
- | ^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^
9 | pass
10 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
5 5 | pass
@@ -64,16 +67,17 @@ constant_literals.py:8:4: F632 [*] Use `==` to compare constant literals
10 10 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712)
11 11 | pass
-constant_literals.py:10:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:10:4
|
8 | if None is "abc": # F632 (fix, but leaves behind unfixable E711)
9 | pass
10 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712)
- | ^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^
11 | pass
12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
7 7 | pass
@@ -85,16 +89,17 @@ constant_literals.py:10:4: F632 [*] Use `==` to compare constant literals
12 12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712)
13 13 | pass
-constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:12:4
|
10 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712)
11 | pass
12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712)
- | ^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^
13 | pass
14 | if False == None: # E711, E712 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
9 9 | pass
@@ -106,16 +111,17 @@ constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals
14 14 | if False == None: # E711, E712 (fix)
15 15 | pass
-constant_literals.py:14:4: E712 [*] Avoid equality comparisons to `False`; use `not None:` for false checks
+E712 [*] Avoid equality comparisons to `False`; use `not None:` for false checks
+ --> constant_literals.py:14:4
|
12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712)
13 | pass
14 | if False == None: # E711, E712 (fix)
- | ^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^
15 | pass
16 | if None == False: # E711, E712 (fix)
|
- = help: Replace with `not None`
+help: Replace with `not None`
ℹ Unsafe fix
11 11 | pass
@@ -127,16 +133,17 @@ constant_literals.py:14:4: E712 [*] Avoid equality comparisons to `False`; use `
16 16 | if None == False: # E711, E712 (fix)
17 17 | pass
-constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> constant_literals.py:14:13
|
12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712)
13 | pass
14 | if False == None: # E711, E712 (fix)
- | ^^^^ E711
+ | ^^^^
15 | pass
16 | if None == False: # E711, E712 (fix)
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
11 11 | pass
@@ -148,15 +155,16 @@ constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is Non
16 16 | if None == False: # E711, E712 (fix)
17 17 | pass
-constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None`
+E711 [*] Comparison to `None` should be `cond is None`
+ --> constant_literals.py:16:4
|
14 | if False == None: # E711, E712 (fix)
15 | pass
16 | if None == False: # E711, E712 (fix)
- | ^^^^ E711
+ | ^^^^
17 | pass
|
- = help: Replace with `cond is None`
+help: Replace with `cond is None`
ℹ Unsafe fix
13 13 | pass
@@ -168,15 +176,16 @@ constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None
18 18 |
19 19 | named_var = []
-constant_literals.py:16:4: E712 [*] Avoid equality comparisons to `False`; use `not None:` for false checks
+E712 [*] Avoid equality comparisons to `False`; use `not None:` for false checks
+ --> constant_literals.py:16:4
|
14 | if False == None: # E711, E712 (fix)
15 | pass
16 | if None == False: # E711, E712 (fix)
- | ^^^^^^^^^^^^^ E712
+ | ^^^^^^^^^^^^^
17 | pass
|
- = help: Replace with `not None`
+help: Replace with `not None`
ℹ Unsafe fix
13 13 | pass
@@ -188,15 +197,16 @@ constant_literals.py:16:4: E712 [*] Avoid equality comparisons to `False`; use `
18 18 |
19 19 | named_var = []
-constant_literals.py:20:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:20:4
|
19 | named_var = []
20 | if [] is []: # F632 (fix)
- | ^^^^^^^^ F632
+ | ^^^^^^^^
21 | pass
22 | if named_var is []: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
17 17 | pass
@@ -208,16 +218,17 @@ constant_literals.py:20:4: F632 [*] Use `==` to compare constant literals
22 22 | if named_var is []: # F632 (fix)
23 23 | pass
-constant_literals.py:22:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:22:4
|
20 | if [] is []: # F632 (fix)
21 | pass
22 | if named_var is []: # F632 (fix)
- | ^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^
23 | pass
24 | if [] is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
19 19 | named_var = []
@@ -229,16 +240,17 @@ constant_literals.py:22:4: F632 [*] Use `==` to compare constant literals
24 24 | if [] is named_var: # F632 (fix)
25 25 | pass
-constant_literals.py:24:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:24:4
|
22 | if named_var is []: # F632 (fix)
23 | pass
24 | if [] is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^
25 | pass
26 | if named_var is [1]: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
21 21 | pass
@@ -250,16 +262,17 @@ constant_literals.py:24:4: F632 [*] Use `==` to compare constant literals
26 26 | if named_var is [1]: # F632 (fix)
27 27 | pass
-constant_literals.py:26:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:26:4
|
24 | if [] is named_var: # F632 (fix)
25 | pass
26 | if named_var is [1]: # F632 (fix)
- | ^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^
27 | pass
28 | if [1] is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
23 23 | pass
@@ -271,16 +284,17 @@ constant_literals.py:26:4: F632 [*] Use `==` to compare constant literals
28 28 | if [1] is named_var: # F632 (fix)
29 29 | pass
-constant_literals.py:28:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:28:4
|
26 | if named_var is [1]: # F632 (fix)
27 | pass
28 | if [1] is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^
29 | pass
30 | if named_var is [i for i in [1]]: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
25 25 | pass
@@ -292,15 +306,16 @@ constant_literals.py:28:4: F632 [*] Use `==` to compare constant literals
30 30 | if named_var is [i for i in [1]]: # F632 (fix)
31 31 | pass
-constant_literals.py:30:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:30:4
|
28 | if [1] is named_var: # F632 (fix)
29 | pass
30 | if named_var is [i for i in [1]]: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
27 27 | pass
@@ -312,15 +327,16 @@ constant_literals.py:30:4: F632 [*] Use `==` to compare constant literals
32 32 |
33 33 | named_var = {}
-constant_literals.py:34:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:34:4
|
33 | named_var = {}
34 | if {} is {}: # F632 (fix)
- | ^^^^^^^^ F632
+ | ^^^^^^^^
35 | pass
36 | if named_var is {}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
31 31 | pass
@@ -332,16 +348,17 @@ constant_literals.py:34:4: F632 [*] Use `==` to compare constant literals
36 36 | if named_var is {}: # F632 (fix)
37 37 | pass
-constant_literals.py:36:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:36:4
|
34 | if {} is {}: # F632 (fix)
35 | pass
36 | if named_var is {}: # F632 (fix)
- | ^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^
37 | pass
38 | if {} is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
33 33 | named_var = {}
@@ -353,16 +370,17 @@ constant_literals.py:36:4: F632 [*] Use `==` to compare constant literals
38 38 | if {} is named_var: # F632 (fix)
39 39 | pass
-constant_literals.py:38:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:38:4
|
36 | if named_var is {}: # F632 (fix)
37 | pass
38 | if {} is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^
39 | pass
40 | if named_var is {1}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
35 35 | pass
@@ -374,16 +392,17 @@ constant_literals.py:38:4: F632 [*] Use `==` to compare constant literals
40 40 | if named_var is {1}: # F632 (fix)
41 41 | pass
-constant_literals.py:40:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:40:4
|
38 | if {} is named_var: # F632 (fix)
39 | pass
40 | if named_var is {1}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^
41 | pass
42 | if {1} is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
37 37 | pass
@@ -395,16 +414,17 @@ constant_literals.py:40:4: F632 [*] Use `==` to compare constant literals
42 42 | if {1} is named_var: # F632 (fix)
43 43 | pass
-constant_literals.py:42:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:42:4
|
40 | if named_var is {1}: # F632 (fix)
41 | pass
42 | if {1} is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^
43 | pass
44 | if named_var is {i for i in [1]}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
39 39 | pass
@@ -416,15 +436,16 @@ constant_literals.py:42:4: F632 [*] Use `==` to compare constant literals
44 44 | if named_var is {i for i in [1]}: # F632 (fix)
45 45 | pass
-constant_literals.py:44:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:44:4
|
42 | if {1} is named_var: # F632 (fix)
43 | pass
44 | if named_var is {i for i in [1]}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
41 41 | pass
@@ -436,15 +457,16 @@ constant_literals.py:44:4: F632 [*] Use `==` to compare constant literals
46 46 |
47 47 | named_var = {1: 1}
-constant_literals.py:48:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:48:4
|
47 | named_var = {1: 1}
48 | if {1: 1} is {1: 1}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^
49 | pass
50 | if named_var is {1: 1}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
45 45 | pass
@@ -456,16 +478,17 @@ constant_literals.py:48:4: F632 [*] Use `==` to compare constant literals
50 50 | if named_var is {1: 1}: # F632 (fix)
51 51 | pass
-constant_literals.py:50:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:50:4
|
48 | if {1: 1} is {1: 1}: # F632 (fix)
49 | pass
50 | if named_var is {1: 1}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^
51 | pass
52 | if {1: 1} is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
47 47 | named_var = {1: 1}
@@ -477,16 +500,17 @@ constant_literals.py:50:4: F632 [*] Use `==` to compare constant literals
52 52 | if {1: 1} is named_var: # F632 (fix)
53 53 | pass
-constant_literals.py:52:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:52:4
|
50 | if named_var is {1: 1}: # F632 (fix)
51 | pass
52 | if {1: 1} is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^
53 | pass
54 | if named_var is {1: 1}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
49 49 | pass
@@ -498,16 +522,17 @@ constant_literals.py:52:4: F632 [*] Use `==` to compare constant literals
54 54 | if named_var is {1: 1}: # F632 (fix)
55 55 | pass
-constant_literals.py:54:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:54:4
|
52 | if {1: 1} is named_var: # F632 (fix)
53 | pass
54 | if named_var is {1: 1}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^
55 | pass
56 | if {1: 1} is named_var: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
51 51 | pass
@@ -519,16 +544,17 @@ constant_literals.py:54:4: F632 [*] Use `==` to compare constant literals
56 56 | if {1: 1} is named_var: # F632 (fix)
57 57 | pass
-constant_literals.py:56:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:56:4
|
54 | if named_var is {1: 1}: # F632 (fix)
55 | pass
56 | if {1: 1} is named_var: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^
57 | pass
58 | if named_var is {i: 1 for i in [1]}: # F632 (fix)
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
53 53 | pass
@@ -540,15 +566,16 @@ constant_literals.py:56:4: F632 [*] Use `==` to compare constant literals
58 58 | if named_var is {i: 1 for i in [1]}: # F632 (fix)
59 59 | pass
-constant_literals.py:58:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> constant_literals.py:58:4
|
56 | if {1: 1} is named_var: # F632 (fix)
57 | pass
58 | if named_var is {i: 1 for i in [1]}: # F632 (fix)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
55 55 | pass
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap
index a5c5cd23e7..434e683b80 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap
@@ -1,60 +1,67 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W505.py:2:51: W505 Doc line too long (57 > 50)
+W505 Doc line too long (57 > 50)
+ --> W505.py:2:51
|
1 | #!/usr/bin/env python3
2 | """Here's a top-level docstring that's over the limit."""
- | ^^^^^^^ W505
+ | ^^^^^^^
|
-W505.py:6:51: W505 Doc line too long (56 > 50)
+W505 Doc line too long (56 > 50)
+ --> W505.py:6:51
|
5 | def f1():
6 | """Here's a docstring that's also over the limit."""
- | ^^^^^^ W505
+ | ^^^^^^
7 |
8 | x = 1 # Here's a comment that's over the limit, but it's not standalone.
|
-W505.py:10:51: W505 Doc line too long (56 > 50)
+W505 Doc line too long (56 > 50)
+ --> W505.py:10:51
|
8 | x = 1 # Here's a comment that's over the limit, but it's not standalone.
9 |
10 | # Here's a standalone comment that's over the limit.
- | ^^^^^^ W505
+ | ^^^^^^
11 |
12 | x = 2
|
-W505.py:13:51: W505 Doc line too long (94 > 50)
+W505 Doc line too long (94 > 50)
+ --> W505.py:13:51
|
12 | x = 2
13 | # Another standalone that is preceded by a newline and indent token and is over the limit.
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 | print("Here's a string that's over the limit, but it's not a docstring.")
|
-W505.py:18:51: W505 Doc line too long (61 > 50)
+W505 Doc line too long (61 > 50)
+ --> W505.py:18:51
|
18 | "This is also considered a docstring, and is over the limit."
- | ^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^
|
-W505.py:24:51: W505 Doc line too long (82 > 50)
+W505 Doc line too long (82 > 50)
+ --> W505.py:24:51
|
22 | """Here's a multi-line docstring.
23 |
24 | It's over the limit on this line, which isn't the first line in the docstring.
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | """
|
-W505.py:31:51: W505 Doc line too long (85 > 50)
+W505 Doc line too long (85 > 50)
+ --> W505.py:31:51
|
29 | """Here's a multi-line docstring.
30 |
31 | It's over the limit on this line, which isn't the first line in the docstring."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap
index 64f4347ec6..20d826c6d5 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap
@@ -1,60 +1,67 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W505_utf_8.py:2:50: W505 Doc line too long (57 > 50)
+W505 Doc line too long (57 > 50)
+ --> W505_utf_8.py:2:50
|
1 | #!/usr/bin/env python3
2 | """Here's a top-level ß9💣2ℝing that's over theß9💣2ℝ."""
- | ^^^^^^ W505
+ | ^^^^^^
|
-W505_utf_8.py:6:49: W505 Doc line too long (56 > 50)
+W505 Doc line too long (56 > 50)
+ --> W505_utf_8.py:6:49
|
5 | def f1():
6 | """Here's a ß9💣2ℝing that's also over theß9💣2ℝ."""
- | ^^^^^^ W505
+ | ^^^^^^
7 |
8 | x = 1 # Here's a comment that's over theß9💣2ℝ, but it's not standalone.
|
-W505_utf_8.py:10:51: W505 Doc line too long (56 > 50)
+W505 Doc line too long (56 > 50)
+ --> W505_utf_8.py:10:51
|
8 | x = 1 # Here's a comment that's over theß9💣2ℝ, but it's not standalone.
9 |
10 | # Here's a standalone comment that's over theß9💣2ℝ.
- | ^^^^^^ W505
+ | ^^^^^^
11 |
12 | x = 2
|
-W505_utf_8.py:13:51: W505 Doc line too long (94 > 50)
+W505 Doc line too long (94 > 50)
+ --> W505_utf_8.py:13:51
|
12 | x = 2
13 | # Another standalone that is preceded by a newline and indent token and is over theß9💣2ℝ.
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 | print("Here's a string that's over theß9💣2ℝ, but it's not a ß9💣2ℝing.")
|
-W505_utf_8.py:18:50: W505 Doc line too long (61 > 50)
+W505 Doc line too long (61 > 50)
+ --> W505_utf_8.py:18:50
|
18 | "This is also considered a ß9💣2ℝing, and is over theß9💣2ℝ."
- | ^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^
|
-W505_utf_8.py:24:50: W505 Doc line too long (82 > 50)
+W505 Doc line too long (82 > 50)
+ --> W505_utf_8.py:24:50
|
22 | """Here's a multi-line ß9💣2ℝing.
23 |
24 | It's over theß9💣2ℝ on this line, which isn't the first line in the ß9💣2ℝing.
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | """
|
-W505_utf_8.py:31:50: W505 Doc line too long (85 > 50)
+W505 Doc line too long (85 > 50)
+ --> W505_utf_8.py:31:50
|
29 | """Here's a multi-line ß9💣2ℝing.
30 |
31 | It's over theß9💣2ℝ on this line, which isn't the first line in the ß9💣2ℝing."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ W505
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E502_E502.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E502_E502.py.snap
index fe398c0aa1..851d6ec397 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E502_E502.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E502_E502.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E502.py:9:9: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:9:9
|
7 | + 4
8 |
9 | a = (3 -\
- | ^ E502
+ | ^
10 | 2 + \
11 | 7)
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
6 6 | 3 \
@@ -22,14 +23,15 @@ E502.py:9:9: E502 [*] Redundant backslash
11 11 | 7)
12 12 |
-E502.py:10:11: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:10:11
|
9 | a = (3 -\
10 | 2 + \
- | ^ E502
+ | ^
11 | 7)
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
7 7 | + 4
@@ -41,15 +43,16 @@ E502.py:10:11: E502 [*] Redundant backslash
12 12 |
13 13 | z = 5 + \
-E502.py:14:9: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:14:9
|
13 | z = 5 + \
14 | (3 -\
- | ^ E502
+ | ^
15 | 2 + \
16 | 7) + \
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
11 11 | 7)
@@ -61,16 +64,17 @@ E502.py:14:9: E502 [*] Redundant backslash
16 16 | 7) + \
17 17 | 4
-E502.py:15:11: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:15:11
|
13 | z = 5 + \
14 | (3 -\
15 | 2 + \
- | ^ E502
+ | ^
16 | 7) + \
17 | 4
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
12 12 |
@@ -82,15 +86,16 @@ E502.py:15:11: E502 [*] Redundant backslash
17 17 | 4
18 18 |
-E502.py:23:17: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:23:17
|
22 | b = [
23 | 2 + 4 + 5 + \
- | ^ E502
+ | ^
24 | 44 \
25 | - 5
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
20 20 | 2]
@@ -102,16 +107,17 @@ E502.py:23:17: E502 [*] Redundant backslash
25 25 | - 5
26 26 | ]
-E502.py:24:8: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:24:8
|
22 | b = [
23 | 2 + 4 + 5 + \
24 | 44 \
- | ^ E502
+ | ^
25 | - 5
26 | ]
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
21 21 |
@@ -123,15 +129,16 @@ E502.py:24:8: E502 [*] Redundant backslash
26 26 | ]
27 27 |
-E502.py:29:11: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:29:11
|
28 | c = (True and
29 | False \
- | ^ E502
+ | ^
30 | or False \
31 | and True \
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
26 26 | ]
@@ -143,16 +150,17 @@ E502.py:29:11: E502 [*] Redundant backslash
31 31 | and True \
32 32 | )
-E502.py:30:14: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:30:14
|
28 | c = (True and
29 | False \
30 | or False \
- | ^ E502
+ | ^
31 | and True \
32 | )
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
27 27 |
@@ -164,15 +172,16 @@ E502.py:30:14: E502 [*] Redundant backslash
32 32 | )
33 33 |
-E502.py:31:14: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:31:14
|
29 | False \
30 | or False \
31 | and True \
- | ^ E502
+ | ^
32 | )
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
28 28 | c = (True and
@@ -184,15 +193,16 @@ E502.py:31:14: E502 [*] Redundant backslash
33 33 |
34 34 | c = (True and
-E502.py:44:14: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:44:14
|
43 | s = {
44 | 'x': 2 + \
- | ^ E502
+ | ^
45 | 2
46 | }
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
41 41 |
@@ -204,13 +214,14 @@ E502.py:44:14: E502 [*] Redundant backslash
46 46 | }
47 47 |
-E502.py:55:12: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:55:12
|
55 | x = {2 + 4 \
- | ^ E502
+ | ^
56 | + 3}
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
52 52 | }
@@ -222,16 +233,17 @@ E502.py:55:12: E502 [*] Redundant backslash
57 57 |
58 58 | y = (
-E502.py:61:9: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:61:9
|
59 | 2 + 2 # \
60 | + 3 # \
61 | + 4 \
- | ^ E502
+ | ^
62 | + 3
63 | )
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
58 58 | y = (
@@ -243,15 +255,16 @@ E502.py:61:9: E502 [*] Redundant backslash
63 63 | )
64 64 |
-E502.py:82:12: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:82:12
|
80 | "xyz"
81 |
82 | x = ("abc" \
- | ^ E502
+ | ^
83 | "xyz")
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
79 79 | x = "abc" \
@@ -263,14 +276,15 @@ E502.py:82:12: E502 [*] Redundant backslash
84 84 |
85 85 |
-E502.py:87:14: E502 [*] Redundant backslash
+E502 [*] Redundant backslash
+ --> E502.py:87:14
|
86 | def foo():
87 | x = (a + \
- | ^ E502
+ | ^
88 | 2)
|
- = help: Remove redundant backslash
+help: Remove redundant backslash
ℹ Safe fix
84 84 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap
index 898237e9b4..5f15f1f97c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap
@@ -1,19 +1,19 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W391.ipynb:5:1: W391 [*] Too many newlines at end of cell
- |
- 3 | # just a comment in this cell
- 4 | # a comment and some newlines
- 5 | /
- 6 | |
- 7 | |
- | |__^ W391
- 8 |
- 9 | 1 + 1
-10 | # a comment
- |
- = help: Remove trailing newlines
+W391 [*] Too many newlines at end of cell
+ --> W391.ipynb:5:1
+ |
+3 | # just a comment in this cell
+4 | # a comment and some newlines
+5 | /
+6 | |
+7 | |
+ | |__^
+8 |
+9 | 1 + 1
+ |
+help: Remove trailing newlines
ℹ Safe fix
3 3 | # just a comment in this cell
@@ -26,7 +26,8 @@ W391.ipynb:5:1: W391 [*] Too many newlines at end of cell
10 7 | # a comment
11 8 |
-W391.ipynb:11:1: W391 [*] Too many newlines at end of cell
+W391 [*] Too many newlines at end of cell
+ --> W391.ipynb:11:1
|
9 | 1 + 1
10 | # a comment
@@ -34,11 +35,11 @@ W391.ipynb:11:1: W391 [*] Too many newlines at end of cell
12 | |
13 | |
14 | |
- | |__^ W391
+ | |__^
15 |
16 | 1+1
|
- = help: Remove trailing newlines
+help: Remove trailing newlines
ℹ Safe fix
9 9 | 1 + 1
@@ -52,17 +53,17 @@ W391.ipynb:11:1: W391 [*] Too many newlines at end of cell
17 13 |
18 14 |
-W391.ipynb:17:1: W391 [*] Too many newlines at end of cell
+W391 [*] Too many newlines at end of cell
+ --> W391.ipynb:17:1
|
16 | 1+1
17 | /
18 | |
19 | |
20 | |
- | |__^ W391
-21 |
+ | |__^
|
- = help: Remove trailing newlines
+help: Remove trailing newlines
ℹ Safe fix
15 15 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap
index f6afa64ada..770754ec50 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W391_0.py:14:1: W391 [*] Extra newline at end of file
+W391 [*] Extra newline at end of file
+ --> W391_0.py:14:1
|
12 | foo()
13 | bar()
14 |
- | ^ W391
+ | ^
|
- = help: Remove trailing newline
+help: Remove trailing newline
ℹ Safe fix
11 11 | if __name__ == '__main__':
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap
index 2bf8000654..4fee49f2de 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W391_2.py:14:1: W391 [*] Too many newlines at end of file
+W391 [*] Too many newlines at end of file
+ --> W391_2.py:14:1
|
12 | foo()
13 | bar()
@@ -9,9 +10,9 @@ W391_2.py:14:1: W391 [*] Too many newlines at end of file
15 | |
16 | |
17 | |
- | |__^ W391
+ | |__^
|
- = help: Remove trailing newlines
+help: Remove trailing newlines
ℹ Safe fix
11 11 | if __name__ == '__main__':
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__shebang.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__shebang.snap
index bd5f7a287c..fd26c27315 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__shebang.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__shebang.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
-snapshot_kind: text
---
-shebang.py:3:1: E265 [*] Block comment should start with `# `
+E265 [*] Block comment should start with `# `
+ --> shebang.py:3:1
|
1 | #!/usr/bin/python
2 | #
3 | #!
- | ^^ E265
+ | ^^
4 | #:
|
- = help: Format space
+help: Format space
ℹ Safe fix
1 1 | #!/usr/bin/python
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap
index 2b5a0222b2..f9cc43321a 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap
@@ -1,49 +1,54 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E501_2.py:2:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:2:7
|
1 | # aaaa
2 | # aaaaa
- | ^ E501
+ | ^
3 | # a
4 | # a
|
-E501_2.py:3:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:3:7
|
1 | # aaaa
2 | # aaaaa
3 | # a
- | ^ E501
+ | ^
4 | # a
5 | # aa
|
-E501_2.py:7:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:7:7
|
5 | # aa
6 | # aaa
7 | # aaaa
- | ^ E501
+ | ^
8 | # a
9 | # aa
|
-E501_2.py:10:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:10:7
|
8 | # a
9 | # aa
10 | # aaa
- | ^ E501
+ | ^
11 |
12 | if True: # noqa: E501
|
-E501_2.py:16:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:16:7
|
14 | [12 ]
15 | [1,2]
16 | [1, 2]
- | ^ E501
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap
index bfc312b4dc..ff4b41e3d8 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap
@@ -1,88 +1,97 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E501_2.py:2:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:2:7
|
1 | # aaaa
2 | # aaaaa
- | ^ E501
+ | ^
3 | # a
4 | # a
|
-E501_2.py:3:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:3:7
|
1 | # aaaa
2 | # aaaaa
3 | # a
- | ^ E501
+ | ^
4 | # a
5 | # aa
|
-E501_2.py:6:6: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:6:6
|
4 | # a
5 | # aa
6 | # aaa
- | ^ E501
+ | ^
7 | # aaaa
8 | # a
|
-E501_2.py:7:6: E501 Line too long (8 > 6)
+E501 Line too long (8 > 6)
+ --> E501_2.py:7:6
|
5 | # aa
6 | # aaa
7 | # aaaa
- | ^^ E501
+ | ^^
8 | # a
9 | # aa
|
-E501_2.py:8:5: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:8:5
|
6 | # aaa
7 | # aaaa
8 | # a
- | ^ E501
+ | ^
9 | # aa
10 | # aaa
|
-E501_2.py:9:5: E501 Line too long (8 > 6)
+E501 Line too long (8 > 6)
+ --> E501_2.py:9:5
|
7 | # aaaa
8 | # a
9 | # aa
- | ^^ E501
+ | ^^
10 | # aaa
|
-E501_2.py:10:5: E501 Line too long (9 > 6)
+E501 Line too long (9 > 6)
+ --> E501_2.py:10:5
|
8 | # a
9 | # aa
10 | # aaa
- | ^^^ E501
+ | ^^^
11 |
12 | if True: # noqa: E501
|
-E501_2.py:14:6: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:14:6
|
12 | if True: # noqa: E501
13 | [12]
14 | [12 ]
- | ^ E501
+ | ^
15 | [1,2]
16 | [1, 2]
|
-E501_2.py:16:6: E501 Line too long (8 > 6)
+E501 Line too long (8 > 6)
+ --> E501_2.py:16:6
|
14 | [12 ]
15 | [1,2]
16 | [1, 2]
- | ^^ E501
+ | ^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap
index 9930bcbee3..6eedca02da 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap
@@ -1,108 +1,119 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E501_2.py:2:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:2:7
|
1 | # aaaa
2 | # aaaaa
- | ^ E501
+ | ^
3 | # a
4 | # a
|
-E501_2.py:3:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:3:7
|
1 | # aaaa
2 | # aaaaa
3 | # a
- | ^ E501
+ | ^
4 | # a
5 | # aa
|
-E501_2.py:4:4: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:4:4
|
2 | # aaaaa
3 | # a
4 | # a
- | ^ E501
+ | ^
5 | # aa
6 | # aaa
|
-E501_2.py:5:4: E501 Line too long (8 > 6)
+E501 Line too long (8 > 6)
+ --> E501_2.py:5:4
|
3 | # a
4 | # a
5 | # aa
- | ^^ E501
+ | ^^
6 | # aaa
7 | # aaaa
|
-E501_2.py:6:4: E501 Line too long (9 > 6)
+E501 Line too long (9 > 6)
+ --> E501_2.py:6:4
|
4 | # a
5 | # aa
6 | # aaa
- | ^^^ E501
+ | ^^^
7 | # aaaa
8 | # a
|
-E501_2.py:7:4: E501 Line too long (10 > 6)
+E501 Line too long (10 > 6)
+ --> E501_2.py:7:4
|
5 | # aa
6 | # aaa
7 | # aaaa
- | ^^^^ E501
+ | ^^^^
8 | # a
9 | # aa
|
-E501_2.py:8:3: E501 Line too long (11 > 6)
+E501 Line too long (11 > 6)
+ --> E501_2.py:8:3
|
6 | # aaa
7 | # aaaa
8 | # a
- | ^^^ E501
+ | ^^^
9 | # aa
10 | # aaa
|
-E501_2.py:9:3: E501 Line too long (12 > 6)
+E501 Line too long (12 > 6)
+ --> E501_2.py:9:3
|
7 | # aaaa
8 | # a
9 | # aa
- | ^^^^ E501
+ | ^^^^
10 | # aaa
|
-E501_2.py:10:3: E501 Line too long (13 > 6)
+E501 Line too long (13 > 6)
+ --> E501_2.py:10:3
|
8 | # a
9 | # aa
10 | # aaa
- | ^^^^^ E501
+ | ^^^^^
11 |
12 | if True: # noqa: E501
|
-E501_2.py:14:4: E501 Line too long (9 > 6)
+E501 Line too long (9 > 6)
+ --> E501_2.py:14:4
|
12 | if True: # noqa: E501
13 | [12]
14 | [12 ]
- | ^^^ E501
+ | ^^^
15 | [1,2]
16 | [1, 2]
|
-E501_2.py:16:4: E501 Line too long (10 > 6)
+E501 Line too long (10 > 6)
+ --> E501_2.py:16:4
|
14 | [12 ]
15 | [1,2]
16 | [1, 2]
- | ^^^^ E501
+ | ^^^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap
index 2f3422d92f..d1f68fe2db 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap
@@ -1,108 +1,119 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E501_2.py:2:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:2:7
|
1 | # aaaa
2 | # aaaaa
- | ^ E501
+ | ^
3 | # a
4 | # a
|
-E501_2.py:3:7: E501 Line too long (7 > 6)
+E501 Line too long (7 > 6)
+ --> E501_2.py:3:7
|
1 | # aaaa
2 | # aaaaa
3 | # a
- | ^ E501
+ | ^
4 | # a
5 | # aa
|
-E501_2.py:4:2: E501 Line too long (11 > 6)
+E501 Line too long (11 > 6)
+ --> E501_2.py:4:2
|
2 | # aaaaa
3 | # a
4 | # a
- | ^^^ E501
+ | ^^^
5 | # aa
6 | # aaa
|
-E501_2.py:5:2: E501 Line too long (12 > 6)
+E501 Line too long (12 > 6)
+ --> E501_2.py:5:2
|
3 | # a
4 | # a
5 | # aa
- | ^^^^ E501
+ | ^^^^
6 | # aaa
7 | # aaaa
|
-E501_2.py:6:2: E501 Line too long (13 > 6)
+E501 Line too long (13 > 6)
+ --> E501_2.py:6:2
|
4 | # a
5 | # aa
6 | # aaa
- | ^^^^^ E501
+ | ^^^^^
7 | # aaaa
8 | # a
|
-E501_2.py:7:2: E501 Line too long (14 > 6)
+E501 Line too long (14 > 6)
+ --> E501_2.py:7:2
|
5 | # aa
6 | # aaa
7 | # aaaa
- | ^^^^^^ E501
+ | ^^^^^^
8 | # a
9 | # aa
|
-E501_2.py:8:2: E501 Line too long (19 > 6)
+E501 Line too long (19 > 6)
+ --> E501_2.py:8:2
|
6 | # aaa
7 | # aaaa
8 | # a
- | ^^^^^^^ E501
+ | ^^^^^^^
9 | # aa
10 | # aaa
|
-E501_2.py:9:2: E501 Line too long (20 > 6)
+E501 Line too long (20 > 6)
+ --> E501_2.py:9:2
|
7 | # aaaa
8 | # a
9 | # aa
- | ^^^^^^^^ E501
+ | ^^^^^^^^
10 | # aaa
|
-E501_2.py:10:2: E501 Line too long (21 > 6)
+E501 Line too long (21 > 6)
+ --> E501_2.py:10:2
|
8 | # a
9 | # aa
10 | # aaa
- | ^^^^^^^^^ E501
+ | ^^^^^^^^^
11 |
12 | if True: # noqa: E501
|
-E501_2.py:14:2: E501 Line too long (13 > 6)
+E501 Line too long (13 > 6)
+ --> E501_2.py:14:2
|
12 | if True: # noqa: E501
13 | [12]
14 | [12 ]
- | ^^^^^ E501
+ | ^^^^^
15 | [1,2]
16 | [1, 2]
|
-E501_2.py:16:2: E501 Line too long (14 > 6)
+E501 Line too long (14 > 6)
+ --> E501_2.py:16:2
|
14 | [12 ]
15 | [1,2]
16 | [1, 2]
- | ^^^^^^ E501
+ | ^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap
index 6dfc2c571a..f7526d15b7 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap
@@ -1,76 +1,84 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E501_1.py:1:89: E501 Line too long (149 > 88)
+E501 Line too long (149 > 88)
+ --> E501_1.py:1:89
|
-1 | …ask-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-2 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-3 | …sk-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+1 | … task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2 | …onfigured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+3 | …task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
|
-E501_1.py:2:89: E501 Line too long (158 > 88)
+E501 Line too long (158 > 88)
+ --> E501_1.py:2:89
|
-1 | …ags sometimes are longer than line-length so that you can easily find them with `git grep`
-2 | …ed task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-3 | …gs sometimes are longer than line-length so that you can easily find them with `git grep`
-4 | …task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+1 | …k-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+2 | …gured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+3 | …-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+4 | …ed task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
|
-E501_1.py:3:89: E501 Line too long (148 > 88)
+E501 Line too long (148 > 88)
+ --> E501_1.py:3:89
|
-1 | …ask-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-2 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-3 | …sk-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-4 | …ured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-5 | …task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+1 | …d task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+2 | …configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+3 | … task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+4 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+5 | …ed task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
|
-E501_1.py:4:89: E501 Line too long (155 > 88)
- |
-2 | …ured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-3 | …tags sometimes are longer than line-length so that you can easily find them with `git grep`
-4 | …d task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-5 | …k-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-6 | …-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- |
-
-E501_1.py:5:89: E501 Line too long (150 > 88)
+E501 Line too long (155 > 88)
+ --> E501_1.py:4:89
|
+2 | …igured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
3 | …k-tags sometimes are longer than line-length so that you can easily find them with `git grep`
4 | …red task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+5 | …ask-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+6 | …sk-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ |
+
+E501 Line too long (150 > 88)
+ --> E501_1.py:5:89
+ |
+3 | …task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+4 | …igured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+5 | …d task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+6 | … task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+7 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ |
+
+E501 Line too long (149 > 88)
+ --> E501_1.py:6:89
+ |
+4 | …igured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+5 | …d task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+6 | … task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+7 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+8 | …configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ |
+
+E501 Line too long (156 > 88)
+ --> E501_1.py:7:89
+ |
5 | …ask-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
6 | …sk-tags sometimes are longer than line-length so that you can easily find them with `git grep`
7 | …ured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+8 | …figured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
|
-E501_1.py:6:89: E501 Line too long (149 > 88)
+E501 Line too long (159 > 88)
+ --> E501_1.py:8:89
|
-4 | …ured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-5 | …task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-6 | …ask-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-7 | …gured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-8 | …nfigured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- |
-
-E501_1.py:7:89: E501 Line too long (156 > 88)
- |
-5 | …-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-6 | …tags sometimes are longer than line-length so that you can easily find them with `git grep`
-7 | …d task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
-8 | …ured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- |
-
-E501_1.py:8:89: E501 Line too long (159 > 88)
- |
-6 | …ags sometimes are longer than line-length so that you can easily find them with `git grep`
-7 | … task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
-8 | …red task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
+6 | …-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+7 | …ed task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+8 | …gured task-tags sometimes are longer than line-length so that you can easily find them with `git grep`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap
index 8d895a4453..1e0642addf 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -21,12 +22,13 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
6 3 |
7 4 |
-E30_isort.py:5:1: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:5:1
|
5 | from typing import Any, Sequence
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
1 1 | import json
@@ -37,14 +39,15 @@ E30_isort.py:5:1: E303 [*] Too many blank lines (3)
6 5 |
7 6 |
-E30_isort.py:21:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:21:5
|
21 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
17 17 | if __name__ == "__main__":
@@ -55,7 +58,8 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
22 21 |
23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -63,9 +67,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -77,12 +81,13 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:30:5: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:30:5
|
30 | from typing_extensions import TypeAlias
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -94,14 +99,15 @@ E30_isort.py:30:5: E303 [*] Too many blank lines (3)
31 29 |
32 30 |
-E30_isort.py:33:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:33:5
|
33 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
29 29 |
@@ -112,14 +118,15 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
34 33 |
35 34 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
59 59 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap
index 2c2e5936b9..395cce3697 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -24,12 +25,13 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
9 4 |
10 5 |
-E30_isort.py:5:1: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:5:1
|
5 | from typing import Any, Sequence
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
1 1 | import json
@@ -40,12 +42,13 @@ E30_isort.py:5:1: E303 [*] Too many blank lines (3)
6 5 |
7 6 |
-E30_isort.py:8:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:8:1
|
8 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E303
+ | ^^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
3 3 |
@@ -57,14 +60,15 @@ E30_isort.py:8:1: E303 [*] Too many blank lines (2)
9 7 |
10 8 |
-E30_isort.py:21:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:21:5
|
21 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
17 17 | if __name__ == "__main__":
@@ -75,7 +79,8 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
22 21 |
23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -83,9 +88,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -97,12 +102,13 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:30:5: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:30:5
|
30 | from typing_extensions import TypeAlias
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -114,14 +120,15 @@ E30_isort.py:30:5: E303 [*] Too many blank lines (3)
31 29 |
32 30 |
-E30_isort.py:33:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:33:5
|
33 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
29 29 |
@@ -132,14 +139,15 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
34 33 |
35 34 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
58 58 |
@@ -148,14 +156,15 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
61 |-
62 61 | class MissingCommand(TypeError): ... # noqa: N818
-E30_isort.py:62:1: E303 [*] Too many blank lines (1)
+E303 [*] Too many blank lines (1)
+ --> E30_isort.py:62:1
|
60 | from typing import Any, Sequence
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E303
+ | ^^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
58 58 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap
index 1c152584a9..7e3f1d9486 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
1 1 | import json
@@ -23,12 +24,13 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
8 5 | class MissingCommand(TypeError): ... # noqa: N818
9 6 |
-E30_isort.py:5:1: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:5:1
|
5 | from typing import Any, Sequence
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
1 1 | import json
@@ -39,12 +41,13 @@ E30_isort.py:5:1: E303 [*] Too many blank lines (3)
6 5 |
7 6 |
-E30_isort.py:8:1: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:8:1
|
8 | class MissingCommand(TypeError): ... # noqa: N818
- | ^^^^^ E303
+ | ^^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
4 4 |
@@ -55,14 +58,15 @@ E30_isort.py:8:1: E303 [*] Too many blank lines (2)
9 8 |
10 9 |
-E30_isort.py:21:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:21:5
|
21 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
17 17 | if __name__ == "__main__":
@@ -73,7 +77,8 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
22 21 |
23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -81,9 +86,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -95,12 +100,13 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:30:5: E303 [*] Too many blank lines (3)
+E303 [*] Too many blank lines (3)
+ --> E30_isort.py:30:5
|
30 | from typing_extensions import TypeAlias
- | ^^^^ E303
+ | ^^^^
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -112,14 +118,15 @@ E30_isort.py:30:5: E303 [*] Too many blank lines (3)
31 29 |
32 30 |
-E30_isort.py:33:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:33:5
|
33 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
29 29 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap
index c6db5e7df6..78d8e3cc24 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:1:1
|
1 | / import json
2 | |
3 | |
4 | |
5 | | from typing import Any, Sequence
- | |________________________________^ I001
+ | |________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
2 2 |
@@ -26,14 +27,15 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
9 12 |
10 13 |
-E30_isort.py:21:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:21:5
|
21 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
22 |
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
17 17 | if __name__ == "__main__":
@@ -44,7 +46,8 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
22 21 |
23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
-E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:26:5
|
25 | if TYPE_CHECKING:
26 | / import os
@@ -52,9 +55,9 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
28 | |
29 | |
30 | | from typing_extensions import TypeAlias
- | |___________________________________________^ I001
+ | |___________________________________________^
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
25 25 | if TYPE_CHECKING:
@@ -66,14 +69,15 @@ E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted
31 29 |
32 30 |
-E30_isort.py:33:5: E303 [*] Too many blank lines (2)
+E303 [*] Too many blank lines (2)
+ --> E30_isort.py:33:5
|
33 | abcd.foo()
- | ^^^^ E303
+ | ^^^^
34 |
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
- = help: Remove extraneous blank line(s)
+help: Remove extraneous blank line(s)
ℹ Safe fix
29 29 |
@@ -84,14 +88,15 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
34 33 |
35 34 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
-E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
+I001 [*] Import block is un-sorted or un-formatted
+ --> E30_isort.py:60:1
|
60 | from typing import Any, Sequence
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | class MissingCommand(TypeError): ... # noqa: N818
|
- = help: Organize imports
+help: Organize imports
ℹ Safe fix
59 59 |
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap
index 31356cd79f..807eabd09c 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-W292_4.py:1:2: W292 [*] No newline at end of file
+W292 [*] No newline at end of file
+ --> W292_4.py:1:2
|
1 |
- | ^ W292
+ | ^
|
- = help: Add trailing newline
+help: Add trailing newline
ℹ Safe fix
1 |-
diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap
index d78a1c3367..447a0efd5e 100644
--- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap
+++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
-E2_syntax_error.py:1:10: invalid-syntax: Expected an expression
+invalid-syntax: Expected an expression
+ --> E2_syntax_error.py:1:10
|
1 | a = (1 or)
| ^
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_google.py.snap
index c847330890..80ccb2c157 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC502_google.py:7:5: DOC502 Raised exception is not explicitly raised: `FasterThanLightError`
+DOC502 Raised exception is not explicitly raised: `FasterThanLightError`
+ --> DOC502_google.py:7:5
|
5 | # DOC502
6 | def calculate_speed(distance: float, time: float) -> float:
@@ -17,12 +18,13 @@ DOC502_google.py:7:5: DOC502 Raised exception is not explicitly raised: `FasterT
16 | | Raises:
17 | | FasterThanLightError: If speed is greater than the speed of light.
18 | | """
- | |_______^ DOC502
+ | |_______^
19 | return distance / time
|
- = help: Remove `FasterThanLightError` from the docstring
+help: Remove `FasterThanLightError` from the docstring
-DOC502_google.py:24:5: DOC502 Raised exceptions are not explicitly raised: `FasterThanLightError`, `DivisionByZero`
+DOC502 Raised exceptions are not explicitly raised: `FasterThanLightError`, `DivisionByZero`
+ --> DOC502_google.py:24:5
|
22 | # DOC502
23 | def calculate_speed(distance: float, time: float) -> float:
@@ -39,12 +41,13 @@ DOC502_google.py:24:5: DOC502 Raised exceptions are not explicitly raised: `Fast
34 | | FasterThanLightError: If speed is greater than the speed of light.
35 | | DivisionByZero: Divide by zero.
36 | | """
- | |_______^ DOC502
+ | |_______^
37 | return distance / time
|
- = help: Remove `FasterThanLightError`, `DivisionByZero` from the docstring
+help: Remove `FasterThanLightError`, `DivisionByZero` from the docstring
-DOC502_google.py:42:5: DOC502 Raised exception is not explicitly raised: `DivisionByZero`
+DOC502 Raised exception is not explicitly raised: `DivisionByZero`
+ --> DOC502_google.py:42:5
|
40 | # DOC502
41 | def calculate_speed(distance: float, time: float) -> float:
@@ -61,8 +64,8 @@ DOC502_google.py:42:5: DOC502 Raised exception is not explicitly raised: `Divisi
52 | | FasterThanLightError: If speed is greater than the speed of light.
53 | | DivisionByZero: Divide by zero.
54 | | """
- | |_______^ DOC502
+ | |_______^
55 | try:
56 | return distance / time
|
- = help: Remove `DivisionByZero` from the docstring
+help: Remove `DivisionByZero` from the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_numpy.py.snap
index b007d9536b..fd28bded5d 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-exception_DOC502_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC502_numpy.py:7:5: DOC502 Raised exception is not explicitly raised: `FasterThanLightError`
+DOC502 Raised exception is not explicitly raised: `FasterThanLightError`
+ --> DOC502_numpy.py:7:5
|
5 | # DOC502
6 | def calculate_speed(distance: float, time: float) -> float:
@@ -25,12 +26,13 @@ DOC502_numpy.py:7:5: DOC502 Raised exception is not explicitly raised: `FasterTh
24 | | FasterThanLightError
25 | | If speed is greater than the speed of light.
26 | | """
- | |_______^ DOC502
+ | |_______^
27 | return distance / time
|
- = help: Remove `FasterThanLightError` from the docstring
+help: Remove `FasterThanLightError` from the docstring
-DOC502_numpy.py:32:5: DOC502 Raised exceptions are not explicitly raised: `FasterThanLightError`, `DivisionByZero`
+DOC502 Raised exceptions are not explicitly raised: `FasterThanLightError`, `DivisionByZero`
+ --> DOC502_numpy.py:32:5
|
30 | # DOC502
31 | def calculate_speed(distance: float, time: float) -> float:
@@ -56,12 +58,13 @@ DOC502_numpy.py:32:5: DOC502 Raised exceptions are not explicitly raised: `Faste
51 | | DivisionByZero
52 | | If attempting to divide by zero.
53 | | """
- | |_______^ DOC502
+ | |_______^
54 | return distance / time
|
- = help: Remove `FasterThanLightError`, `DivisionByZero` from the docstring
+help: Remove `FasterThanLightError`, `DivisionByZero` from the docstring
-DOC502_numpy.py:59:5: DOC502 Raised exception is not explicitly raised: `DivisionByZero`
+DOC502 Raised exception is not explicitly raised: `DivisionByZero`
+ --> DOC502_numpy.py:59:5
|
57 | # DOC502
58 | def calculate_speed(distance: float, time: float) -> float:
@@ -87,8 +90,8 @@ DOC502_numpy.py:59:5: DOC502 Raised exception is not explicitly raised: `Divisio
78 | | DivisionByZero
79 | | If attempting to divide by zero.
80 | | """
- | |_______^ DOC502
+ | |_______^
81 | try:
82 | return distance / time
|
- = help: Remove `DivisionByZero` from the docstring
+help: Remove `DivisionByZero` from the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_google.py.snap
index 70beeffbc1..90df7a99d8 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC202_google.py:14:5: DOC202 Docstring should not have a returns section because the function doesn't return anything
+DOC202 Docstring should not have a returns section because the function doesn't return anything
+ --> DOC202_google.py:14:5
|
12 | # DOC202
13 | def foo(num: int) -> str:
@@ -14,12 +15,13 @@ DOC202_google.py:14:5: DOC202 Docstring should not have a returns section becaus
20 | | Returns:
21 | | str: A string
22 | | """
- | |_______^ DOC202
+ | |_______^
23 | print('test')
|
- = help: Remove the "Returns" section
+help: Remove the "Returns" section
-DOC202_google.py:30:9: DOC202 Docstring should not have a returns section because the function doesn't return anything
+DOC202 Docstring should not have a returns section because the function doesn't return anything
+ --> DOC202_google.py:30:9
|
28 | # DOC202
29 | def foo(self) -> str:
@@ -32,12 +34,13 @@ DOC202_google.py:30:9: DOC202 Docstring should not have a returns section becaus
36 | | Returns:
37 | | str: A string
38 | | """
- | |___________^ DOC202
+ | |___________^
39 | print('test')
|
- = help: Remove the "Returns" section
+help: Remove the "Returns" section
-DOC202_google.py:80:5: DOC202 Docstring should not have a returns section because the function doesn't return anything
+DOC202 Docstring should not have a returns section because the function doesn't return anything
+ --> DOC202_google.py:80:5
|
78 | # DOC202 -- never explicitly returns anything, just short-circuits
79 | def foo(s: str, condition: bool):
@@ -46,8 +49,8 @@ DOC202_google.py:80:5: DOC202 Docstring should not have a returns section becaus
82 | | Returns:
83 | | None
84 | | """
- | |_______^ DOC202
+ | |_______^
85 | if not condition:
86 | return
|
- = help: Remove the "Returns" section
+help: Remove the "Returns" section
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_numpy.py.snap
index 0bb06b9b99..9cccd876ae 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-returns_DOC202_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC202_numpy.py:16:5: DOC202 Docstring should not have a returns section because the function doesn't return anything
+DOC202 Docstring should not have a returns section because the function doesn't return anything
+ --> DOC202_numpy.py:16:5
|
14 | # DOC202
15 | def foo(num: int) -> str:
@@ -18,12 +19,13 @@ DOC202_numpy.py:16:5: DOC202 Docstring should not have a returns section because
26 | | str
27 | | A string
28 | | """
- | |_______^ DOC202
+ | |_______^
29 | print('test')
|
- = help: Remove the "Returns" section
+help: Remove the "Returns" section
-DOC202_numpy.py:36:9: DOC202 Docstring should not have a returns section because the function doesn't return anything
+DOC202 Docstring should not have a returns section because the function doesn't return anything
+ --> DOC202_numpy.py:36:9
|
34 | # DOC202
35 | def foo(self) -> str:
@@ -40,7 +42,7 @@ DOC202_numpy.py:36:9: DOC202 Docstring should not have a returns section because
46 | | str
47 | | A string
48 | | """
- | |___________^ DOC202
+ | |___________^
49 | print('test')
|
- = help: Remove the "Returns" section
+help: Remove the "Returns" section
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_google.py.snap
index dccb259a11..09b88d835e 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC403_google.py:14:5: DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+ --> DOC403_google.py:14:5
|
12 | # DOC403
13 | def foo(num: int) -> str:
@@ -14,12 +15,13 @@ DOC403_google.py:14:5: DOC403 Docstring has a "Yields" section but the function
20 | | Yields:
21 | | str: A string
22 | | """
- | |_______^ DOC403
+ | |_______^
23 | print('test')
|
- = help: Remove the "Yields" section
+help: Remove the "Yields" section
-DOC403_google.py:30:9: DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+ --> DOC403_google.py:30:9
|
28 | # DOC403
29 | def foo(self) -> str:
@@ -32,7 +34,7 @@ DOC403_google.py:30:9: DOC403 Docstring has a "Yields" section but the function
36 | | Yields:
37 | | str: A string
38 | | """
- | |___________^ DOC403
+ | |___________^
39 | print('test')
|
- = help: Remove the "Yields" section
+help: Remove the "Yields" section
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_numpy.py.snap
index d87e8f4f27..4b2cd2954c 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-extraneous-yields_DOC403_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC403_numpy.py:16:5: DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+ --> DOC403_numpy.py:16:5
|
14 | # DOC403
15 | def foo(num: int) -> str:
@@ -18,12 +19,13 @@ DOC403_numpy.py:16:5: DOC403 Docstring has a "Yields" section but the function d
26 | | str
27 | | A string
28 | | """
- | |_______^ DOC403
+ | |_______^
29 | print('test')
|
- = help: Remove the "Yields" section
+help: Remove the "Yields" section
-DOC403_numpy.py:36:9: DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+DOC403 Docstring has a "Yields" section but the function doesn't yield anything
+ --> DOC403_numpy.py:36:9
|
34 | # DOC403
35 | def foo(self) -> str:
@@ -40,7 +42,7 @@ DOC403_numpy.py:36:9: DOC403 Docstring has a "Yields" section but the function d
46 | | str
47 | | A string
48 | | """
- | |___________^ DOC403
+ | |___________^
49 | print('test')
|
- = help: Remove the "Yields" section
+help: Remove the "Yields" section
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py.snap
index b30b47f6f7..ab13770174 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC501_google.py:34:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_google.py:34:5
|
32 | # DOC501
33 | def calculate_speed(distance: float, time: float) -> float:
@@ -14,13 +15,14 @@ DOC501_google.py:34:5: DOC501 Raised exception `FasterThanLightError` missing fr
40 | | Returns:
41 | | Speed as distance divided by time.
42 | | """
- | |_______^ DOC501
+ | |_______^
43 | try:
44 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_google.py:51:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_google.py:51:5
|
49 | # DOC501
50 | def calculate_speed(distance: float, time: float) -> float:
@@ -33,13 +35,14 @@ DOC501_google.py:51:5: DOC501 Raised exception `ValueError` missing from docstri
57 | | Returns:
58 | | Speed as distance divided by time.
59 | | """
- | |_______^ DOC501
+ | |_______^
60 | try:
61 | return distance / time
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
-DOC501_google.py:51:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_google.py:51:5
|
49 | # DOC501
50 | def calculate_speed(distance: float, time: float) -> float:
@@ -52,13 +55,14 @@ DOC501_google.py:51:5: DOC501 Raised exception `FasterThanLightError` missing fr
57 | | Returns:
58 | | Speed as distance divided by time.
59 | | """
- | |_______^ DOC501
+ | |_______^
60 | try:
61 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_google.py:106:5: DOC501 Raised exception `AnotherError` missing from docstring
+DOC501 Raised exception `AnotherError` missing from docstring
+ --> DOC501_google.py:106:5
|
104 | # DOC501
105 | def calculate_speed(distance: float, time: float) -> float:
@@ -71,12 +75,13 @@ DOC501_google.py:106:5: DOC501 Raised exception `AnotherError` missing from docs
112 | | Returns:
113 | | Speed as distance divided by time.
114 | | """
- | |_______^ DOC501
+ | |_______^
115 | raise AnotherError
|
- = help: Add `AnotherError` to the docstring
+help: Add `AnotherError` to the docstring
-DOC501_google.py:120:5: DOC501 Raised exception `AnotherError` missing from docstring
+DOC501 Raised exception `AnotherError` missing from docstring
+ --> DOC501_google.py:120:5
|
118 | # DOC501
119 | def calculate_speed(distance: float, time: float) -> float:
@@ -89,12 +94,13 @@ DOC501_google.py:120:5: DOC501 Raised exception `AnotherError` missing from docs
126 | | Returns:
127 | | Speed as distance divided by time.
128 | | """
- | |_______^ DOC501
+ | |_______^
129 | raise AnotherError()
|
- = help: Add `AnotherError` to the docstring
+help: Add `AnotherError` to the docstring
-DOC501_google.py:134:5: DOC501 Raised exception `SomeError` missing from docstring
+DOC501 Raised exception `SomeError` missing from docstring
+ --> DOC501_google.py:134:5
|
132 | # DOC501
133 | def foo(bar: int):
@@ -103,12 +109,13 @@ DOC501_google.py:134:5: DOC501 Raised exception `SomeError` missing from docstri
136 | | Args:
137 | | bar: Bar.
138 | | """
- | |_______^ DOC501
+ | |_______^
139 | raise something.SomeError
|
- = help: Add `SomeError` to the docstring
+help: Add `SomeError` to the docstring
-DOC501_google.py:197:5: DOC501 Raised exception `ZeroDivisionError` missing from docstring
+DOC501 Raised exception `ZeroDivisionError` missing from docstring
+ --> DOC501_google.py:197:5
|
195 | # DOC501
196 | def calculate_speed(distance: float, time: float) -> float:
@@ -124,13 +131,14 @@ DOC501_google.py:197:5: DOC501 Raised exception `ZeroDivisionError` missing from
206 | | Raises:
207 | | TypeError: if you didn't pass a number for both parameters
208 | | """
- | |_______^ DOC501
+ | |_______^
209 | try:
210 | return distance / time
|
- = help: Add `ZeroDivisionError` to the docstring
+help: Add `ZeroDivisionError` to the docstring
-DOC501_google.py:238:5: DOC501 Raised exception `TypeError` missing from docstring
+DOC501 Raised exception `TypeError` missing from docstring
+ --> DOC501_google.py:238:5
|
237 | def foo():
238 | / """Foo.
@@ -138,13 +146,14 @@ DOC501_google.py:238:5: DOC501 Raised exception `TypeError` missing from docstri
240 | | Returns:
241 | | 42: int.
242 | | """
- | |_______^ DOC501
+ | |_______^
243 | if True:
244 | raise TypeError # DOC501
|
- = help: Add `TypeError` to the docstring
+help: Add `TypeError` to the docstring
-DOC501_google.py:238:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_google.py:238:5
|
237 | def foo():
238 | / """Foo.
@@ -152,8 +161,8 @@ DOC501_google.py:238:5: DOC501 Raised exception `ValueError` missing from docstr
240 | | Returns:
241 | | 42: int.
242 | | """
- | |_______^ DOC501
+ | |_______^
243 | if True:
244 | raise TypeError # DOC501
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py_ignore_one_line.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py_ignore_one_line.snap
index b30b47f6f7..ab13770174 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py_ignore_one_line.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_google.py_ignore_one_line.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC501_google.py:34:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_google.py:34:5
|
32 | # DOC501
33 | def calculate_speed(distance: float, time: float) -> float:
@@ -14,13 +15,14 @@ DOC501_google.py:34:5: DOC501 Raised exception `FasterThanLightError` missing fr
40 | | Returns:
41 | | Speed as distance divided by time.
42 | | """
- | |_______^ DOC501
+ | |_______^
43 | try:
44 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_google.py:51:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_google.py:51:5
|
49 | # DOC501
50 | def calculate_speed(distance: float, time: float) -> float:
@@ -33,13 +35,14 @@ DOC501_google.py:51:5: DOC501 Raised exception `ValueError` missing from docstri
57 | | Returns:
58 | | Speed as distance divided by time.
59 | | """
- | |_______^ DOC501
+ | |_______^
60 | try:
61 | return distance / time
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
-DOC501_google.py:51:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_google.py:51:5
|
49 | # DOC501
50 | def calculate_speed(distance: float, time: float) -> float:
@@ -52,13 +55,14 @@ DOC501_google.py:51:5: DOC501 Raised exception `FasterThanLightError` missing fr
57 | | Returns:
58 | | Speed as distance divided by time.
59 | | """
- | |_______^ DOC501
+ | |_______^
60 | try:
61 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_google.py:106:5: DOC501 Raised exception `AnotherError` missing from docstring
+DOC501 Raised exception `AnotherError` missing from docstring
+ --> DOC501_google.py:106:5
|
104 | # DOC501
105 | def calculate_speed(distance: float, time: float) -> float:
@@ -71,12 +75,13 @@ DOC501_google.py:106:5: DOC501 Raised exception `AnotherError` missing from docs
112 | | Returns:
113 | | Speed as distance divided by time.
114 | | """
- | |_______^ DOC501
+ | |_______^
115 | raise AnotherError
|
- = help: Add `AnotherError` to the docstring
+help: Add `AnotherError` to the docstring
-DOC501_google.py:120:5: DOC501 Raised exception `AnotherError` missing from docstring
+DOC501 Raised exception `AnotherError` missing from docstring
+ --> DOC501_google.py:120:5
|
118 | # DOC501
119 | def calculate_speed(distance: float, time: float) -> float:
@@ -89,12 +94,13 @@ DOC501_google.py:120:5: DOC501 Raised exception `AnotherError` missing from docs
126 | | Returns:
127 | | Speed as distance divided by time.
128 | | """
- | |_______^ DOC501
+ | |_______^
129 | raise AnotherError()
|
- = help: Add `AnotherError` to the docstring
+help: Add `AnotherError` to the docstring
-DOC501_google.py:134:5: DOC501 Raised exception `SomeError` missing from docstring
+DOC501 Raised exception `SomeError` missing from docstring
+ --> DOC501_google.py:134:5
|
132 | # DOC501
133 | def foo(bar: int):
@@ -103,12 +109,13 @@ DOC501_google.py:134:5: DOC501 Raised exception `SomeError` missing from docstri
136 | | Args:
137 | | bar: Bar.
138 | | """
- | |_______^ DOC501
+ | |_______^
139 | raise something.SomeError
|
- = help: Add `SomeError` to the docstring
+help: Add `SomeError` to the docstring
-DOC501_google.py:197:5: DOC501 Raised exception `ZeroDivisionError` missing from docstring
+DOC501 Raised exception `ZeroDivisionError` missing from docstring
+ --> DOC501_google.py:197:5
|
195 | # DOC501
196 | def calculate_speed(distance: float, time: float) -> float:
@@ -124,13 +131,14 @@ DOC501_google.py:197:5: DOC501 Raised exception `ZeroDivisionError` missing from
206 | | Raises:
207 | | TypeError: if you didn't pass a number for both parameters
208 | | """
- | |_______^ DOC501
+ | |_______^
209 | try:
210 | return distance / time
|
- = help: Add `ZeroDivisionError` to the docstring
+help: Add `ZeroDivisionError` to the docstring
-DOC501_google.py:238:5: DOC501 Raised exception `TypeError` missing from docstring
+DOC501 Raised exception `TypeError` missing from docstring
+ --> DOC501_google.py:238:5
|
237 | def foo():
238 | / """Foo.
@@ -138,13 +146,14 @@ DOC501_google.py:238:5: DOC501 Raised exception `TypeError` missing from docstri
240 | | Returns:
241 | | 42: int.
242 | | """
- | |_______^ DOC501
+ | |_______^
243 | if True:
244 | raise TypeError # DOC501
|
- = help: Add `TypeError` to the docstring
+help: Add `TypeError` to the docstring
-DOC501_google.py:238:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_google.py:238:5
|
237 | def foo():
238 | / """Foo.
@@ -152,8 +161,8 @@ DOC501_google.py:238:5: DOC501 Raised exception `ValueError` missing from docstr
240 | | Returns:
241 | | 42: int.
242 | | """
- | |_______^ DOC501
+ | |_______^
243 | if True:
244 | raise TypeError # DOC501
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_numpy.py.snap
index 1a53bef11f..ceb2a0929c 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC501_numpy.py:35:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_numpy.py:35:5
|
33 | # DOC501
34 | def calculate_speed(distance: float, time: float) -> float:
@@ -20,13 +21,14 @@ DOC501_numpy.py:35:5: DOC501 Raised exception `FasterThanLightError` missing fro
47 | | float
48 | | Speed as distance divided by time.
49 | | """
- | |_______^ DOC501
+ | |_______^
50 | try:
51 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_numpy.py:58:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_numpy.py:58:5
|
56 | # DOC501
57 | def calculate_speed(distance: float, time: float) -> float:
@@ -45,13 +47,14 @@ DOC501_numpy.py:58:5: DOC501 Raised exception `ValueError` missing from docstrin
70 | | float
71 | | Speed as distance divided by time.
72 | | """
- | |_______^ DOC501
+ | |_______^
73 | try:
74 | return distance / time
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
-DOC501_numpy.py:58:5: DOC501 Raised exception `FasterThanLightError` missing from docstring
+DOC501 Raised exception `FasterThanLightError` missing from docstring
+ --> DOC501_numpy.py:58:5
|
56 | # DOC501
57 | def calculate_speed(distance: float, time: float) -> float:
@@ -70,13 +73,14 @@ DOC501_numpy.py:58:5: DOC501 Raised exception `FasterThanLightError` missing fro
70 | | float
71 | | Speed as distance divided by time.
72 | | """
- | |_______^ DOC501
+ | |_______^
73 | try:
74 | return distance / time
|
- = help: Add `FasterThanLightError` to the docstring
+help: Add `FasterThanLightError` to the docstring
-DOC501_numpy.py:83:5: DOC501 Raised exception `TypeError` missing from docstring
+DOC501 Raised exception `TypeError` missing from docstring
+ --> DOC501_numpy.py:83:5
|
81 | # DOC501
82 | def calculate_speed(distance: float, time: float) -> float:
@@ -101,13 +105,14 @@ DOC501_numpy.py:83:5: DOC501 Raised exception `TypeError` missing from docstring
101 | | ZeroDivisionError
102 | | If attempting to divide by zero.
103 | | """
- | |_______^ DOC501
+ | |_______^
104 | try:
105 | return distance / time
|
- = help: Add `TypeError` to the docstring
+help: Add `TypeError` to the docstring
-DOC501_numpy.py:139:5: DOC501 Raised exception `TypeError` missing from docstring
+DOC501 Raised exception `TypeError` missing from docstring
+ --> DOC501_numpy.py:139:5
|
138 | def foo():
139 | / """Foo.
@@ -117,13 +122,14 @@ DOC501_numpy.py:139:5: DOC501 Raised exception `TypeError` missing from docstrin
143 | | int
144 | | 42
145 | | """
- | |_______^ DOC501
+ | |_______^
146 | if True:
147 | raise TypeError # DOC501
|
- = help: Add `TypeError` to the docstring
+help: Add `TypeError` to the docstring
-DOC501_numpy.py:139:5: DOC501 Raised exception `ValueError` missing from docstring
+DOC501 Raised exception `ValueError` missing from docstring
+ --> DOC501_numpy.py:139:5
|
138 | def foo():
139 | / """Foo.
@@ -133,8 +139,8 @@ DOC501_numpy.py:139:5: DOC501 Raised exception `ValueError` missing from docstri
143 | | int
144 | | 42
145 | | """
- | |_______^ DOC501
+ | |_______^
146 | if True:
147 | raise TypeError # DOC501
|
- = help: Add `ValueError` to the docstring
+help: Add `ValueError` to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap
index d074c17366..870a7f0dcd 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC201_google.py:3:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:3:5
|
1 | # DOC201
2 | def foo(num: int) -> str:
@@ -11,12 +12,13 @@ DOC201_google.py:3:5: DOC201 `return` is not documented in docstring
6 | | Args:
7 | | num (int): A number
8 | | """
- | |_______^ DOC201
+ | |_______^
9 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:44:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:44:9
|
42 | # DOC201
43 | def bar(self) -> str:
@@ -26,32 +28,35 @@ DOC201_google.py:44:9: DOC201 `return` is not documented in docstring
47 | | Args:
48 | | num (int): A number
49 | | """
- | |___________^ DOC201
+ | |___________^
50 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:70:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:70:9
|
68 | # DOC201
69 | def nested():
70 | """Do something nested."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
71 | return 5
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:120:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:120:9
|
118 | @abc.abstractmethod
119 | def f(self):
120 | """Lorem ipsum."""
- | ^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^
121 | return True
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:178:5
|
176 | # DOC201 - non-early return explicit None
177 | def foo(x: int) -> int | None:
@@ -60,13 +65,14 @@ DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
180 | | Args:
181 | | x (int): An integer.
182 | | """
- | |_______^ DOC201
+ | |_______^
183 | if x < 0:
184 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:191:5
|
189 | # DOC201 - non-early return explicit None w/o useful type annotations
190 | def foo(x):
@@ -75,13 +81,14 @@ DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
193 | | Args:
194 | | x (int): An integer.
195 | | """
- | |_______^ DOC201
+ | |_______^
196 | if x < 0:
197 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:204:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:204:5
|
202 | # DOC201 - only returns None, but return annotation is not None
203 | def foo(s: str) -> str | None:
@@ -90,7 +97,7 @@ DOC201_google.py:204:5: DOC201 `return` is not documented in docstring
206 | | Args:
207 | | s (str): A string.
208 | | """
- | |_______^ DOC201
+ | |_______^
209 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py_ignore_one_line.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py_ignore_one_line.snap
index 87a9dd1aae..d91e58434f 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py_ignore_one_line.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py_ignore_one_line.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC201_google.py:3:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:3:5
|
1 | # DOC201
2 | def foo(num: int) -> str:
@@ -11,12 +12,13 @@ DOC201_google.py:3:5: DOC201 `return` is not documented in docstring
6 | | Args:
7 | | num (int): A number
8 | | """
- | |_______^ DOC201
+ | |_______^
9 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:44:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:44:9
|
42 | # DOC201
43 | def bar(self) -> str:
@@ -26,12 +28,13 @@ DOC201_google.py:44:9: DOC201 `return` is not documented in docstring
47 | | Args:
48 | | num (int): A number
49 | | """
- | |___________^ DOC201
+ | |___________^
50 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:178:5
|
176 | # DOC201 - non-early return explicit None
177 | def foo(x: int) -> int | None:
@@ -40,13 +43,14 @@ DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
180 | | Args:
181 | | x (int): An integer.
182 | | """
- | |_______^ DOC201
+ | |_______^
183 | if x < 0:
184 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:191:5
|
189 | # DOC201 - non-early return explicit None w/o useful type annotations
190 | def foo(x):
@@ -55,13 +59,14 @@ DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
193 | | Args:
194 | | x (int): An integer.
195 | | """
- | |_______^ DOC201
+ | |_______^
196 | if x < 0:
197 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_google.py:204:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_google.py:204:5
|
202 | # DOC201 - only returns None, but return annotation is not None
203 | def foo(s: str) -> str | None:
@@ -70,7 +75,7 @@ DOC201_google.py:204:5: DOC201 `return` is not documented in docstring
206 | | Args:
207 | | s (str): A string.
208 | | """
- | |_______^ DOC201
+ | |_______^
209 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap
index b1b7071275..411fd78b08 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC201_numpy.py:3:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:3:5
|
1 | # DOC201
2 | def foo(num: int) -> str:
@@ -13,12 +14,13 @@ DOC201_numpy.py:3:5: DOC201 `return` is not documented in docstring
8 | | num : int
9 | | A number
10 | | """
- | |_______^ DOC201
+ | |_______^
11 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:54:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:54:9
|
52 | # DOC201
53 | def bar(self) -> str:
@@ -30,22 +32,24 @@ DOC201_numpy.py:54:9: DOC201 `return` is not documented in docstring
59 | | num : int
60 | | A number
61 | | """
- | |___________^ DOC201
+ | |___________^
62 | return 'test'
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:86:9: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:86:9
|
84 | @abc.abstractmethod
85 | def f(self):
86 | """Lorem ipsum."""
- | ^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^
87 | return True
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:152:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:152:5
|
150 | # DOC201 - non-early return explicit None
151 | def foo(x: int) -> int | None:
@@ -56,13 +60,14 @@ DOC201_numpy.py:152:5: DOC201 `return` is not documented in docstring
156 | | x : int
157 | | An integer.
158 | | """
- | |_______^ DOC201
+ | |_______^
159 | if x < 0:
160 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:167:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:167:5
|
165 | # DOC201 - non-early return explicit None w/o useful type annotations
166 | def foo(x):
@@ -73,13 +78,14 @@ DOC201_numpy.py:167:5: DOC201 `return` is not documented in docstring
171 | | x : int
172 | | An integer.
173 | | """
- | |_______^ DOC201
+ | |_______^
174 | if x < 0:
175 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:182:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:182:5
|
180 | # DOC201 - only returns None, but return annotation is not None
181 | def foo(s: str) -> str | None:
@@ -90,49 +96,53 @@ DOC201_numpy.py:182:5: DOC201 `return` is not documented in docstring
186 | | x : str
187 | | A string.
188 | | """
- | |_______^ DOC201
+ | |_______^
189 | return None
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:194:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:194:5
|
192 | # DOC201
193 | def bar() -> int | None:
194 | """Bar-y method"""
- | ^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^
195 | return
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:220:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:220:5
|
218 | # indicates it could sometimes return `int`
219 | def generator_function_3() -> Generator[str, None, int | None]:
220 | """Generate some strings"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
221 | yield from "abc"
222 | return
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:228:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:228:5
|
226 | # indicates it could sometimes return `int`
227 | def generator_function_4():
228 | """Generate some strings"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
229 | yield from "abc"
230 | return 42
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
-DOC201_numpy.py:235:5: DOC201 `return` is not documented in docstring
+DOC201 `return` is not documented in docstring
+ --> DOC201_numpy.py:235:5
|
233 | # DOC201 -- no `yield` expressions, so not a generator function
234 | def not_a_generator() -> Iterator[int]:
235 | """"No returns documented here, oh no"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
236 | return (x for x in range(42))
|
- = help: Add a "Returns" section to the docstring
+help: Add a "Returns" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py.snap
index 0f1e8d8988..3709ce382b 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC402_google.py:3:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:3:5
|
1 | # DOC402
2 | def foo(num: int) -> str:
@@ -11,12 +12,13 @@ DOC402_google.py:3:5: DOC402 `yield` is not documented in docstring
6 | | Args:
7 | | num (int): A number
8 | | """
- | |_______^ DOC402
+ | |_______^
9 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:44:9: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:44:9
|
42 | # DOC402
43 | def bar(self) -> str:
@@ -26,51 +28,55 @@ DOC402_google.py:44:9: DOC402 `yield` is not documented in docstring
47 | | Args:
48 | | num (int): A number
49 | | """
- | |___________^ DOC402
+ | |___________^
50 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:58:9: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:58:9
|
56 | # DOC402
57 | def nested():
58 | """Do something nested."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC402
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
59 | yield 5
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:66:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:66:5
|
64 | # DOC402
65 | def test():
66 | """Do something."""
- | ^^^^^^^^^^^^^^^^^^^ DOC402
+ | ^^^^^^^^^^^^^^^^^^^
67 | yield from range(10)
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:97:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:97:5
|
95 | # DOC402
96 | def foo() -> collections.abc.Generator[int | None, None, None]:
97 | / """
98 | | Do something
99 | | """
- | |_______^ DOC402
+ | |_______^
100 | yield
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:105:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:105:5
|
103 | # DOC402
104 | def bar() -> collections.abc.Iterator[int | None]:
105 | / """
106 | | Do something
107 | | """
- | |_______^ DOC402
+ | |_______^
108 | yield
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py_ignore_one_line.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py_ignore_one_line.snap
index def7f04c9d..bf09f8e40a 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py_ignore_one_line.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_google.py_ignore_one_line.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC402_google.py:3:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:3:5
|
1 | # DOC402
2 | def foo(num: int) -> str:
@@ -11,12 +12,13 @@ DOC402_google.py:3:5: DOC402 `yield` is not documented in docstring
6 | | Args:
7 | | num (int): A number
8 | | """
- | |_______^ DOC402
+ | |_______^
9 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_google.py:44:9: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_google.py:44:9
|
42 | # DOC402
43 | def bar(self) -> str:
@@ -26,7 +28,7 @@ DOC402_google.py:44:9: DOC402 `yield` is not documented in docstring
47 | | Args:
48 | | num (int): A number
49 | | """
- | |___________^ DOC402
+ | |___________^
50 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_numpy.py.snap
index 6089267205..55e444596a 100644
--- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_numpy.py.snap
+++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-yields_DOC402_numpy.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
---
-DOC402_numpy.py:3:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:3:5
|
1 | # DOC402
2 | def foo(num: int) -> str:
@@ -13,12 +14,13 @@ DOC402_numpy.py:3:5: DOC402 `yield` is not documented in docstring
8 | | num : int
9 | | A number
10 | | """
- | |_______^ DOC402
+ | |_______^
11 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:54:9: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:54:9
|
52 | # DOC402
53 | def bar(self) -> str:
@@ -30,70 +32,75 @@ DOC402_numpy.py:54:9: DOC402 `yield` is not documented in docstring
59 | | num : int
60 | | A number
61 | | """
- | |___________^ DOC402
+ | |___________^
62 | yield 'test'
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:86:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:86:5
|
84 | # DOC402
85 | def foo() -> typing.Generator[int | None, None, None]:
86 | / """
87 | | Do something
88 | | """
- | |_______^ DOC402
+ | |_______^
89 | yield None
90 | yield 1
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:95:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:95:5
|
93 | # DOC402
94 | def foo() -> typing.Generator[int, None, None]:
95 | / """
96 | | Do something
97 | | """
- | |_______^ DOC402
+ | |_______^
98 | yield None
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:119:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:119:5
|
117 | # DOC402
118 | def foo():
119 | / """
120 | | Do something
121 | | """
- | |_______^ DOC402
+ | |_______^
122 | yield None
123 | yield 1
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:128:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:128:5
|
126 | # DOC402
127 | def foo():
128 | / """
129 | | Do something
130 | | """
- | |_______^ DOC402
+ | |_______^
131 | yield 1
132 | yield
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
-DOC402_numpy.py:137:5: DOC402 `yield` is not documented in docstring
+DOC402 `yield` is not documented in docstring
+ --> DOC402_numpy.py:137:5
|
135 | # DOC402
136 | def bar() -> typing.Iterator[int | None]:
137 | / """
138 | | Do something
139 | | """
- | |_______^ DOC402
+ | |_______^
140 | yield
|
- = help: Add a "Yields" section to the docstring
+help: Add a "Yields" section to the docstring
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap
index 9c1041221e..645d4ed7a0 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap
@@ -1,5 +1,5 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:1:1: D100 Missing docstring in public module
+D100 Missing docstring in public module
+--> D.py:1:1
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap
index ba3592fc30..91e675d4f8 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap
@@ -1,5 +1,5 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D100_pub.py:1:1: D100 Missing docstring in public module
+D100 Missing docstring in public module
+--> D100_pub.py:1:1
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D101_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D101_D.py.snap
index c8cf6f9ab7..1997a29cc2 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D101_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D101_D.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:15:7: D101 Missing docstring in public class
+D101 Missing docstring in public class
+ --> D.py:15:7
|
15 | class class_:
- | ^^^^^^ D101
+ | ^^^^^^
16 |
17 | expect('meta', 'D419: Docstring is empty')
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_D.py.snap
index 5528751f71..8368145076 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_D.py.snap
@@ -1,45 +1,49 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:23:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> D.py:23:9
|
22 | @expect('D102: Missing docstring in public method')
23 | def method(self=None):
- | ^^^^^^ D102
+ | ^^^^^^
24 | pass
|
-D.py:56:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> D.py:56:9
|
55 | @expect('D102: Missing docstring in public method')
56 | def __new__(self=None):
- | ^^^^^^^ D102
+ | ^^^^^^^
57 | pass
|
-D.py:68:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> D.py:68:9
|
67 | @expect('D102: Missing docstring in public method')
68 | def __call__(self=None, x=None, y=None, z=None):
- | ^^^^^^^^ D102
+ | ^^^^^^^^
69 | pass
|
-D.py:650:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> D.py:650:9
|
648 | class StatementOnSameLineAsDocstring:
649 | "After this docstring there's another statement on the same line separated by a semicolon." ; priorities=1
650 | def sort_services(self):
- | ^^^^^^^^^^^^^ D102
+ | ^^^^^^^^^^^^^
651 | pass
|
-D.py:659:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> D.py:659:9
|
657 | class CommentAfterDocstring:
658 | "After this docstring there's a comment." # priorities=1
659 | def sort_services(self):
- | ^^^^^^^^^^^^^ D102
+ | ^^^^^^^^^^^^^
660 | pass
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_setter.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_setter.py.snap
index 7a9a4a2c13..576114ab6c 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_setter.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D102_setter.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-setter.py:16:9: D102 Missing docstring in public method
+D102 Missing docstring in public method
+ --> setter.py:16:9
|
15 | @foo
16 | def foo(self, value: str) -> None:
- | ^^^ D102
+ | ^^^
17 | pass
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap
index 3d9711e703..a284864e47 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:400:5: D103 Missing docstring in public function
+D103 Missing docstring in public function
+ --> D.py:400:5
|
399 | @expect("D103: Missing docstring in public function")
400 | def oneliner_d102(): return
- | ^^^^^^^^^^^^^ D103
+ | ^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap
index 25f47b66c0..6baa171cf8 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap
@@ -1,5 +1,5 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-__init__.py:1:1: D104 Missing docstring in public package
+D104 Missing docstring in public package
+--> __init__.py:1:1
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D105_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D105_D.py.snap
index 4b8945a3c2..08833a5f37 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D105_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D105_D.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:64:9: D105 Missing docstring in magic method
+D105 Missing docstring in magic method
+ --> D.py:64:9
|
63 | @expect('D105: Missing docstring in magic method')
64 | def __str__(self=None):
- | ^^^^^^^ D105
+ | ^^^^^^^
65 | pass
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D107_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D107_D.py.snap
index 6fd782e2ce..89e96e38d2 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D107_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D107_D.py.snap
@@ -1,19 +1,21 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:60:9: D107 Missing docstring in `__init__`
+D107 Missing docstring in `__init__`
+ --> D.py:60:9
|
59 | @expect('D107: Missing docstring in __init__')
60 | def __init__(self=None):
- | ^^^^^^^^ D107
+ | ^^^^^^^^
61 | pass
|
-D.py:534:9: D107 Missing docstring in `__init__`
+D107 Missing docstring in `__init__`
+ --> D.py:534:9
|
532 | """
533 |
534 | def __init__(self, x):
- | ^^^^^^^^ D107
+ | ^^^^^^^^
535 | pass
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap
index da2a88322f..89eb2e2bb2 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:129:5: D200 [*] One-line docstring should fit on one line
+D200 [*] One-line docstring should fit on one line
+ --> D.py:129:5
|
127 | @expect('D212: Multi-line docstring summary should start at the first line')
128 | def asdlkfasd():
129 | / """
130 | | Wrong.
131 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
ℹ Unsafe fix
126 126 | '(found 3)')
@@ -24,16 +25,17 @@ D.py:129:5: D200 [*] One-line docstring should fit on one line
133 131 |
134 132 | @expect('D201: No blank lines allowed before function docstring (found 1)')
-D.py:597:5: D200 [*] One-line docstring should fit on one line
+D200 [*] One-line docstring should fit on one line
+ --> D.py:597:5
|
595 | @expect('D212: Multi-line docstring summary should start at the first line')
596 | def one_liner():
597 | / """
598 | |
599 | | Wrong."""
- | |_____________^ D200
+ | |_____________^
|
- = help: Reformat to one line
+help: Reformat to one line
ℹ Unsafe fix
594 594 | '(found 3)')
@@ -47,16 +49,17 @@ D.py:597:5: D200 [*] One-line docstring should fit on one line
601 599 |
602 600 | @expect('D200: One-line docstring should fit on one line with quotes '
-D.py:606:5: D200 [*] One-line docstring should fit on one line
+D200 [*] One-line docstring should fit on one line
+ --> D.py:606:5
|
604 | @expect('D212: Multi-line docstring summary should start at the first line')
605 | def one_liner():
606 | / r"""Wrong.
607 | |
608 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
ℹ Unsafe fix
603 603 | '(found 3)')
@@ -70,35 +73,38 @@ D.py:606:5: D200 [*] One-line docstring should fit on one line
610 608 |
611 609 | @expect('D200: One-line docstring should fit on one line with quotes '
-D.py:615:5: D200 One-line docstring should fit on one line
+D200 One-line docstring should fit on one line
+ --> D.py:615:5
|
613 | @expect('D212: Multi-line docstring summary should start at the first line')
614 | def one_liner():
615 | / """Wrong."
616 | |
617 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
-D.py:624:5: D200 One-line docstring should fit on one line
+D200 One-line docstring should fit on one line
+ --> D.py:624:5
|
622 | @expect('D212: Multi-line docstring summary should start at the first line')
623 | def one_liner():
624 | / """
625 | |
626 | | "Wrong."""
- | |______________^ D200
+ | |______________^
|
- = help: Reformat to one line
+help: Reformat to one line
-D.py:645:5: D200 One-line docstring should fit on one line
+D200 One-line docstring should fit on one line
+ --> D.py:645:5
|
644 | def single_line_docstring_with_an_escaped_backslash():
645 | / "\
646 | | "
- | |_____^ D200
+ | |_____^
647 |
648 | class StatementOnSameLineAsDocstring:
|
- = help: Reformat to one line
+help: Reformat to one line
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap
index 5a77be7454..0ab129407c 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap
@@ -1,23 +1,25 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D200.py:2:5: D200 One-line docstring should fit on one line
+D200 One-line docstring should fit on one line
+ --> D200.py:2:5
|
1 | def func():
2 | / """\
3 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
-D200.py:7:5: D200 [*] One-line docstring should fit on one line
+D200 [*] One-line docstring should fit on one line
+ --> D200.py:7:5
|
6 | def func():
7 | / """\\
8 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
ℹ Unsafe fix
4 4 |
@@ -30,11 +32,12 @@ D200.py:7:5: D200 [*] One-line docstring should fit on one line
10 9 |
11 10 | def func():
-D200.py:12:5: D200 One-line docstring should fit on one line
+D200 One-line docstring should fit on one line
+ --> D200.py:12:5
|
11 | def func():
12 | / """\ \
13 | | """
- | |_______^ D200
+ | |_______^
|
- = help: Reformat to one line
+help: Reformat to one line
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap
index 98a7e7e11e..552f29e140 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:137:5: D201 [*] No blank lines allowed before function docstring (found 1)
+D201 [*] No blank lines allowed before function docstring (found 1)
+ --> D.py:137:5
|
135 | def leading_space():
136 |
137 | """Leading space."""
- | ^^^^^^^^^^^^^^^^^^^^ D201
+ | ^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove blank line(s) before function docstring
+help: Remove blank line(s) before function docstring
ℹ Safe fix
133 133 |
@@ -19,16 +20,17 @@ D.py:137:5: D201 [*] No blank lines allowed before function docstring (found 1)
138 137 |
139 138 |
-D.py:151:5: D201 [*] No blank lines allowed before function docstring (found 1)
+D201 [*] No blank lines allowed before function docstring (found 1)
+ --> D.py:151:5
|
149 | def trailing_and_leading_space():
150 |
151 | """Trailing and leading space."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152 |
153 | pass
|
- = help: Remove blank line(s) before function docstring
+help: Remove blank line(s) before function docstring
ℹ Safe fix
147 147 | @expect('D201: No blank lines allowed before function docstring (found 1)')
@@ -39,7 +41,8 @@ D.py:151:5: D201 [*] No blank lines allowed before function docstring (found 1)
152 151 |
153 152 | pass
-D.py:546:5: D201 [*] No blank lines allowed before function docstring (found 1)
+D201 [*] No blank lines allowed before function docstring (found 1)
+ --> D.py:546:5
|
544 | def multiline_leading_space():
545 |
@@ -47,9 +50,9 @@ D.py:546:5: D201 [*] No blank lines allowed before function docstring (found 1)
547 | |
548 | | More content.
549 | | """
- | |_______^ D201
+ | |_______^
|
- = help: Remove blank line(s) before function docstring
+help: Remove blank line(s) before function docstring
ℹ Safe fix
542 542 | @expect('D201: No blank lines allowed before function docstring (found 1)')
@@ -60,7 +63,8 @@ D.py:546:5: D201 [*] No blank lines allowed before function docstring (found 1)
547 546 |
548 547 | More content.
-D.py:568:5: D201 [*] No blank lines allowed before function docstring (found 1)
+D201 [*] No blank lines allowed before function docstring (found 1)
+ --> D.py:568:5
|
566 | def multiline_trailing_and_leading_space():
567 |
@@ -68,11 +72,11 @@ D.py:568:5: D201 [*] No blank lines allowed before function docstring (found 1)
569 | |
570 | | More content.
571 | | """
- | |_______^ D201
+ | |_______^
572 |
573 | pass
|
- = help: Remove blank line(s) before function docstring
+help: Remove blank line(s) before function docstring
ℹ Safe fix
564 564 | @expect('D202: No blank lines allowed after function docstring (found 1)')
@@ -83,13 +87,14 @@ D.py:568:5: D201 [*] No blank lines allowed before function docstring (found 1)
569 568 |
570 569 | More content.
-D.py:729:5: D201 No blank lines allowed before function docstring (found 1)
+D201 No blank lines allowed before function docstring (found 1)
+ --> D.py:729:5
|
727 | def line_continuation_chars():\
728 |
729 | """No fix should be offered for D201/D202 because of the line continuation chars."""\
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D201
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
730 |
731 | ...
|
- = help: Remove blank line(s) before function docstring
+help: Remove blank line(s) before function docstring
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D.py.snap
index d234ae1d62..c41685f416 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:142:5: D202 [*] No blank lines allowed after function docstring (found 1)
+D202 [*] No blank lines allowed after function docstring (found 1)
+ --> D.py:142:5
|
140 | @expect('D202: No blank lines allowed after function docstring (found 1)')
141 | def trailing_space():
142 | """Leading space."""
- | ^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^
143 |
144 | pass
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
140 140 | @expect('D202: No blank lines allowed after function docstring (found 1)')
@@ -21,16 +22,17 @@ D.py:142:5: D202 [*] No blank lines allowed after function docstring (found 1)
145 144 |
146 145 |
-D.py:151:5: D202 [*] No blank lines allowed after function docstring (found 1)
+D202 [*] No blank lines allowed after function docstring (found 1)
+ --> D.py:151:5
|
149 | def trailing_and_leading_space():
150 |
151 | """Trailing and leading space."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152 |
153 | pass
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
149 149 | def trailing_and_leading_space():
@@ -41,7 +43,8 @@ D.py:151:5: D202 [*] No blank lines allowed after function docstring (found 1)
154 153 |
155 154 |
-D.py:555:5: D202 [*] No blank lines allowed after function docstring (found 1)
+D202 [*] No blank lines allowed after function docstring (found 1)
+ --> D.py:555:5
|
553 | @expect('D213: Multi-line docstring summary should start at the second line')
554 | def multiline_trailing_space():
@@ -49,11 +52,11 @@ D.py:555:5: D202 [*] No blank lines allowed after function docstring (found 1)
556 | |
557 | | More content.
558 | | """
- | |_______^ D202
+ | |_______^
559 |
560 | pass
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
556 556 |
@@ -64,7 +67,8 @@ D.py:555:5: D202 [*] No blank lines allowed after function docstring (found 1)
561 560 |
562 561 |
-D.py:568:5: D202 [*] No blank lines allowed after function docstring (found 1)
+D202 [*] No blank lines allowed after function docstring (found 1)
+ --> D.py:568:5
|
566 | def multiline_trailing_and_leading_space():
567 |
@@ -72,11 +76,11 @@ D.py:568:5: D202 [*] No blank lines allowed after function docstring (found 1)
569 | |
570 | | More content.
571 | | """
- | |_______^ D202
+ | |_______^
572 |
573 | pass
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
569 569 |
@@ -87,13 +91,14 @@ D.py:568:5: D202 [*] No blank lines allowed after function docstring (found 1)
574 573 |
575 574 |
-D.py:729:5: D202 No blank lines allowed after function docstring (found 1)
+D202 No blank lines allowed after function docstring (found 1)
+ --> D.py:729:5
|
727 | def line_continuation_chars():\
728 |
729 | """No fix should be offered for D201/D202 because of the line continuation chars."""\
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
730 |
731 | ...
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap
index 5d400736ed..2212f54da7 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D202.py:57:5: D202 [*] No blank lines allowed after function docstring (found 2)
+D202 [*] No blank lines allowed after function docstring (found 2)
+ --> D202.py:57:5
|
55 | # D202
56 | def outer():
57 | """This is a docstring."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
55 55 | # D202
@@ -20,14 +21,15 @@ D202.py:57:5: D202 [*] No blank lines allowed after function docstring (found 2)
61 59 | return
62 60 |
-D202.py:68:5: D202 [*] No blank lines allowed after function docstring (found 2)
+D202 [*] No blank lines allowed after function docstring (found 2)
+ --> D202.py:68:5
|
66 | # D202
67 | def outer():
68 | """This is a docstring."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
66 66 | # D202
@@ -39,16 +41,17 @@ D202.py:68:5: D202 [*] No blank lines allowed after function docstring (found 2)
72 70 | def inner():
73 71 | return
-D202.py:80:5: D202 [*] No blank lines allowed after function docstring (found 1)
+D202 [*] No blank lines allowed after function docstring (found 1)
+ --> D202.py:80:5
|
78 | # D202
79 | def outer():
80 | """This is a docstring."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D202
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
81 |
82 | # This is a comment.
|
- = help: Remove blank line(s) after function docstring
+help: Remove blank line(s) after function docstring
ℹ Safe fix
78 78 | # D202
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap
index 741f6b8bb2..d8aaf746a0 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:161:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:161:5
|
160 | class LeadingSpaceMissing:
161 | """Leading space missing."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D203
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
158 158 |
@@ -18,14 +19,15 @@ D.py:161:5: D203 [*] 1 blank line required before class docstring
162 163 |
163 164 |
-D.py:192:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:192:5
|
191 | class LeadingAndTrailingSpaceMissing:
192 | """Leading and trailing space missing."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D203
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 | pass
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
189 189 |
@@ -36,7 +38,8 @@ D.py:192:5: D203 [*] 1 blank line required before class docstring
193 194 | pass
194 195 |
-D.py:526:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:526:5
|
524 | # parameters as functions for Google / Numpy conventions.
525 | class Blah: # noqa: D203,D213
@@ -47,11 +50,11 @@ D.py:526:5: D203 [*] 1 blank line required before class docstring
530 | | x : int
531 | |
532 | | """
- | |_______^ D203
+ | |_______^
533 |
534 | def __init__(self, x):
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
523 523 | # This is reproducing a bug where AttributeError is raised when parsing class
@@ -62,15 +65,16 @@ D.py:526:5: D203 [*] 1 blank line required before class docstring
527 528 |
528 529 | Parameters
-D.py:649:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:649:5
|
648 | class StatementOnSameLineAsDocstring:
649 | "After this docstring there's another statement on the same line separated by a semicolon." ; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D203
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
650 | def sort_services(self):
651 | pass
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
646 646 | "
@@ -81,13 +85,14 @@ D.py:649:5: D203 [*] 1 blank line required before class docstring
650 651 | def sort_services(self):
651 652 | pass
-D.py:654:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:654:5
|
653 | class StatementOnSameLineAsDocstring:
654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D203
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
651 651 | pass
@@ -98,15 +103,16 @@ D.py:654:5: D203 [*] 1 blank line required before class docstring
655 656 |
656 657 |
-D.py:658:5: D203 [*] 1 blank line required before class docstring
+D203 [*] 1 blank line required before class docstring
+ --> D.py:658:5
|
657 | class CommentAfterDocstring:
658 | "After this docstring there's a comment." # priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D203
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
659 | def sort_services(self):
660 | pass
|
- = help: Insert 1 blank line before class docstring
+help: Insert 1 blank line before class docstring
ℹ Safe fix
655 655 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap
index 8f7d860a3c..5bdd5f22e7 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:181:5: D204 [*] 1 blank line required after class docstring
+D204 [*] 1 blank line required after class docstring
+ --> D.py:181:5
|
179 | class TrailingSpace:
180 |
181 | """TrailingSpace."""
- | ^^^^^^^^^^^^^^^^^^^^ D204
+ | ^^^^^^^^^^^^^^^^^^^^
182 | pass
|
- = help: Insert 1 blank line after class docstring
+help: Insert 1 blank line after class docstring
ℹ Safe fix
179 179 | class TrailingSpace:
@@ -20,14 +21,15 @@ D.py:181:5: D204 [*] 1 blank line required after class docstring
183 184 |
184 185 |
-D.py:192:5: D204 [*] 1 blank line required after class docstring
+D204 [*] 1 blank line required after class docstring
+ --> D.py:192:5
|
191 | class LeadingAndTrailingSpaceMissing:
192 | """Leading and trailing space missing."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D204
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 | pass
|
- = help: Insert 1 blank line after class docstring
+help: Insert 1 blank line after class docstring
ℹ Safe fix
190 190 |
@@ -38,15 +40,16 @@ D.py:192:5: D204 [*] 1 blank line required after class docstring
194 195 |
195 196 |
-D.py:649:5: D204 [*] 1 blank line required after class docstring
+D204 [*] 1 blank line required after class docstring
+ --> D.py:649:5
|
648 | class StatementOnSameLineAsDocstring:
649 | "After this docstring there's another statement on the same line separated by a semicolon." ; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D204
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
650 | def sort_services(self):
651 | pass
|
- = help: Insert 1 blank line after class docstring
+help: Insert 1 blank line after class docstring
ℹ Safe fix
646 646 | "
@@ -60,13 +63,14 @@ D.py:649:5: D204 [*] 1 blank line required after class docstring
651 653 | pass
652 654 |
-D.py:654:5: D204 [*] 1 blank line required after class docstring
+D204 [*] 1 blank line required after class docstring
+ --> D.py:654:5
|
653 | class StatementOnSameLineAsDocstring:
654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D204
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Insert 1 blank line after class docstring
+help: Insert 1 blank line after class docstring
ℹ Safe fix
651 651 | pass
@@ -80,15 +84,16 @@ D.py:654:5: D204 [*] 1 blank line required after class docstring
656 658 |
657 659 | class CommentAfterDocstring:
-D.py:658:5: D204 [*] 1 blank line required after class docstring
+D204 [*] 1 blank line required after class docstring
+ --> D.py:658:5
|
657 | class CommentAfterDocstring:
658 | "After this docstring there's a comment." # priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D204
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
659 | def sort_services(self):
660 | pass
|
- = help: Insert 1 blank line after class docstring
+help: Insert 1 blank line after class docstring
ℹ Safe fix
656 656 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap
index 3c6ca20580..417c81ed81 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:200:5: D205 1 blank line required between summary line and description
+D205 1 blank line required between summary line and description
+ --> D.py:200:5
|
198 | @expect('D213: Multi-line docstring summary should start at the second line')
199 | def multi_line_zero_separating_blanks():
@@ -9,11 +10,12 @@ D.py:200:5: D205 1 blank line required between summary line and description
201 | | Description.
202 | |
203 | | """
- | |_______^ D205
+ | |_______^
|
- = help: Insert single blank line
+help: Insert single blank line
-D.py:210:5: D205 [*] 1 blank line required between summary line and description (found 2)
+D205 [*] 1 blank line required between summary line and description (found 2)
+ --> D.py:210:5
|
208 | @expect('D213: Multi-line docstring summary should start at the second line')
209 | def multi_line_two_separating_blanks():
@@ -23,9 +25,9 @@ D.py:210:5: D205 [*] 1 blank line required between summary line and description
213 | | Description.
214 | |
215 | | """
- | |_______^ D205
+ | |_______^
|
- = help: Insert single blank line
+help: Insert single blank line
ℹ Safe fix
209 209 | def multi_line_two_separating_blanks():
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap
index e06aa71405..0865368e89 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:232:1: D207 [*] Docstring is under-indented
+D207 [*] Docstring is under-indented
+ --> D.py:232:1
|
230 | """Summary.
231 |
232 | Description.
- | ^ D207
+ | ^
233 |
234 | """
|
- = help: Increase indentation
+help: Increase indentation
ℹ Safe fix
229 229 | def asdfsdf():
@@ -22,14 +23,15 @@ D.py:232:1: D207 [*] Docstring is under-indented
234 234 | """
235 235 |
-D.py:244:1: D207 [*] Docstring is under-indented
+D207 [*] Docstring is under-indented
+ --> D.py:244:1
|
242 | Description.
243 |
244 | """
- | ^ D207
+ | ^
|
- = help: Increase indentation
+help: Increase indentation
ℹ Safe fix
241 241 |
@@ -41,15 +43,16 @@ D.py:244:1: D207 [*] Docstring is under-indented
246 246 |
247 247 | @expect('D208: Docstring is over-indented')
-D.py:440:1: D207 [*] Docstring is under-indented
+D207 [*] Docstring is under-indented
+ --> D.py:440:1
|
438 | def docstring_start_in_same_line(): """First Line.
439 |
440 | Second Line
- | ^ D207
+ | ^
441 | """
|
- = help: Increase indentation
+help: Increase indentation
ℹ Safe fix
437 437 | @expect('D213: Multi-line docstring summary should start at the second line')
@@ -61,13 +64,14 @@ D.py:440:1: D207 [*] Docstring is under-indented
442 442 |
443 443 |
-D.py:441:1: D207 [*] Docstring is under-indented
+D207 [*] Docstring is under-indented
+ --> D.py:441:1
|
440 | Second Line
441 | """
- | ^ D207
+ | ^
|
- = help: Increase indentation
+help: Increase indentation
ℹ Safe fix
438 438 | def docstring_start_in_same_line(): """First Line.
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap
index acf0b91d6c..c54989a221 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:252:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:252:1
|
250 | """Summary.
251 |
252 | Description.
- | ^ D208
+ | ^
253 |
254 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
249 249 | def asdfsdsdf24():
@@ -22,14 +23,15 @@ D.py:252:1: D208 [*] Docstring is over-indented
254 254 | """
255 255 |
-D.py:264:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:264:1
|
262 | Description.
263 |
264 | """
- | ^ D208
+ | ^
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
261 261 |
@@ -41,16 +43,17 @@ D.py:264:1: D208 [*] Docstring is over-indented
266 266 |
267 267 | @expect('D208: Docstring is over-indented')
-D.py:272:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:272:1
|
270 | """Summary.
271 |
272 | Description.
- | ^ D208
+ | ^
273 |
274 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
269 269 | def asdfsdfsdsdsdfsdf24():
@@ -62,16 +65,17 @@ D.py:272:1: D208 [*] Docstring is over-indented
274 274 | """
275 275 |
-D.py:673:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:673:1
|
671 | """Summary.
672 |
673 | This is overindented
- | ^ D208
+ | ^
674 | And so is this, but it we should preserve the extra space on this line relative
675 | to the one before
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
670 670 | def retain_extra_whitespace():
@@ -83,15 +87,16 @@ D.py:673:1: D208 [*] Docstring is over-indented
675 675 | to the one before
676 676 | """
-D.py:674:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:674:1
|
673 | This is overindented
674 | And so is this, but it we should preserve the extra space on this line relative
- | ^ D208
+ | ^
675 | to the one before
676 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
671 671 | """Summary.
@@ -103,15 +108,16 @@ D.py:674:1: D208 [*] Docstring is over-indented
676 676 | """
677 677 |
-D.py:675:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:675:1
|
673 | This is overindented
674 | And so is this, but it we should preserve the extra space on this line relative
675 | to the one before
- | ^ D208
+ | ^
676 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
672 672 |
@@ -123,16 +129,17 @@ D.py:675:1: D208 [*] Docstring is over-indented
677 677 |
678 678 |
-D.py:682:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:682:1
|
680 | """Summary.
681 |
682 | This is overindented
- | ^ D208
+ | ^
683 | And so is this, but it we should preserve the extra space on this line relative
684 | to the one before
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
679 679 | def retain_extra_whitespace_multiple():
@@ -144,15 +151,16 @@ D.py:682:1: D208 [*] Docstring is over-indented
684 684 | to the one before
685 685 | This is also overindented
-D.py:683:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:683:1
|
682 | This is overindented
683 | And so is this, but it we should preserve the extra space on this line relative
- | ^ D208
+ | ^
684 | to the one before
685 | This is also overindented
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
680 680 | """Summary.
@@ -164,16 +172,17 @@ D.py:683:1: D208 [*] Docstring is over-indented
685 685 | This is also overindented
686 686 | And so is this, but it we should preserve the extra space on this line relative
-D.py:684:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:684:1
|
682 | This is overindented
683 | And so is this, but it we should preserve the extra space on this line relative
684 | to the one before
- | ^ D208
+ | ^
685 | This is also overindented
686 | And so is this, but it we should preserve the extra space on this line relative
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
681 681 |
@@ -185,16 +194,17 @@ D.py:684:1: D208 [*] Docstring is over-indented
686 686 | And so is this, but it we should preserve the extra space on this line relative
687 687 | to the one before
-D.py:685:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:685:1
|
683 | And so is this, but it we should preserve the extra space on this line relative
684 | to the one before
685 | This is also overindented
- | ^ D208
+ | ^
686 | And so is this, but it we should preserve the extra space on this line relative
687 | to the one before
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
682 682 | This is overindented
@@ -206,16 +216,17 @@ D.py:685:1: D208 [*] Docstring is over-indented
687 687 | to the one before
688 688 | """
-D.py:686:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:686:1
|
684 | to the one before
685 | This is also overindented
686 | And so is this, but it we should preserve the extra space on this line relative
- | ^ D208
+ | ^
687 | to the one before
688 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
683 683 | And so is this, but it we should preserve the extra space on this line relative
@@ -227,15 +238,16 @@ D.py:686:1: D208 [*] Docstring is over-indented
688 688 | """
689 689 |
-D.py:687:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:687:1
|
685 | This is also overindented
686 | And so is this, but it we should preserve the extra space on this line relative
687 | to the one before
- | ^ D208
+ | ^
688 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
684 684 | to the one before
@@ -247,16 +259,17 @@ D.py:687:1: D208 [*] Docstring is over-indented
689 689 |
690 690 |
-D.py:695:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:695:1
|
693 | """Summary.
694 |
695 | This is overindented
- | ^ D208
+ | ^
696 | And so is this, but it we should preserve the extra space on this line relative
697 | to the one before
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
692 692 | def retain_extra_whitespace_deeper():
@@ -268,15 +281,16 @@ D.py:695:1: D208 [*] Docstring is over-indented
697 697 | to the one before
698 698 | And the relative indent here should be preserved too
-D.py:696:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:696:1
|
695 | This is overindented
696 | And so is this, but it we should preserve the extra space on this line relative
- | ^ D208
+ | ^
697 | to the one before
698 | And the relative indent here should be preserved too
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
693 693 | """Summary.
@@ -288,16 +302,17 @@ D.py:696:1: D208 [*] Docstring is over-indented
698 698 | And the relative indent here should be preserved too
699 699 | """
-D.py:697:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:697:1
|
695 | This is overindented
696 | And so is this, but it we should preserve the extra space on this line relative
697 | to the one before
- | ^ D208
+ | ^
698 | And the relative indent here should be preserved too
699 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
694 694 |
@@ -309,15 +324,16 @@ D.py:697:1: D208 [*] Docstring is over-indented
699 699 | """
700 700 |
-D.py:698:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:698:1
|
696 | And so is this, but it we should preserve the extra space on this line relative
697 | to the one before
698 | And the relative indent here should be preserved too
- | ^ D208
+ | ^
699 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
695 695 | This is overindented
@@ -329,16 +345,17 @@ D.py:698:1: D208 [*] Docstring is over-indented
700 700 |
701 701 | def retain_extra_whitespace_followed_by_same_offset():
-D.py:704:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:704:1
|
702 | """Summary.
703 |
704 | This is overindented
- | ^ D208
+ | ^
705 | And so is this, but it we should preserve the extra space on this line relative
706 | This is overindented
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
701 701 | def retain_extra_whitespace_followed_by_same_offset():
@@ -350,15 +367,16 @@ D.py:704:1: D208 [*] Docstring is over-indented
706 706 | This is overindented
707 707 | This is overindented
-D.py:705:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:705:1
|
704 | This is overindented
705 | And so is this, but it we should preserve the extra space on this line relative
- | ^ D208
+ | ^
706 | This is overindented
707 | This is overindented
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
702 702 | """Summary.
@@ -370,16 +388,17 @@ D.py:705:1: D208 [*] Docstring is over-indented
707 707 | This is overindented
708 708 | """
-D.py:706:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:706:1
|
704 | This is overindented
705 | And so is this, but it we should preserve the extra space on this line relative
706 | This is overindented
- | ^ D208
+ | ^
707 | This is overindented
708 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
703 703 |
@@ -391,15 +410,16 @@ D.py:706:1: D208 [*] Docstring is over-indented
708 708 | """
709 709 |
-D.py:707:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:707:1
|
705 | And so is this, but it we should preserve the extra space on this line relative
706 | This is overindented
707 | This is overindented
- | ^ D208
+ | ^
708 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
704 704 | This is overindented
@@ -411,15 +431,16 @@ D.py:707:1: D208 [*] Docstring is over-indented
709 709 |
710 710 |
-D.py:723:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D.py:723:1
|
721 | """There's a non-breaking space (2-bytes) after 3 spaces (https://github.com/astral-sh/ruff/issues/9080).
722 |
723 | Returns:
- | ^ D208
+ | ^
724 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
720 720 | def inconsistent_indent_byte_size():
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap
index afcfd6d347..e6a1707a5b 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D208.py:2:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:2:1
|
1 | """
2 | Author
- | ^ D208
+ | ^
3 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
1 1 | """
@@ -18,16 +19,17 @@ D208.py:2:1: D208 [*] Docstring is over-indented
4 4 |
5 5 |
-D208.py:8:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:8:1
|
6 | class Platform:
7 | """ Remove sampler
8 | Args:
- | ^ D208
+ | ^
9 | Returns:
10 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
5 5 |
@@ -39,15 +41,16 @@ D208.py:8:1: D208 [*] Docstring is over-indented
10 10 | """
11 11 |
-D208.py:9:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:9:1
|
7 | """ Remove sampler
8 | Args:
9 | Returns:
- | ^ D208
+ | ^
10 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
6 6 | class Platform:
@@ -59,14 +62,15 @@ D208.py:9:1: D208 [*] Docstring is over-indented
11 11 |
12 12 |
-D208.py:10:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:10:1
|
8 | Args:
9 | Returns:
10 | """
- | ^ D208
+ | ^
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
7 7 | """ Remove sampler
@@ -78,14 +82,15 @@ D208.py:10:1: D208 [*] Docstring is over-indented
12 12 |
13 13 | def memory_test():
-D208.py:24:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:24:1
|
22 | Args:
23 | Returns:
24 | """
- | ^ D208
+ | ^
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
21 21 | """Over indented last line
@@ -97,16 +102,17 @@ D208.py:24:1: D208 [*] Docstring is over-indented
26 26 |
27 27 | class Platform:
-D208.py:29:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:29:1
|
27 | class Platform:
28 | """All lines are over indented including the last containing the closing quotes
29 | Args:
- | ^ D208
+ | ^
30 | Returns:
31 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
26 26 |
@@ -118,15 +124,16 @@ D208.py:29:1: D208 [*] Docstring is over-indented
31 31 | """
32 32 |
-D208.py:30:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:30:1
|
28 | """All lines are over indented including the last containing the closing quotes
29 | Args:
30 | Returns:
- | ^ D208
+ | ^
31 | """
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
27 27 | class Platform:
@@ -138,16 +145,17 @@ D208.py:30:1: D208 [*] Docstring is over-indented
32 32 |
33 33 | class Platform:
-D208.py:31:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:31:1
|
29 | Args:
30 | Returns:
31 | """
- | ^ D208
+ | ^
32 |
33 | class Platform:
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
28 28 | """All lines are over indented including the last containing the closing quotes
@@ -159,15 +167,16 @@ D208.py:31:1: D208 [*] Docstring is over-indented
33 33 | class Platform:
34 34 | """All lines are over indented including the last
-D208.py:35:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:35:1
|
33 | class Platform:
34 | """All lines are over indented including the last
35 | Args:
- | ^ D208
+ | ^
36 | Returns"""
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
32 32 |
@@ -179,16 +188,17 @@ D208.py:35:1: D208 [*] Docstring is over-indented
37 37 |
38 38 | # OK: This doesn't get flagged because it is accepted when the closing quotes are on a separate line (see next test). Raises D209
-D208.py:36:1: D208 [*] Docstring is over-indented
+D208 [*] Docstring is over-indented
+ --> D208.py:36:1
|
34 | """All lines are over indented including the last
35 | Args:
36 | Returns"""
- | ^ D208
+ | ^
37 |
38 | # OK: This doesn't get flagged because it is accepted when the closing quotes are on a separate line (see next test). Raises D209
|
- = help: Remove over-indentation
+help: Remove over-indentation
ℹ Safe fix
33 33 | class Platform:
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap
index abaf49d7af..fcfd42cb1a 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:281:5: D209 [*] Multi-line docstring closing quotes should be on a separate line
+D209 [*] Multi-line docstring closing quotes should be on a separate line
+ --> D.py:281:5
|
279 | @expect('D213: Multi-line docstring summary should start at the second line')
280 | def asdfljdf24():
281 | / """Summary.
282 | |
283 | | Description."""
- | |___________________^ D209
+ | |___________________^
|
- = help: Move closing quotes to new line
+help: Move closing quotes to new line
ℹ Safe fix
280 280 | def asdfljdf24():
@@ -23,16 +24,17 @@ D.py:281:5: D209 [*] Multi-line docstring closing quotes should be on a separate
285 286 |
286 287 | @expect('D210: No whitespaces allowed surrounding docstring text')
-D.py:588:5: D209 [*] Multi-line docstring closing quotes should be on a separate line
+D209 [*] Multi-line docstring closing quotes should be on a separate line
+ --> D.py:588:5
|
586 | @expect('D213: Multi-line docstring summary should start at the second line')
587 | def asdfljdjgf24():
588 | / """Summary.
589 | |
590 | | Description. """
- | |_____________________^ D209
+ | |_____________________^
|
- = help: Move closing quotes to new line
+help: Move closing quotes to new line
ℹ Safe fix
587 587 | def asdfljdjgf24():
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap
index a964004890..4a65482cfe 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:288:5: D210 [*] No whitespaces allowed surrounding docstring text
+D210 [*] No whitespaces allowed surrounding docstring text
+ --> D.py:288:5
|
286 | @expect('D210: No whitespaces allowed surrounding docstring text')
287 | def endswith():
288 | """Whitespace at the end. """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D210
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Trim surrounding whitespace
+help: Trim surrounding whitespace
ℹ Safe fix
285 285 |
@@ -20,14 +21,15 @@ D.py:288:5: D210 [*] No whitespaces allowed surrounding docstring text
290 290 |
291 291 | @expect('D210: No whitespaces allowed surrounding docstring text')
-D.py:293:5: D210 [*] No whitespaces allowed surrounding docstring text
+D210 [*] No whitespaces allowed surrounding docstring text
+ --> D.py:293:5
|
291 | @expect('D210: No whitespaces allowed surrounding docstring text')
292 | def around():
293 | """ Whitespace at everywhere. """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D210
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Trim surrounding whitespace
+help: Trim surrounding whitespace
ℹ Safe fix
290 290 |
@@ -39,7 +41,8 @@ D.py:293:5: D210 [*] No whitespaces allowed surrounding docstring text
295 295 |
296 296 | @expect('D210: No whitespaces allowed surrounding docstring text')
-D.py:299:5: D210 [*] No whitespaces allowed surrounding docstring text
+D210 [*] No whitespaces allowed surrounding docstring text
+ --> D.py:299:5
|
297 | @expect('D213: Multi-line docstring summary should start at the second line')
298 | def multiline():
@@ -47,9 +50,9 @@ D.py:299:5: D210 [*] No whitespaces allowed surrounding docstring text
300 | |
301 | | This is the end.
302 | | """
- | |_______^ D210
+ | |_______^
|
- = help: Trim surrounding whitespace
+help: Trim surrounding whitespace
ℹ Safe fix
296 296 | @expect('D210: No whitespaces allowed surrounding docstring text')
@@ -61,11 +64,12 @@ D.py:299:5: D210 [*] No whitespaces allowed surrounding docstring text
301 301 | This is the end.
302 302 | """
-D.py:581:5: D210 No whitespaces allowed surrounding docstring text
+D210 No whitespaces allowed surrounding docstring text
+ --> D.py:581:5
|
579 | "or exclamation point (not '\"')")
580 | def endswith_quote():
581 | """Whitespace at the end, but also a quote" """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D210
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Trim surrounding whitespace
+help: Trim surrounding whitespace
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap
index affb5b409e..7826cc5fb1 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:170:5: D211 [*] No blank lines allowed before class docstring
+D211 [*] No blank lines allowed before class docstring
+ --> D.py:170:5
|
168 | class WithLeadingSpace:
169 |
170 | """With leading space."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ D211
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove blank line(s) before class docstring
+help: Remove blank line(s) before class docstring
ℹ Safe fix
166 166 |
@@ -19,15 +20,16 @@ D.py:170:5: D211 [*] No blank lines allowed before class docstring
171 170 |
172 171 |
-D.py:181:5: D211 [*] No blank lines allowed before class docstring
+D211 [*] No blank lines allowed before class docstring
+ --> D.py:181:5
|
179 | class TrailingSpace:
180 |
181 | """TrailingSpace."""
- | ^^^^^^^^^^^^^^^^^^^^ D211
+ | ^^^^^^^^^^^^^^^^^^^^
182 | pass
|
- = help: Remove blank line(s) before class docstring
+help: Remove blank line(s) before class docstring
ℹ Safe fix
177 177 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap
index 5e8b8881c2..b934ae897e 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:129:5: D212 [*] Multi-line docstring summary should start at the first line
+D212 [*] Multi-line docstring summary should start at the first line
+ --> D.py:129:5
|
127 | @expect('D212: Multi-line docstring summary should start at the first line')
128 | def asdlkfasd():
129 | / """
130 | | Wrong.
131 | | """
- | |_______^ D212
+ | |_______^
|
- = help: Remove whitespace after opening quotes
+help: Remove whitespace after opening quotes
ℹ Safe fix
126 126 | '(found 3)')
@@ -23,16 +24,17 @@ D.py:129:5: D212 [*] Multi-line docstring summary should start at the first line
132 131 |
133 132 |
-D.py:597:5: D212 [*] Multi-line docstring summary should start at the first line
+D212 [*] Multi-line docstring summary should start at the first line
+ --> D.py:597:5
|
595 | @expect('D212: Multi-line docstring summary should start at the first line')
596 | def one_liner():
597 | / """
598 | |
599 | | Wrong."""
- | |_____________^ D212
+ | |_____________^
|
- = help: Remove whitespace after opening quotes
+help: Remove whitespace after opening quotes
ℹ Safe fix
594 594 | '(found 3)')
@@ -46,16 +48,17 @@ D.py:597:5: D212 [*] Multi-line docstring summary should start at the first line
601 599 |
602 600 | @expect('D200: One-line docstring should fit on one line with quotes '
-D.py:624:5: D212 [*] Multi-line docstring summary should start at the first line
+D212 [*] Multi-line docstring summary should start at the first line
+ --> D.py:624:5
|
622 | @expect('D212: Multi-line docstring summary should start at the first line')
623 | def one_liner():
624 | / """
625 | |
626 | | "Wrong."""
- | |______________^ D212
+ | |______________^
|
- = help: Remove whitespace after opening quotes
+help: Remove whitespace after opening quotes
ℹ Safe fix
621 621 | '(found 3)')
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap
index 66aa330b5a..7b1de443da 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap
@@ -1,7 +1,8 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:200:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:200:5
|
198 | @expect('D213: Multi-line docstring summary should start at the second line')
199 | def multi_line_zero_separating_blanks():
@@ -9,9 +10,9 @@ D.py:200:5: D213 [*] Multi-line docstring summary should start at the second lin
201 | | Description.
202 | |
203 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
197 197 | '(found 0)')
@@ -24,7 +25,8 @@ D.py:200:5: D213 [*] Multi-line docstring summary should start at the second lin
202 203 |
203 204 | """
-D.py:210:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:210:5
|
208 | @expect('D213: Multi-line docstring summary should start at the second line')
209 | def multi_line_two_separating_blanks():
@@ -34,9 +36,9 @@ D.py:210:5: D213 [*] Multi-line docstring summary should start at the second lin
213 | | Description.
214 | |
215 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
207 207 | '(found 2)')
@@ -49,7 +51,8 @@ D.py:210:5: D213 [*] Multi-line docstring summary should start at the second lin
212 213 |
213 214 | Description.
-D.py:220:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:220:5
|
218 | @expect('D213: Multi-line docstring summary should start at the second line')
219 | def multi_line_one_separating_blanks():
@@ -58,9 +61,9 @@ D.py:220:5: D213 [*] Multi-line docstring summary should start at the second lin
222 | | Description.
223 | |
224 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
217 217 |
@@ -73,7 +76,8 @@ D.py:220:5: D213 [*] Multi-line docstring summary should start at the second lin
222 223 | Description.
223 224 |
-D.py:230:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:230:5
|
228 | @expect('D213: Multi-line docstring summary should start at the second line')
229 | def asdfsdf():
@@ -82,9 +86,9 @@ D.py:230:5: D213 [*] Multi-line docstring summary should start at the second lin
232 | | Description.
233 | |
234 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
227 227 | @expect('D207: Docstring is under-indented')
@@ -97,7 +101,8 @@ D.py:230:5: D213 [*] Multi-line docstring summary should start at the second lin
232 233 | Description.
233 234 |
-D.py:240:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:240:5
|
238 | @expect('D213: Multi-line docstring summary should start at the second line')
239 | def asdsdfsdffsdf():
@@ -106,9 +111,9 @@ D.py:240:5: D213 [*] Multi-line docstring summary should start at the second lin
242 | | Description.
243 | |
244 | | """
- | |___^ D213
+ | |___^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
237 237 | @expect('D207: Docstring is under-indented')
@@ -121,7 +126,8 @@ D.py:240:5: D213 [*] Multi-line docstring summary should start at the second lin
242 243 | Description.
243 244 |
-D.py:250:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:250:5
|
248 | @expect('D213: Multi-line docstring summary should start at the second line')
249 | def asdfsdsdf24():
@@ -130,9 +136,9 @@ D.py:250:5: D213 [*] Multi-line docstring summary should start at the second lin
252 | | Description.
253 | |
254 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
247 247 | @expect('D208: Docstring is over-indented')
@@ -145,7 +151,8 @@ D.py:250:5: D213 [*] Multi-line docstring summary should start at the second lin
252 253 | Description.
253 254 |
-D.py:260:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:260:5
|
258 | @expect('D213: Multi-line docstring summary should start at the second line')
259 | def asdfsdsdfsdf24():
@@ -154,9 +161,9 @@ D.py:260:5: D213 [*] Multi-line docstring summary should start at the second lin
262 | | Description.
263 | |
264 | | """
- | |___________^ D213
+ | |___________^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
257 257 | @expect('D208: Docstring is over-indented')
@@ -169,7 +176,8 @@ D.py:260:5: D213 [*] Multi-line docstring summary should start at the second lin
262 263 | Description.
263 264 |
-D.py:270:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:270:5
|
268 | @expect('D213: Multi-line docstring summary should start at the second line')
269 | def asdfsdfsdsdsdfsdf24():
@@ -178,9 +186,9 @@ D.py:270:5: D213 [*] Multi-line docstring summary should start at the second lin
272 | | Description.
273 | |
274 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
267 267 | @expect('D208: Docstring is over-indented')
@@ -193,16 +201,17 @@ D.py:270:5: D213 [*] Multi-line docstring summary should start at the second lin
272 273 | Description.
273 274 |
-D.py:281:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:281:5
|
279 | @expect('D213: Multi-line docstring summary should start at the second line')
280 | def asdfljdf24():
281 | / """Summary.
282 | |
283 | | Description."""
- | |___________________^ D213
+ | |___________________^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
278 278 | 'line')
@@ -215,7 +224,8 @@ D.py:281:5: D213 [*] Multi-line docstring summary should start at the second lin
283 284 | Description."""
284 285 |
-D.py:299:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:299:5
|
297 | @expect('D213: Multi-line docstring summary should start at the second line')
298 | def multiline():
@@ -223,9 +233,9 @@ D.py:299:5: D213 [*] Multi-line docstring summary should start at the second lin
300 | |
301 | | This is the end.
302 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
296 296 | @expect('D210: No whitespaces allowed surrounding docstring text')
@@ -238,7 +248,8 @@ D.py:299:5: D213 [*] Multi-line docstring summary should start at the second lin
301 302 | This is the end.
302 303 | """
-D.py:343:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:343:5
|
341 | @expect('D213: Multi-line docstring summary should start at the second line')
342 | def exceptions_of_D301():
@@ -248,9 +259,9 @@ D.py:343:5: D213 [*] Multi-line docstring summary should start at the second lin
346 | | and unicode literals \u0394 and \N{GREEK CAPITAL LETTER DELTA}.
347 | | They are considered to be intentionally unescaped.
348 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
340 340 |
@@ -263,7 +274,8 @@ D.py:343:5: D213 [*] Multi-line docstring summary should start at the second lin
345 346 | In particular, line continuations \
346 347 | and unicode literals \u0394 and \N{GREEK CAPITAL LETTER DELTA}.
-D.py:383:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:383:5
|
381 | @expect('D213: Multi-line docstring summary should start at the second line')
382 | def new_209():
@@ -271,10 +283,10 @@ D.py:383:5: D213 [*] Multi-line docstring summary should start at the second lin
384 | |
385 | | More lines.
386 | | """
- | |_______^ D213
+ | |_______^
387 | pass
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
380 380 |
@@ -287,7 +299,8 @@ D.py:383:5: D213 [*] Multi-line docstring summary should start at the second lin
385 386 | More lines.
386 387 | """
-D.py:392:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:392:5
|
390 | @expect('D213: Multi-line docstring summary should start at the second line')
391 | def old_209():
@@ -296,9 +309,9 @@ D.py:392:5: D213 [*] Multi-line docstring summary should start at the second lin
394 | | Multi-line comments. OK to have extra blank line
395 | |
396 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
389 389 |
@@ -311,7 +324,8 @@ D.py:392:5: D213 [*] Multi-line docstring summary should start at the second lin
394 395 | Multi-line comments. OK to have extra blank line
395 396 |
-D.py:438:37: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:438:37
|
436 | @expect("D207: Docstring is under-indented")
437 | @expect('D213: Multi-line docstring summary should start at the second line')
@@ -320,9 +334,9 @@ D.py:438:37: D213 [*] Multi-line docstring summary should start at the second li
439 | |
440 | | Second Line
441 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
435 435 |
@@ -335,7 +349,8 @@ D.py:438:37: D213 [*] Multi-line docstring summary should start at the second li
440 441 | Second Line
441 442 | """
-D.py:450:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:450:5
|
448 | @expect('D213: Multi-line docstring summary should start at the second line')
449 | def a_following_valid_function(x=None):
@@ -344,9 +359,9 @@ D.py:450:5: D213 [*] Multi-line docstring summary should start at the second lin
452 | | The assertion was caused in the next function, so this one is necessary.
453 | |
454 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
447 447 |
@@ -359,7 +374,8 @@ D.py:450:5: D213 [*] Multi-line docstring summary should start at the second lin
452 453 | The assertion was caused in the next function, so this one is necessary.
453 454 |
-D.py:526:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:526:5
|
524 | # parameters as functions for Google / Numpy conventions.
525 | class Blah: # noqa: D203,D213
@@ -370,11 +386,11 @@ D.py:526:5: D213 [*] Multi-line docstring summary should start at the second lin
530 | | x : int
531 | |
532 | | """
- | |_______^ D213
+ | |_______^
533 |
534 | def __init__(self, x):
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
523 523 | # This is reproducing a bug where AttributeError is raised when parsing class
@@ -387,7 +403,8 @@ D.py:526:5: D213 [*] Multi-line docstring summary should start at the second lin
528 529 | Parameters
529 530 | ----------
-D.py:546:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:546:5
|
544 | def multiline_leading_space():
545 |
@@ -395,9 +412,9 @@ D.py:546:5: D213 [*] Multi-line docstring summary should start at the second lin
547 | |
548 | | More content.
549 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
543 543 | @expect('D213: Multi-line docstring summary should start at the second line')
@@ -410,7 +427,8 @@ D.py:546:5: D213 [*] Multi-line docstring summary should start at the second lin
548 549 | More content.
549 550 | """
-D.py:555:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:555:5
|
553 | @expect('D213: Multi-line docstring summary should start at the second line')
554 | def multiline_trailing_space():
@@ -418,11 +436,11 @@ D.py:555:5: D213 [*] Multi-line docstring summary should start at the second lin
556 | |
557 | | More content.
558 | | """
- | |_______^ D213
+ | |_______^
559 |
560 | pass
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
552 552 | @expect('D202: No blank lines allowed after function docstring (found 1)')
@@ -435,7 +453,8 @@ D.py:555:5: D213 [*] Multi-line docstring summary should start at the second lin
557 558 | More content.
558 559 | """
-D.py:568:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:568:5
|
566 | def multiline_trailing_and_leading_space():
567 |
@@ -443,11 +462,11 @@ D.py:568:5: D213 [*] Multi-line docstring summary should start at the second lin
569 | |
570 | | More content.
571 | | """
- | |_______^ D213
+ | |_______^
572 |
573 | pass
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
565 565 | @expect('D213: Multi-line docstring summary should start at the second line')
@@ -460,16 +479,17 @@ D.py:568:5: D213 [*] Multi-line docstring summary should start at the second lin
570 571 | More content.
571 572 | """
-D.py:588:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:588:5
|
586 | @expect('D213: Multi-line docstring summary should start at the second line')
587 | def asdfljdjgf24():
588 | / """Summary.
589 | |
590 | | Description. """
- | |_____________________^ D213
+ | |_____________________^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
585 585 | 'line')
@@ -482,16 +502,17 @@ D.py:588:5: D213 [*] Multi-line docstring summary should start at the second lin
590 591 | Description. """
591 592 |
-D.py:606:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:606:5
|
604 | @expect('D212: Multi-line docstring summary should start at the first line')
605 | def one_liner():
606 | / r"""Wrong.
607 | |
608 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
603 603 | '(found 3)')
@@ -504,16 +525,17 @@ D.py:606:5: D213 [*] Multi-line docstring summary should start at the second lin
608 609 | """
609 610 |
-D.py:615:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:615:5
|
613 | @expect('D212: Multi-line docstring summary should start at the first line')
614 | def one_liner():
615 | / """Wrong."
616 | |
617 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
612 612 | '(found 3)')
@@ -526,7 +548,8 @@ D.py:615:5: D213 [*] Multi-line docstring summary should start at the second lin
617 618 | """
618 619 |
-D.py:671:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:671:5
|
670 | def retain_extra_whitespace():
671 | / """Summary.
@@ -535,9 +558,9 @@ D.py:671:5: D213 [*] Multi-line docstring summary should start at the second lin
674 | | And so is this, but it we should preserve the extra space on this line relative
675 | | to the one before
676 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
668 668 |
@@ -550,7 +573,8 @@ D.py:671:5: D213 [*] Multi-line docstring summary should start at the second lin
673 674 | This is overindented
674 675 | And so is this, but it we should preserve the extra space on this line relative
-D.py:680:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:680:5
|
679 | def retain_extra_whitespace_multiple():
680 | / """Summary.
@@ -562,9 +586,9 @@ D.py:680:5: D213 [*] Multi-line docstring summary should start at the second lin
686 | | And so is this, but it we should preserve the extra space on this line relative
687 | | to the one before
688 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
677 677 |
@@ -577,7 +601,8 @@ D.py:680:5: D213 [*] Multi-line docstring summary should start at the second lin
682 683 | This is overindented
683 684 | And so is this, but it we should preserve the extra space on this line relative
-D.py:693:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:693:5
|
692 | def retain_extra_whitespace_deeper():
693 | / """Summary.
@@ -587,11 +612,11 @@ D.py:693:5: D213 [*] Multi-line docstring summary should start at the second lin
697 | | to the one before
698 | | And the relative indent here should be preserved too
699 | | """
- | |_______^ D213
+ | |_______^
700 |
701 | def retain_extra_whitespace_followed_by_same_offset():
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
690 690 |
@@ -604,7 +629,8 @@ D.py:693:5: D213 [*] Multi-line docstring summary should start at the second lin
695 696 | This is overindented
696 697 | And so is this, but it we should preserve the extra space on this line relative
-D.py:702:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:702:5
|
701 | def retain_extra_whitespace_followed_by_same_offset():
702 | / """Summary.
@@ -614,9 +640,9 @@ D.py:702:5: D213 [*] Multi-line docstring summary should start at the second lin
706 | | This is overindented
707 | | This is overindented
708 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
699 699 | """
@@ -629,7 +655,8 @@ D.py:702:5: D213 [*] Multi-line docstring summary should start at the second lin
704 705 | This is overindented
705 706 | And so is this, but it we should preserve the extra space on this line relative
-D.py:712:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:712:5
|
711 | def retain_extra_whitespace_not_overindented():
712 | / """Summary.
@@ -638,9 +665,9 @@ D.py:712:5: D213 [*] Multi-line docstring summary should start at the second lin
715 | | This is overindented, but since one line is not overindented this should not raise
716 | | And so is this, but it we should preserve the extra space on this line relative
717 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
709 709 |
@@ -653,16 +680,17 @@ D.py:712:5: D213 [*] Multi-line docstring summary should start at the second lin
714 715 | This is not overindented
715 716 | This is overindented, but since one line is not overindented this should not raise
-D.py:721:5: D213 [*] Multi-line docstring summary should start at the second line
+D213 [*] Multi-line docstring summary should start at the second line
+ --> D.py:721:5
|
720 | def inconsistent_indent_byte_size():
721 | / """There's a non-breaking space (2-bytes) after 3 spaces (https://github.com/astral-sh/ruff/issues/9080).
722 | |
723 | | Returns:
724 | | """
- | |_______^ D213
+ | |_______^
|
- = help: Insert line break and indentation after opening quotes
+help: Insert line break and indentation after opening quotes
ℹ Safe fix
718 718 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_D214_module.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_D214_module.py.snap
index dc344a0cc0..19876f408e 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_D214_module.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_D214_module.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D214_module.py:3:5: D214 [*] Section is over-indented ("Returns")
+D214 [*] Section is over-indented ("Returns")
+ --> D214_module.py:3:5
|
1 | """A module docstring with D214 violations
2 |
3 | Returns
- | ^^^^^^^ D214
+ | ^^^^^^^
4 | -----
5 | valid returns
|
- = help: Remove over-indentation from "Returns"
+help: Remove over-indentation from "Returns"
ℹ Safe fix
1 1 | """A module docstring with D214 violations
@@ -21,16 +22,17 @@ D214_module.py:3:5: D214 [*] Section is over-indented ("Returns")
5 5 | valid returns
6 6 |
-D214_module.py:7:5: D214 [*] Section is over-indented ("Args")
+D214 [*] Section is over-indented ("Args")
+ --> D214_module.py:7:5
|
5 | valid returns
6 |
7 | Args
- | ^^^^ D214
+ | ^^^^
8 | -----
9 | valid args
|
- = help: Remove over-indentation from "Args"
+help: Remove over-indentation from "Args"
ℹ Safe fix
4 4 | -----
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_sections.py.snap
index 371f690de1..d84cea76af 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D214_sections.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:146:9: D214 [*] Section is over-indented ("Returns")
+D214 [*] Section is over-indented ("Returns")
+ --> sections.py:146:9
|
144 | """Toggle the gizmo.
145 |
146 | Returns
- | ^^^^^^^ D214
+ | ^^^^^^^
147 | -------
148 | A value of some sort.
|
- = help: Remove over-indentation from "Returns"
+help: Remove over-indentation from "Returns"
ℹ Safe fix
143 143 | def section_overindented(): # noqa: D416
@@ -22,15 +23,16 @@ sections.py:146:9: D214 [*] Section is over-indented ("Returns")
148 148 | A value of some sort.
149 149 |
-sections.py:563:9: D214 [*] Section is over-indented ("Returns")
+D214 [*] Section is over-indented ("Returns")
+ --> sections.py:563:9
|
561 | Here's a note.
562 |
563 | Returns:
- | ^^^^^^^ D214
+ | ^^^^^^^
564 | """
|
- = help: Remove over-indentation from "Returns"
+help: Remove over-indentation from "Returns"
ℹ Safe fix
560 560 | Args:
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_D215.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_D215.py.snap
index eba14e8fcb..b3d204755b 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_D215.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_D215.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D215.py:3:5: D215 [*] Section underline is over-indented ("TODO")
+D215 [*] Section underline is over-indented ("TODO")
+ --> D215.py:3:5
|
1 | """
2 | TODO:
3 | -
- | ^ D215
+ | ^
4 | """
|
- = help: Remove over-indentation from "TODO" underline
+help: Remove over-indentation from "TODO" underline
ℹ Safe fix
1 1 | """
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_sections.py.snap
index c3c2adcd32..6039da3d4a 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D215_sections.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-sections.py:159:9: D215 [*] Section underline is over-indented ("Returns")
+D215 [*] Section underline is over-indented ("Returns")
+ --> sections.py:159:9
|
158 | Returns
159 | -------
- | ^^^^^^^ D215
+ | ^^^^^^^
160 | A value of some sort.
|
- = help: Remove over-indentation from "Returns" underline
+help: Remove over-indentation from "Returns" underline
ℹ Safe fix
156 156 | """Toggle the gizmo.
@@ -21,14 +21,15 @@ sections.py:159:9: D215 [*] Section underline is over-indented ("Returns")
161 161 |
162 162 | """
-sections.py:173:9: D215 [*] Section underline is over-indented ("Returns")
+D215 [*] Section underline is over-indented ("Returns")
+ --> sections.py:173:9
|
172 | Returns
173 | -------
- | ^^^^^^^ D215
+ | ^^^^^^^
174 | """
|
- = help: Remove over-indentation from "Returns" underline
+help: Remove over-indentation from "Returns" underline
ℹ Safe fix
170 170 | """Toggle the gizmo.
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap
index 23ef163550..f2ecfcbc5e 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:307:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:307:5
|
305 | @expect('D300: Use """triple double quotes""" (found \'\'\'-quotes)')
306 | def triple_single_quotes_raw():
307 | r'''Summary.'''
- | ^^^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
304 304 |
@@ -20,14 +21,15 @@ D.py:307:5: D300 [*] Use triple double quotes `"""`
309 309 |
310 310 | @expect('D300: Use """triple double quotes""" (found \'\'\'-quotes)')
-D.py:312:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:312:5
|
310 | @expect('D300: Use """triple double quotes""" (found \'\'\'-quotes)')
311 | def triple_single_quotes_raw_uppercase():
312 | R'''Summary.'''
- | ^^^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
309 309 |
@@ -39,14 +41,15 @@ D.py:312:5: D300 [*] Use triple double quotes `"""`
314 314 |
315 315 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
-D.py:317:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:317:5
|
315 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
316 | def single_quotes_raw():
317 | r'Summary.'
- | ^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
314 314 |
@@ -58,14 +61,15 @@ D.py:317:5: D300 [*] Use triple double quotes `"""`
319 319 |
320 320 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
-D.py:322:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:322:5
|
320 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
321 | def single_quotes_raw_uppercase():
322 | R'Summary.'
- | ^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
319 319 |
@@ -77,14 +81,15 @@ D.py:322:5: D300 [*] Use triple double quotes `"""`
324 324 |
325 325 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
-D.py:328:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:328:5
|
326 | @expect('D301: Use r""" if any backslashes in a docstring')
327 | def single_quotes_raw_uppercase_backslash():
328 | R'Sum\mary.'
- | ^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
325 325 | @expect('D300: Use """triple double quotes""" (found \'-quotes)')
@@ -96,16 +101,17 @@ D.py:328:5: D300 [*] Use triple double quotes `"""`
330 330 |
331 331 | @expect('D301: Use r""" if any backslashes in a docstring')
-D.py:645:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:645:5
|
644 | def single_line_docstring_with_an_escaped_backslash():
645 | / "\
646 | | "
- | |_____^ D300
+ | |_____^
647 |
648 | class StatementOnSameLineAsDocstring:
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
642 642 |
@@ -119,15 +125,16 @@ D.py:645:5: D300 [*] Use triple double quotes `"""`
648 648 | class StatementOnSameLineAsDocstring:
649 649 | "After this docstring there's another statement on the same line separated by a semicolon." ; priorities=1
-D.py:649:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:649:5
|
648 | class StatementOnSameLineAsDocstring:
649 | "After this docstring there's another statement on the same line separated by a semicolon." ; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
650 | def sort_services(self):
651 | pass
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
646 646 | "
@@ -139,13 +146,14 @@ D.py:649:5: D300 [*] Use triple double quotes `"""`
651 651 | pass
652 652 |
-D.py:654:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:654:5
|
653 | class StatementOnSameLineAsDocstring:
654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
651 651 | pass
@@ -157,15 +165,16 @@ D.py:654:5: D300 [*] Use triple double quotes `"""`
656 656 |
657 657 | class CommentAfterDocstring:
-D.py:658:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:658:5
|
657 | class CommentAfterDocstring:
658 | "After this docstring there's a comment." # priorities=1
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
659 | def sort_services(self):
660 | pass
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
655 655 |
@@ -177,14 +186,15 @@ D.py:658:5: D300 [*] Use triple double quotes `"""`
660 660 | pass
661 661 |
-D.py:664:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D.py:664:5
|
663 | def newline_after_closing_quote(self):
664 | / "We enforce a newline after the closing quote for a multi-line docstring \
665 | | but continuations shouldn't be considered multi-line"
- | |_________________________________________________________^ D300
+ | |_________________________________________________________^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
661 661 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap
index 81fcb9d3f3..8aa4ccb908 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap
@@ -1,22 +1,23 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D300.py:6:5: D300 Use triple double quotes `"""`
+D300 Use triple double quotes `"""`
+ --> D300.py:6:5
|
5 | def ends_in_quote():
6 | 'Sum\\mary."'
- | ^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
-D300.py:10:5: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> D300.py:10:5
|
9 | def contains_quote():
10 | 'Sum"\\mary.'
- | ^^^^^^^^^^^^^ D300
+ | ^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
7 7 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap
index 9da29e5fbc..72289dc8b2 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:333:5: D301 [*] Use `r"""` if any backslashes in a docstring
+D301 [*] Use `r"""` if any backslashes in a docstring
+ --> D.py:333:5
|
331 | @expect('D301: Use r""" if any backslashes in a docstring')
332 | def double_quotes_backslash():
333 | """Sum\\mary."""
- | ^^^^^^^^^^^^^^^^ D301
+ | ^^^^^^^^^^^^^^^^
|
- = help: Add `r` prefix
+help: Add `r` prefix
ℹ Unsafe fix
330 330 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap
index ffd336a556..984047111e 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D301.py:2:5: D301 [*] Use `r"""` if any backslashes in a docstring
+D301 [*] Use `r"""` if any backslashes in a docstring
+ --> D301.py:2:5
|
1 | def double_quotes_backslash():
2 | """Sum\\mary."""
- | ^^^^^^^^^^^^^^^^ D301
+ | ^^^^^^^^^^^^^^^^
|
- = help: Add `r` prefix
+help: Add `r` prefix
ℹ Unsafe fix
1 1 | def double_quotes_backslash():
@@ -17,23 +18,25 @@ D301.py:2:5: D301 [*] Use `r"""` if any backslashes in a docstring
4 4 |
5 5 | def double_quotes_backslash_raw():
-D301.py:37:5: D301 Use `r"""` if any backslashes in a docstring
+D301 Use `r"""` if any backslashes in a docstring
+ --> D301.py:37:5
|
36 | def shouldnt_add_raw_here2():
37 | u"Sum\\mary."
- | ^^^^^^^^^^^^^ D301
+ | ^^^^^^^^^^^^^
|
- = help: Add `r` prefix
+help: Add `r` prefix
-D301.py:93:5: D301 [*] Use `r"""` if any backslashes in a docstring
+D301 [*] Use `r"""` if any backslashes in a docstring
+ --> D301.py:93:5
|
92 | def should_add_raw_for_single_double_quote_escape():
93 | / """
94 | | This is single quote escape \".
95 | | """
- | |_______^ D301
+ | |_______^
|
- = help: Add `r` prefix
+help: Add `r` prefix
ℹ Unsafe fix
90 90 |
@@ -45,15 +48,16 @@ D301.py:93:5: D301 [*] Use `r"""` if any backslashes in a docstring
95 95 | """
96 96 |
-D301.py:99:5: D301 [*] Use `r"""` if any backslashes in a docstring
+D301 [*] Use `r"""` if any backslashes in a docstring
+ --> D301.py:99:5
|
98 | def should_add_raw_for_single_single_quote_escape():
99 | / '''
100 | | This is single quote escape \'.
101 | | '''
- | |_______^ D301
+ | |_______^
|
- = help: Add `r` prefix
+help: Add `r` prefix
ℹ Unsafe fix
96 96 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap
index f61fcc94b9..4c97147f52 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:355:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:355:5
|
353 | "or exclamation point (not 'y')")
354 | def lwnlkjl():
355 | """Summary"""
- | ^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
352 352 | @expect("D415: First line should end with a period, question mark, "
@@ -20,14 +21,15 @@ D.py:355:5: D400 [*] First line should end with a period
357 357 |
358 358 | @expect("D401: First line should be in imperative mood "
-D.py:406:25: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:406:25
|
404 | @expect("D415: First line should end with a period, question mark,"
405 | " or exclamation point (not 'r')")
406 | def oneliner_withdoc(): """One liner"""
- | ^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
403 403 | @expect("D400: First line should end with a period (not 'r')")
@@ -39,15 +41,16 @@ D.py:406:25: D400 [*] First line should end with a period
408 408 |
409 409 | def ignored_decorator(func): # noqa: D400,D401,D415
-D.py:410:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:410:5
|
409 | def ignored_decorator(func): # noqa: D400,D401,D415
410 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
411 | func()
412 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
407 407 |
@@ -59,15 +62,16 @@ D.py:410:5: D400 [*] First line should end with a period
412 412 | pass
413 413 |
-D.py:416:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:416:5
|
415 | def decorator_for_test(func): # noqa: D400,D401,D415
416 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
417 | func()
418 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
413 413 |
@@ -79,13 +83,14 @@ D.py:416:5: D400 [*] First line should end with a period
418 418 | pass
419 419 |
-D.py:422:35: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:422:35
|
421 | @ignored_decorator
422 | def oneliner_ignored_decorator(): """One liner"""
- | ^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
419 419 |
@@ -97,14 +102,15 @@ D.py:422:35: D400 [*] First line should end with a period
424 424 |
425 425 | @decorator_for_test
-D.py:429:49: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:429:49
|
427 | @expect("D415: First line should end with a period, question mark,"
428 | " or exclamation point (not 'r')")
429 | def oneliner_with_decorator_expecting_errors(): """One liner"""
- | ^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
426 426 | @expect("D400: First line should end with a period (not 'r')")
@@ -116,15 +122,16 @@ D.py:429:49: D400 [*] First line should end with a period
431 431 |
432 432 | @decorator_for_test
-D.py:470:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:470:5
|
468 | "or exclamation point (not 'g')")
469 | def docstring_bad():
470 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
471 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
467 467 | @expect("D415: First line should end with a period, question mark, "
@@ -136,14 +143,15 @@ D.py:470:5: D400 [*] First line should end with a period
472 472 |
473 473 |
-D.py:475:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:475:5
|
474 | def docstring_bad_ignore_all(): # noqa
475 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
476 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
472 472 |
@@ -155,14 +163,15 @@ D.py:475:5: D400 [*] First line should end with a period
477 477 |
478 478 |
-D.py:480:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:480:5
|
479 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415
480 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
481 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
477 477 |
@@ -174,15 +183,16 @@ D.py:480:5: D400 [*] First line should end with a period
482 482 |
483 483 |
-D.py:487:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:487:5
|
485 | "(perhaps 'Run', not 'Runs')")
486 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415
487 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^
488 | pass
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
484 484 | @expect("D401: First line should be in imperative mood "
@@ -194,22 +204,24 @@ D.py:487:5: D400 [*] First line should end with a period
489 489 |
490 490 |
-D.py:514:5: D400 First line should end with a period
+D400 First line should end with a period
+ --> D.py:514:5
|
513 | def valid_google_string(): # noqa: D400
514 | """Test a valid something!"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
-D.py:520:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:520:5
|
518 | "or exclamation point (not 'g')")
519 | def bad_google_string(): # noqa: D400
520 | """Test a valid something"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
517 517 | @expect("D415: First line should end with a period, question mark, "
@@ -221,14 +233,15 @@ D.py:520:5: D400 [*] First line should end with a period
522 522 |
523 523 | # This is reproducing a bug where AttributeError is raised when parsing class
-D.py:581:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:581:5
|
579 | "or exclamation point (not '\"')")
580 | def endswith_quote():
581 | """Whitespace at the end, but also a quote" """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
578 578 | @expect("D415: First line should end with a period, question mark, "
@@ -240,16 +253,17 @@ D.py:581:5: D400 [*] First line should end with a period
583 583 |
584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate '
-D.py:615:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:615:5
|
613 | @expect('D212: Multi-line docstring summary should start at the first line')
614 | def one_liner():
615 | / """Wrong."
616 | |
617 | | """
- | |_______^ D400
+ | |_______^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
612 612 | '(found 3)')
@@ -261,14 +275,15 @@ D.py:615:5: D400 [*] First line should end with a period
617 617 | """
618 618 |
-D.py:639:17: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:639:17
|
639 | class SameLine: """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
640 |
641 | def same_line(): """This is a docstring on the same line"""
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
636 636 | """ This is a docstring that starts with a space.""" # noqa: D210
@@ -280,14 +295,15 @@ D.py:639:17: D400 [*] First line should end with a period
641 641 | def same_line(): """This is a docstring on the same line"""
642 642 |
-D.py:641:18: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:641:18
|
639 | class SameLine: """This is a docstring on the same line"""
640 |
641 | def same_line(): """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
638 638 |
@@ -299,14 +315,15 @@ D.py:641:18: D400 [*] First line should end with a period
643 643 |
644 644 | def single_line_docstring_with_an_escaped_backslash():
-D.py:664:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D.py:664:5
|
663 | def newline_after_closing_quote(self):
664 | / "We enforce a newline after the closing quote for a multi-line docstring \
665 | | but continuations shouldn't be considered multi-line"
- | |_________________________________________________________^ D400
+ | |_________________________________________________________^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
662 662 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap
index 752bf81900..096ffb22e5 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D400.py:2:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:2:5
|
1 | def f():
2 | "Here's a line without a period"
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
1 1 | def f():
@@ -18,14 +19,15 @@ D400.py:2:5: D400 [*] First line should end with a period
4 4 |
5 5 |
-D400.py:7:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:7:5
|
6 | def f():
7 | """Here's a line without a period"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
4 4 |
@@ -37,17 +39,18 @@ D400.py:7:5: D400 [*] First line should end with a period
9 9 |
10 10 |
-D400.py:12:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:12:5
|
11 | def f():
12 | / """
13 | | Here's a line without a period,
14 | | but here's the next line
15 | | """
- | |_______^ D400
+ | |_______^
16 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
11 11 | def f():
@@ -59,14 +62,15 @@ D400.py:12:5: D400 [*] First line should end with a period
16 16 | ...
17 17 |
-D400.py:20:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:20:5
|
19 | def f():
20 | """Here's a line without a period"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
17 17 |
@@ -78,16 +82,17 @@ D400.py:20:5: D400 [*] First line should end with a period
22 22 |
23 23 |
-D400.py:25:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:25:5
|
24 | def f():
25 | / """
26 | | Here's a line without a period,
27 | | but here's the next line"""
- | |_______________________________^ D400
+ | |_______________________________^
28 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
24 24 | def f():
@@ -99,16 +104,17 @@ D400.py:25:5: D400 [*] First line should end with a period
29 29 |
30 30 |
-D400.py:32:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:32:5
|
31 | def f():
32 | / """
33 | | Here's a line without a period,
34 | | but here's the next line with trailing space """
- | |____________________________________________________^ D400
+ | |____________________________________________________^
35 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
31 31 | def f():
@@ -120,14 +126,15 @@ D400.py:32:5: D400 [*] First line should end with a period
36 36 |
37 37 |
-D400.py:39:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:39:5
|
38 | def f():
39 | r"Here's a line without a period"
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
36 36 |
@@ -139,14 +146,15 @@ D400.py:39:5: D400 [*] First line should end with a period
41 41 |
42 42 |
-D400.py:44:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:44:5
|
43 | def f():
44 | r"""Here's a line without a period"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
41 41 |
@@ -158,17 +166,18 @@ D400.py:44:5: D400 [*] First line should end with a period
46 46 |
47 47 |
-D400.py:49:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:49:5
|
48 | def f():
49 | / r"""
50 | | Here's a line without a period,
51 | | but here's the next line
52 | | """
- | |_______^ D400
+ | |_______^
53 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
48 48 | def f():
@@ -180,14 +189,15 @@ D400.py:49:5: D400 [*] First line should end with a period
53 53 | ...
54 54 |
-D400.py:57:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:57:5
|
56 | def f():
57 | r"""Here's a line without a period"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
54 54 |
@@ -199,16 +209,17 @@ D400.py:57:5: D400 [*] First line should end with a period
59 59 |
60 60 |
-D400.py:62:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:62:5
|
61 | def f():
62 | / r"""
63 | | Here's a line without a period,
64 | | but here's the next line"""
- | |_______________________________^ D400
+ | |_______________________________^
65 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
61 61 | def f():
@@ -220,16 +231,17 @@ D400.py:62:5: D400 [*] First line should end with a period
66 66 |
67 67 |
-D400.py:69:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:69:5
|
68 | def f():
69 | / r"""
70 | | Here's a line without a period,
71 | | but here's the next line with trailing space """
- | |____________________________________________________^ D400
+ | |____________________________________________________^
72 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
68 68 | def f():
@@ -241,7 +253,8 @@ D400.py:69:5: D400 [*] First line should end with a period
73 73 |
74 74 |
-D400.py:97:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400.py:97:5
|
96 | def f():
97 | / """
@@ -250,9 +263,9 @@ D400.py:97:5: D400 [*] First line should end with a period
100 | |
101 | | My example explanation
102 | | """
- | |_______^ D400
+ | |_______^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
95 95 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400_415.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400_415.py.snap
index de2d6b0996..5f64adf444 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400_415.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400_415.py.snap
@@ -1,51 +1,55 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D400_415.py:2:5: D400 First line should end with a period
+D400 First line should end with a period
+ --> D400_415.py:2:5
|
1 | def f():
2 | "Here's a line ending in a question mark?"
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | ...
|
- = help: Add period
+help: Add period
-D400_415.py:7:5: D400 First line should end with a period
+D400 First line should end with a period
+ --> D400_415.py:7:5
|
6 | def f():
7 | """Here's a line ending in an exclamation mark!"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | ...
|
- = help: Add period
+help: Add period
-D400_415.py:11:5: D400 First line should end with a period
+D400 First line should end with a period
+ --> D400_415.py:11:5
|
10 | def f():
11 | """Here's a line ending in a colon:"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | ...
|
- = help: Add period
+help: Add period
-D400_415.py:15:5: D400 First line should end with a period
+D400 First line should end with a period
+ --> D400_415.py:15:5
|
14 | def f():
15 | """Here's a line ending in a semi colon;"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 | ...
|
- = help: Add period
+help: Add period
-D400_415.py:19:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D400_415.py:19:5
|
18 | def f():
19 | """Here's a line ending with a whitespace """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 | ...
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
16 16 | ...
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap
index d649ee60dc..55f509319c 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap
@@ -1,21 +1,24 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D401.py:10:5: D401 First line of docstring should be in imperative mood: "Returns foo."
+D401 First line of docstring should be in imperative mood: "Returns foo."
+ --> D401.py:10:5
|
9 | def bad_liouiwnlkjl():
10 | """Returns foo."""
- | ^^^^^^^^^^^^^^^^^^ D401
+ | ^^^^^^^^^^^^^^^^^^
|
-D401.py:14:5: D401 First line of docstring should be in imperative mood: "Constructor for a foo."
+D401 First line of docstring should be in imperative mood: "Constructor for a foo."
+ --> D401.py:14:5
|
13 | def bad_sdgfsdg23245():
14 | """Constructor for a foo."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D401
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-D401.py:18:5: D401 First line of docstring should be in imperative mood: "Constructor for a boa."
+D401 First line of docstring should be in imperative mood: "Constructor for a boa."
+ --> D401.py:18:5
|
17 | def bad_sdgfsdg23245777():
18 | / """
@@ -23,41 +26,45 @@ D401.py:18:5: D401 First line of docstring should be in imperative mood: "Constr
20 | | Constructor for a boa.
21 | |
22 | | """
- | |_______^ D401
+ | |_______^
|
-D401.py:26:5: D401 First line of docstring should be in imperative mood: "Runs something"
+D401 First line of docstring should be in imperative mood: "Runs something"
+ --> D401.py:26:5
|
25 | def bad_run_something():
26 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D401
+ | ^^^^^^^^^^^^^^^^^^^^
27 |
28 | def bad_nested():
|
-D401.py:29:9: D401 First line of docstring should be in imperative mood: "Runs other things, nested"
+D401 First line of docstring should be in imperative mood: "Runs other things, nested"
+ --> D401.py:29:9
|
28 | def bad_nested():
29 | """Runs other things, nested"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D401
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 |
31 | bad_nested()
|
-D401.py:35:5: D401 First line of docstring should be in imperative mood: "Writes a logical line that"
+D401 First line of docstring should be in imperative mood: "Writes a logical line that"
+ --> D401.py:35:5
|
34 | def multi_line():
35 | / """Writes a logical line that
36 | | extends to two physical lines.
37 | | """
- | |_______^ D401
+ | |_______^
|
-D401.py:74:9: D401 First line of docstring should be in imperative mood: "This method docstring should be written in imperative mood."
+D401 First line of docstring should be in imperative mood: "This method docstring should be written in imperative mood."
+ --> D401.py:74:9
|
73 | def bad_method(self):
74 | """This method docstring should be written in imperative mood."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D401
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 |
76 | @property
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap
index be6c3676b7..0f51d90a4f 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:378:5: D402 First line should not be the function's signature
+D402 First line should not be the function's signature
+ --> D.py:378:5
|
376 | @expect('D402: First line should not be the function\'s "signature"')
377 | def foobar():
378 | """Signature: foobar()."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D402
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap
index 1c23d91dc9..f6048d4fb5 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap
@@ -1,18 +1,20 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D402.py:2:5: D402 First line should not be the function's signature
+D402 First line should not be the function's signature
+ --> D402.py:2:5
|
1 | def foo():
2 | """Returns foo()."""
- | ^^^^^^^^^^^^^^^^^^^^ D402
+ | ^^^^^^^^^^^^^^^^^^^^
3 |
4 | def foo():
|
-D402.py:8:5: D402 First line should not be the function's signature
+D402 First line should not be the function's signature
+ --> D402.py:8:5
|
7 | def foo():
8 | """"Use this function; foo()."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D402
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap
index 201b1f68a5..a2f48de1d4 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D403.py:2:5: D403 [*] First word of the docstring should be capitalized: `this` -> `This`
+D403 [*] First word of the docstring should be capitalized: `this` -> `This`
+ --> D403.py:2:5
|
1 | def bad_function():
2 | """this docstring is not capitalized"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D403
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 |
4 | def good_function():
|
- = help: Capitalize `this` to `This`
+help: Capitalize `this` to `This`
ℹ Safe fix
1 1 | def bad_function():
@@ -19,15 +20,16 @@ D403.py:2:5: D403 [*] First word of the docstring should be capitalized: `this`
4 4 | def good_function():
5 5 | """This docstring is capitalized."""
-D403.py:30:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:30:5
|
29 | def single_word():
30 | """singleword."""
- | ^^^^^^^^^^^^^^^^^ D403
+ | ^^^^^^^^^^^^^^^^^
31 |
32 | def single_word_no_dot():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
27 27 | """th•s is not capitalized."""
@@ -39,15 +41,16 @@ D403.py:30:5: D403 [*] First word of the docstring should be capitalized: `singl
32 32 | def single_word_no_dot():
33 33 | """singleword"""
-D403.py:33:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:33:5
|
32 | def single_word_no_dot():
33 | """singleword"""
- | ^^^^^^^^^^^^^^^^ D403
+ | ^^^^^^^^^^^^^^^^
34 |
35 | def first_word_lots_of_whitespace():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
30 30 | """singleword."""
@@ -59,7 +62,8 @@ D403.py:33:5: D403 [*] First word of the docstring should be capitalized: `singl
35 35 | def first_word_lots_of_whitespace():
36 36 | """
-D403.py:36:5: D403 [*] First word of the docstring should be capitalized: `here` -> `Here`
+D403 [*] First word of the docstring should be capitalized: `here` -> `Here`
+ --> D403.py:36:5
|
35 | def first_word_lots_of_whitespace():
36 | / """
@@ -70,11 +74,11 @@ D403.py:36:5: D403 [*] First word of the docstring should be capitalized: `here`
41 | |
42 | | What do you think?
43 | | """
- | |_______^ D403
+ | |_______^
44 |
45 | def single_word_newline():
|
- = help: Capitalize `here` to `Here`
+help: Capitalize `here` to `Here`
ℹ Safe fix
37 37 |
@@ -86,17 +90,18 @@ D403.py:36:5: D403 [*] First word of the docstring should be capitalized: `here`
42 42 | What do you think?
43 43 | """
-D403.py:46:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:46:5
|
45 | def single_word_newline():
46 | / """singleword
47 | |
48 | | """
- | |_______^ D403
+ | |_______^
49 |
50 | def single_word_dot_newline():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
43 43 | """
@@ -108,17 +113,18 @@ D403.py:46:5: D403 [*] First word of the docstring should be capitalized: `singl
48 48 | """
49 49 |
-D403.py:51:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:51:5
|
50 | def single_word_dot_newline():
51 | / """singleword.
52 | |
53 | | """
- | |_______^ D403
+ | |_______^
54 |
55 | def single_word_second_line():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
48 48 | """
@@ -130,17 +136,18 @@ D403.py:51:5: D403 [*] First word of the docstring should be capitalized: `singl
53 53 | """
54 54 |
-D403.py:56:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:56:5
|
55 | def single_word_second_line():
56 | / """
57 | | singleword
58 | | """
- | |_______^ D403
+ | |_______^
59 |
60 | def single_word_dot_second_line():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
54 54 |
@@ -152,17 +159,18 @@ D403.py:56:5: D403 [*] First word of the docstring should be capitalized: `singl
59 59 |
60 60 | def single_word_dot_second_line():
-D403.py:61:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:61:5
|
60 | def single_word_dot_second_line():
61 | / """
62 | | singleword.
63 | | """
- | |_______^ D403
+ | |_______^
64 |
65 | def single_word_then_more_text():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
59 59 |
@@ -174,18 +182,19 @@ D403.py:61:5: D403 [*] First word of the docstring should be capitalized: `singl
64 64 |
65 65 | def single_word_then_more_text():
-D403.py:66:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:66:5
|
65 | def single_word_then_more_text():
66 | / """singleword
67 | |
68 | | This is more text.
69 | | """
- | |_______^ D403
+ | |_______^
70 |
71 | def single_word_dot_then_more_text():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
63 63 | """
@@ -197,18 +206,19 @@ D403.py:66:5: D403 [*] First word of the docstring should be capitalized: `singl
68 68 | This is more text.
69 69 | """
-D403.py:72:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:72:5
|
71 | def single_word_dot_then_more_text():
72 | / """singleword.
73 | |
74 | | This is more text.
75 | | """
- | |_______^ D403
+ | |_______^
76 |
77 | def single_word_second_line_then_more_text():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
69 69 | """
@@ -220,7 +230,8 @@ D403.py:72:5: D403 [*] First word of the docstring should be capitalized: `singl
74 74 | This is more text.
75 75 | """
-D403.py:78:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:78:5
|
77 | def single_word_second_line_then_more_text():
78 | / """
@@ -228,11 +239,11 @@ D403.py:78:5: D403 [*] First word of the docstring should be capitalized: `singl
80 | |
81 | | This is more text.
82 | | """
- | |_______^ D403
+ | |_______^
83 |
84 | def single_word_dot_second_line_then_more_text():
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
76 76 |
@@ -244,7 +255,8 @@ D403.py:78:5: D403 [*] First word of the docstring should be capitalized: `singl
81 81 | This is more text.
82 82 | """
-D403.py:85:5: D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+D403 [*] First word of the docstring should be capitalized: `singleword` -> `Singleword`
+ --> D403.py:85:5
|
84 | def single_word_dot_second_line_then_more_text():
85 | / """
@@ -252,9 +264,9 @@ D403.py:85:5: D403 [*] First word of the docstring should be capitalized: `singl
87 | |
88 | | This is more text.
89 | | """
- | |_______^ D403
+ | |_______^
|
- = help: Capitalize `singleword` to `Singleword`
+help: Capitalize `singleword` to `Singleword`
ℹ Safe fix
83 83 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap
index dec763cf08..d9f57c68d3 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap
@@ -1,34 +1,38 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:631:5: D404 First word of the docstring should not be "This"
+D404 First word of the docstring should not be "This"
+ --> D.py:631:5
|
629 | @expect('D404: First word of the docstring should not be "This"')
630 | def starts_with_this():
631 | """This is a docstring."""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-D.py:636:5: D404 First word of the docstring should not be "This"
+D404 First word of the docstring should not be "This"
+ --> D.py:636:5
|
634 | @expect('D404: First word of the docstring should not be "This"')
635 | def starts_with_space_then_this():
636 | """ This is a docstring that starts with a space.""" # noqa: D210
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-D.py:639:17: D404 First word of the docstring should not be "This"
+D404 First word of the docstring should not be "This"
+ --> D.py:639:17
|
639 | class SameLine: """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
640 |
641 | def same_line(): """This is a docstring on the same line"""
|
-D.py:641:18: D404 First word of the docstring should not be "This"
+D404 First word of the docstring should not be "This"
+ --> D.py:641:18
|
639 | class SameLine: """This is a docstring on the same line"""
640 |
641 | def same_line(): """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D405_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D405_sections.py.snap
index 840beb1830..7a3cecaa19 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D405_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D405_sections.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:19:5: D405 [*] Section name should be properly capitalized ("returns")
+D405 [*] Section name should be properly capitalized ("returns")
+ --> sections.py:19:5
|
17 | """Toggle the gizmo.
18 |
19 | returns
- | ^^^^^^^ D405
+ | ^^^^^^^
20 | -------
21 | A value of some sort.
|
- = help: Capitalize "returns"
+help: Capitalize "returns"
ℹ Safe fix
16 16 | def not_capitalized(): # noqa: D416
@@ -22,15 +23,16 @@ sections.py:19:5: D405 [*] Section name should be properly capitalized ("returns
21 21 | A value of some sort.
22 22 |
-sections.py:218:5: D405 [*] Section name should be properly capitalized ("Short summary")
+D405 [*] Section name should be properly capitalized ("Short summary")
+ --> sections.py:218:5
|
216 | """Toggle the gizmo.
217 |
218 | Short summary
- | ^^^^^^^^^^^^^ D405
+ | ^^^^^^^^^^^^^
219 | -------------
|
- = help: Capitalize "Short summary"
+help: Capitalize "Short summary"
ℹ Safe fix
215 215 | def multiple_sections(): # noqa: D416
@@ -42,16 +44,17 @@ sections.py:218:5: D405 [*] Section name should be properly capitalized ("Short
220 220 |
221 221 | This is the function's description, which will also specify what it
-sections.py:573:5: D405 [*] Section name should be properly capitalized ("returns")
+D405 [*] Section name should be properly capitalized ("returns")
+ --> sections.py:573:5
|
571 | arg: Here's a note.
572 |
573 | returns:
- | ^^^^^^^ D405
+ | ^^^^^^^
574 | Here's another note.
575 | """
|
- = help: Capitalize "returns"
+help: Capitalize "returns"
ℹ Safe fix
570 570 | Args:
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D406_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D406_sections.py.snap
index d5914e8da6..d2f758e3a5 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D406_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D406_sections.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:32:5: D406 [*] Section name should end with a newline ("Returns")
+D406 [*] Section name should end with a newline ("Returns")
+ --> sections.py:32:5
|
30 | """Toggle the gizmo.
31 |
32 | Returns:
- | ^^^^^^^ D406
+ | ^^^^^^^
33 | -------
34 | A value of some sort.
|
- = help: Add newline after "Returns"
+help: Add newline after "Returns"
ℹ Safe fix
29 29 | def superfluous_suffix(): # noqa: D416
@@ -22,15 +23,16 @@ sections.py:32:5: D406 [*] Section name should end with a newline ("Returns")
34 34 | A value of some sort.
35 35 |
-sections.py:227:5: D406 [*] Section name should end with a newline ("Raises")
+D406 [*] Section name should end with a newline ("Raises")
+ --> sections.py:227:5
|
225 | ------
226 | Many many wonderful things.
227 | Raises:
- | ^^^^^^ D406
+ | ^^^^^^
228 | My attention.
|
- = help: Add newline after "Raises"
+help: Add newline after "Raises"
ℹ Safe fix
224 224 | Returns
@@ -42,16 +44,17 @@ sections.py:227:5: D406 [*] Section name should end with a newline ("Raises")
229 229 |
230 230 | """
-sections.py:601:5: D406 [*] Section name should end with a newline ("Parameters")
+D406 [*] Section name should end with a newline ("Parameters")
+ --> sections.py:601:5
|
599 | """Test that lower case subsection header is valid even if it has the same name as section kind.
600 |
601 | Parameters:
- | ^^^^^^^^^^ D406
+ | ^^^^^^^^^^
602 | ----------
603 | parameters:
|
- = help: Add newline after "Parameters"
+help: Add newline after "Parameters"
ℹ Safe fix
598 598 | def test_lowercase_sub_section_header_should_be_valid(parameters: list[str], value: int): # noqa: D213
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap
index 767809f849..6a46781233 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:44:5: D407 [*] Missing dashed underline after section ("Returns")
+D407 [*] Missing dashed underline after section ("Returns")
+ --> sections.py:44:5
|
42 | """Toggle the gizmo.
43 |
44 | Returns
- | ^^^^^^^ D407
+ | ^^^^^^^
45 | A value of some sort.
|
- = help: Add dashed line under "Returns"
+help: Add dashed line under "Returns"
ℹ Safe fix
42 42 | """Toggle the gizmo.
@@ -20,16 +21,17 @@ sections.py:44:5: D407 [*] Missing dashed underline after section ("Returns")
46 47 |
47 48 | """
-sections.py:56:5: D407 [*] Missing dashed underline after section ("Returns")
+D407 [*] Missing dashed underline after section ("Returns")
+ --> sections.py:56:5
|
54 | """Toggle the gizmo.
55 |
56 | Returns
- | ^^^^^^^ D407
+ | ^^^^^^^
57 |
58 | """
|
- = help: Add dashed line under "Returns"
+help: Add dashed line under "Returns"
ℹ Safe fix
54 54 | """Toggle the gizmo.
@@ -40,14 +42,15 @@ sections.py:56:5: D407 [*] Missing dashed underline after section ("Returns")
58 59 | """
59 60 |
-sections.py:67:5: D407 [*] Missing dashed underline after section ("Returns")
+D407 [*] Missing dashed underline after section ("Returns")
+ --> sections.py:67:5
|
65 | """Toggle the gizmo.
66 |
67 | Returns"""
- | ^^^^^^^ D407
+ | ^^^^^^^
|
- = help: Add dashed line under "Returns"
+help: Add dashed line under "Returns"
ℹ Safe fix
64 64 | def no_underline_and_no_newline(): # noqa: D416
@@ -60,15 +63,16 @@ sections.py:67:5: D407 [*] Missing dashed underline after section ("Returns")
69 70 |
70 71 | @expect(_D213)
-sections.py:227:5: D407 [*] Missing dashed underline after section ("Raises")
+D407 [*] Missing dashed underline after section ("Raises")
+ --> sections.py:227:5
|
225 | ------
226 | Many many wonderful things.
227 | Raises:
- | ^^^^^^ D407
+ | ^^^^^^
228 | My attention.
|
- = help: Add dashed line under "Raises"
+help: Add dashed line under "Raises"
ℹ Safe fix
225 225 | ------
@@ -79,14 +83,15 @@ sections.py:227:5: D407 [*] Missing dashed underline after section ("Raises")
229 230 |
230 231 | """
-sections.py:522:5: D407 [*] Missing dashed underline after section ("Parameters")
+D407 [*] Missing dashed underline after section ("Parameters")
+ --> sections.py:522:5
|
521 | Parameters
522 | ==========
- | ^^^^^^^^^^ D407
+ | ^^^^^^^^^^
523 | """
|
- = help: Add dashed line under "Parameters"
+help: Add dashed line under "Parameters"
ℹ Safe fix
519 519 | """Equal length equals should be replaced with dashes.
@@ -98,14 +103,15 @@ sections.py:522:5: D407 [*] Missing dashed underline after section ("Parameters"
524 524 |
525 525 |
-sections.py:530:5: D407 [*] Missing dashed underline after section ("Parameters")
+D407 [*] Missing dashed underline after section ("Parameters")
+ --> sections.py:530:5
|
529 | Parameters
530 | ===========
- | ^^^^^^^^^^^ D407
+ | ^^^^^^^^^^^
531 | """
|
- = help: Add dashed line under "Parameters"
+help: Add dashed line under "Parameters"
ℹ Safe fix
527 527 | """Here, the length of equals is not the same.
@@ -117,16 +123,17 @@ sections.py:530:5: D407 [*] Missing dashed underline after section ("Parameters"
532 532 |
533 533 |
-sections.py:613:4: D407 [*] Missing dashed underline after section ("Parameters")
+D407 [*] Missing dashed underline after section ("Parameters")
+ --> sections.py:613:4
|
611 | """Test that lower case subsection header is valid even if it is of a different kind.
612 |
613 | Parameters
- | ^^^^^^^^^^ D407
+ | ^^^^^^^^^^
614 | -‐-----------------
615 | returns:
|
- = help: Add dashed line under "Parameters"
+help: Add dashed line under "Parameters"
ℹ Safe fix
611 611 | """Test that lower case subsection header is valid even if it is of a different kind.
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D408_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D408_sections.py.snap
index 2bb4847569..4ebd79bda4 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D408_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D408_sections.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:98:5: D408 [*] Section underline should be in the line following the section's name ("Returns")
+D408 [*] Section underline should be in the line following the section's name ("Returns")
+ --> sections.py:98:5
|
96 | Returns
97 |
98 | -------
- | ^^^^^^^ D408
+ | ^^^^^^^
99 | A value of some sort.
|
- = help: Add underline to "Returns"
+help: Add underline to "Returns"
ℹ Safe fix
94 94 | """Toggle the gizmo.
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D409_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D409_sections.py.snap
index a456360e57..a87eb5ac32 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D409_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D409_sections.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:111:5: D409 [*] Section underline should match the length of its name ("Returns")
+D409 [*] Section underline should match the length of its name ("Returns")
+ --> sections.py:111:5
|
110 | Returns
111 | --
- | ^^ D409
+ | ^^
112 | A value of some sort.
|
- = help: Adjust underline length to match "Returns"
+help: Adjust underline length to match "Returns"
ℹ Safe fix
108 108 | """Toggle the gizmo.
@@ -20,15 +21,16 @@ sections.py:111:5: D409 [*] Section underline should match the length of its nam
113 113 |
114 114 | """
-sections.py:225:5: D409 [*] Section underline should match the length of its name ("Returns")
+D409 [*] Section underline should match the length of its name ("Returns")
+ --> sections.py:225:5
|
224 | Returns
225 | ------
- | ^^^^^^ D409
+ | ^^^^^^
226 | Many many wonderful things.
227 | Raises:
|
- = help: Adjust underline length to match "Returns"
+help: Adjust underline length to match "Returns"
ℹ Safe fix
222 222 | returns.
@@ -40,15 +42,16 @@ sections.py:225:5: D409 [*] Section underline should match the length of its nam
227 227 | Raises:
228 228 | My attention.
-sections.py:589:5: D409 [*] Section underline should match the length of its name ("Other Parameters")
+D409 [*] Section underline should match the length of its name ("Other Parameters")
+ --> sections.py:589:5
|
588 | Other Parameters
589 | ----------
- | ^^^^^^^^^^ D409
+ | ^^^^^^^^^^
590 | other_parameters:
591 | A dictionary of string attributes
|
- = help: Adjust underline length to match "Other Parameters"
+help: Adjust underline length to match "Other Parameters"
ℹ Safe fix
586 586 | A dictionary of string attributes
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_D410.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_D410.py.snap
index f95ac4dd1f..d4cba2ca9f 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_D410.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_D410.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D410.py:4:5: D410 [*] Missing blank line after section ("Parameters")
+D410 [*] Missing blank line after section ("Parameters")
+ --> D410.py:4:5
|
2 | """Showcase function.
3 |
4 | Parameters
- | ^^^^^^^^^^ D410
+ | ^^^^^^^^^^
5 | ----------
6 | a : int
|
- = help: Add blank line after "Parameters"
+help: Add blank line after "Parameters"
ℹ Safe fix
7 7 | _description_
@@ -21,16 +22,17 @@ D410.py:4:5: D410 [*] Missing blank line after section ("Parameters")
11 12 | -------
12 13 | int
-D410.py:21:5: D410 [*] Missing blank line after section ("Parameters")
+D410 [*] Missing blank line after section ("Parameters")
+ --> D410.py:21:5
|
19 | """Showcase function.
20 |
21 | Parameters
- | ^^^^^^^^^^ D410
+ | ^^^^^^^^^^
22 | ----------
23 | Returns
|
- = help: Add blank line after "Parameters"
+help: Add blank line after "Parameters"
ℹ Safe fix
20 20 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_sections.py.snap
index 389391bb46..efd8950322 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D410_sections.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:78:5: D410 [*] Missing blank line after section ("Returns")
+D410 [*] Missing blank line after section ("Returns")
+ --> sections.py:78:5
|
76 | """Toggle the gizmo.
77 |
78 | Returns
- | ^^^^^^^ D410
+ | ^^^^^^^
79 | -------
80 | Yields
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
77 77 |
@@ -21,16 +22,17 @@ sections.py:78:5: D410 [*] Missing blank line after section ("Returns")
81 82 | ------
82 83 |
-sections.py:224:5: D410 [*] Missing blank line after section ("Returns")
+D410 [*] Missing blank line after section ("Returns")
+ --> sections.py:224:5
|
222 | returns.
223 |
224 | Returns
- | ^^^^^^^ D410
+ | ^^^^^^^
225 | ------
226 | Many many wonderful things.
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
224 224 | Returns
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D411_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D411_sections.py.snap
index c893a2e059..f4b40fa690 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D411_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D411_sections.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-sections.py:80:5: D411 [*] Missing blank line before section ("Yields")
+D411 [*] Missing blank line before section ("Yields")
+ --> sections.py:80:5
|
78 | Returns
79 | -------
80 | Yields
- | ^^^^^^ D411
+ | ^^^^^^
81 | ------
|
- = help: Add blank line before "Yields"
+help: Add blank line before "Yields"
ℹ Safe fix
77 77 |
@@ -21,15 +21,16 @@ sections.py:80:5: D411 [*] Missing blank line before section ("Yields")
81 82 | ------
82 83 |
-sections.py:134:5: D411 [*] Missing blank line before section ("Returns")
+D411 [*] Missing blank line before section ("Returns")
+ --> sections.py:134:5
|
133 | The function's description.
134 | Returns
- | ^^^^^^^ D411
+ | ^^^^^^^
135 | -------
136 | A value of some sort.
|
- = help: Add blank line before "Returns"
+help: Add blank line before "Returns"
ℹ Safe fix
131 131 | """Toggle the gizmo.
@@ -40,15 +41,16 @@ sections.py:134:5: D411 [*] Missing blank line before section ("Returns")
135 136 | -------
136 137 | A value of some sort.
-sections.py:227:5: D411 [*] Missing blank line before section ("Raises")
+D411 [*] Missing blank line before section ("Raises")
+ --> sections.py:227:5
|
225 | ------
226 | Many many wonderful things.
227 | Raises:
- | ^^^^^^ D411
+ | ^^^^^^
228 | My attention.
|
- = help: Add blank line before "Raises"
+help: Add blank line before "Raises"
ℹ Safe fix
224 224 | Returns
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sections.py.snap
index 6616be7a6e..715e1abb87 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sections.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:218:5: D412 [*] No blank lines allowed between a section header and its content ("Short summary")
+D412 [*] No blank lines allowed between a section header and its content ("Short summary")
+ --> sections.py:218:5
|
216 | """Toggle the gizmo.
217 |
218 | Short summary
- | ^^^^^^^^^^^^^ D412
+ | ^^^^^^^^^^^^^
219 | -------------
|
- = help: Remove blank line(s)
+help: Remove blank line(s)
ℹ Safe fix
217 217 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap
index 5abbab23db..98b536302c 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-sphinx.py:13:5: D412 [*] No blank lines allowed between a section header and its content ("Example")
+D412 [*] No blank lines allowed between a section header and its content ("Example")
+ --> sphinx.py:13:5
|
11 | def func():
12 | """
13 | Example:
- | ^^^^^^^ D412
+ | ^^^^^^^
|
- = help: Remove blank line(s)
+help: Remove blank line(s)
ℹ Safe fix
12 12 | """
@@ -20,14 +20,15 @@ sphinx.py:13:5: D412 [*] No blank lines allowed between a section header and its
17 16 |
18 17 | import foo
-sphinx.py:24:5: D412 [*] No blank lines allowed between a section header and its content ("Example")
+D412 [*] No blank lines allowed between a section header and its content ("Example")
+ --> sphinx.py:24:5
|
22 | def func():
23 | """
24 | Example:
- | ^^^^^^^ D412
+ | ^^^^^^^
|
- = help: Remove blank line(s)
+help: Remove blank line(s)
ℹ Safe fix
23 23 | """
@@ -39,15 +40,16 @@ sphinx.py:24:5: D412 [*] No blank lines allowed between a section header and its
29 27 |
30 28 | import foo
-sphinx.py:47:5: D412 [*] No blank lines allowed between a section header and its content ("Example")
+D412 [*] No blank lines allowed between a section header and its content ("Example")
+ --> sphinx.py:47:5
|
45 | def func():
46 | """
47 | Example
- | ^^^^^^^ D412
+ | ^^^^^^^
48 | -------
|
- = help: Remove blank line(s)
+help: Remove blank line(s)
ℹ Safe fix
47 47 | Example
@@ -58,15 +60,16 @@ sphinx.py:47:5: D412 [*] No blank lines allowed between a section header and its
52 51 |
53 52 | import foo
-sphinx.py:59:5: D412 [*] No blank lines allowed between a section header and its content ("Example")
+D412 [*] No blank lines allowed between a section header and its content ("Example")
+ --> sphinx.py:59:5
|
57 | def func():
58 | """
59 | Example
- | ^^^^^^^ D412
+ | ^^^^^^^
60 | -------
|
- = help: Remove blank line(s)
+help: Remove blank line(s)
ℹ Safe fix
59 59 | Example
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_D413.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_D413.py.snap
index b8e6594eee..0830634d78 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_D413.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_D413.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D413.py:7:1: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> D413.py:7:1
|
5 | with a hanging indent
6 |
7 | Returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
8 | the value
9 | """
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
6 6 |
@@ -21,16 +22,17 @@ D413.py:7:1: D413 [*] Missing blank line after last section ("Returns")
10 11 |
11 12 |
-D413.py:19:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> D413.py:19:5
|
17 | with a hanging indent
18 |
19 | Returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
20 | the value
21 | """
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
18 18 |
@@ -41,15 +43,16 @@ D413.py:19:5: D413 [*] Missing blank line after last section ("Returns")
22 23 |
23 24 |
-D413.py:58:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> D413.py:58:5
|
56 | with a hanging indent
57 |
58 | Returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
59 | the value"""
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
56 56 | with a hanging indent
@@ -63,16 +66,17 @@ D413.py:58:5: D413 [*] Missing blank line after last section ("Returns")
61 63 |
62 64 | def func():
-D413.py:69:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> D413.py:69:5
|
67 | with a hanging indent
68 |
69 | Returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
70 | the value
71 | """
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
68 68 |
@@ -86,16 +90,17 @@ D413.py:69:5: D413 [*] Missing blank line after last section ("Returns")
74 75 | def func():
75 76 | ("""Docstring.
-D413.py:77:5: D413 [*] Missing blank line after last section ("Raises")
+D413 [*] Missing blank line after last section ("Raises")
+ --> D413.py:77:5
|
75 | ("""Docstring.
76 |
77 | Raises:
- | ^^^^^^ D413
+ | ^^^^^^
78 | ValueError: An error.
79 | """)
|
- = help: Add blank line after "Raises"
+help: Add blank line after "Raises"
ℹ Safe fix
76 76 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap
index c8e9fd19ae..ac2dba9162 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:67:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> sections.py:67:5
|
65 | """Toggle the gizmo.
66 |
67 | Returns"""
- | ^^^^^^^ D413
+ | ^^^^^^^
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
64 64 | def no_underline_and_no_newline(): # noqa: D416
@@ -22,16 +23,17 @@ sections.py:67:5: D413 [*] Missing blank line after last section ("Returns")
69 71 |
70 72 | @expect(_D213)
-sections.py:122:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> sections.py:122:5
|
120 | """Toggle the gizmo.
121 |
122 | Returns
- | ^^^^^^^ D413
+ | ^^^^^^^
123 | -------
124 | A value of some sort.
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
122 122 | Returns
@@ -42,16 +44,17 @@ sections.py:122:5: D413 [*] Missing blank line after last section ("Returns")
126 127 |
127 128 |
-sections.py:172:5: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> sections.py:172:5
|
170 | """Toggle the gizmo.
171 |
172 | Returns
- | ^^^^^^^ D413
+ | ^^^^^^^
173 | -------
174 | """
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
171 171 |
@@ -62,16 +65,17 @@ sections.py:172:5: D413 [*] Missing blank line after last section ("Returns")
175 176 |
176 177 |
-sections.py:521:5: D413 [*] Missing blank line after last section ("Parameters")
+D413 [*] Missing blank line after last section ("Parameters")
+ --> sections.py:521:5
|
519 | """Equal length equals should be replaced with dashes.
520 |
521 | Parameters
- | ^^^^^^^^^^ D413
+ | ^^^^^^^^^^
522 | ==========
523 | """
|
- = help: Add blank line after "Parameters"
+help: Add blank line after "Parameters"
ℹ Safe fix
520 520 |
@@ -82,16 +86,17 @@ sections.py:521:5: D413 [*] Missing blank line after last section ("Parameters")
524 525 |
525 526 |
-sections.py:529:5: D413 [*] Missing blank line after last section ("Parameters")
+D413 [*] Missing blank line after last section ("Parameters")
+ --> sections.py:529:5
|
527 | """Here, the length of equals is not the same.
528 |
529 | Parameters
- | ^^^^^^^^^^ D413
+ | ^^^^^^^^^^
530 | ===========
531 | """
|
- = help: Add blank line after "Parameters"
+help: Add blank line after "Parameters"
ℹ Safe fix
528 528 |
@@ -102,15 +107,16 @@ sections.py:529:5: D413 [*] Missing blank line after last section ("Parameters")
532 533 |
533 534 |
-sections.py:550:5: D413 [*] Missing blank line after last section ("Args")
+D413 [*] Missing blank line after last section ("Args")
+ --> sections.py:550:5
|
548 | """Below, `returns:` should _not_ be considered a section header.
549 |
550 | Args:
- | ^^^^ D413
+ | ^^^^
551 | Here's a note.
|
- = help: Add blank line after "Args"
+help: Add blank line after "Args"
ℹ Safe fix
551 551 | Here's a note.
@@ -121,15 +127,16 @@ sections.py:550:5: D413 [*] Missing blank line after last section ("Args")
555 556 |
556 557 |
-sections.py:563:9: D413 [*] Missing blank line after last section ("Returns")
+D413 [*] Missing blank line after last section ("Returns")
+ --> sections.py:563:9
|
561 | Here's a note.
562 |
563 | Returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
564 | """
|
- = help: Add blank line after "Returns"
+help: Add blank line after "Returns"
ℹ Safe fix
561 561 | Here's a note.
@@ -140,16 +147,17 @@ sections.py:563:9: D413 [*] Missing blank line after last section ("Returns")
565 566 |
566 567 |
-sections.py:573:5: D413 [*] Missing blank line after last section ("returns")
+D413 [*] Missing blank line after last section ("returns")
+ --> sections.py:573:5
|
571 | arg: Here's a note.
572 |
573 | returns:
- | ^^^^^^^ D413
+ | ^^^^^^^
574 | Here's another note.
575 | """
|
- = help: Add blank line after "returns"
+help: Add blank line after "returns"
ℹ Safe fix
572 572 |
@@ -160,16 +168,17 @@ sections.py:573:5: D413 [*] Missing blank line after last section ("returns")
576 577 |
577 578 |
-sections.py:601:5: D413 [*] Missing blank line after last section ("Parameters")
+D413 [*] Missing blank line after last section ("Parameters")
+ --> sections.py:601:5
|
599 | """Test that lower case subsection header is valid even if it has the same name as section kind.
600 |
601 | Parameters:
- | ^^^^^^^^^^ D413
+ | ^^^^^^^^^^
602 | ----------
603 | parameters:
|
- = help: Add blank line after "Parameters"
+help: Add blank line after "Parameters"
ℹ Safe fix
604 604 | A list of string parameters
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap
index c4cfd3cd33..75860e3dc3 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap
@@ -1,68 +1,75 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:56:5: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:56:5
|
54 | """Toggle the gizmo.
55 |
56 | Returns
- | ^^^^^^^ D414
+ | ^^^^^^^
57 |
58 | """
|
-sections.py:67:5: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:67:5
|
65 | """Toggle the gizmo.
66 |
67 | Returns"""
- | ^^^^^^^ D414
+ | ^^^^^^^
|
-sections.py:78:5: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:78:5
|
76 | """Toggle the gizmo.
77 |
78 | Returns
- | ^^^^^^^ D414
+ | ^^^^^^^
79 | -------
80 | Yields
|
-sections.py:80:5: D414 Section has no content ("Yields")
+D414 Section has no content ("Yields")
+ --> sections.py:80:5
|
78 | Returns
79 | -------
80 | Yields
- | ^^^^^^ D414
+ | ^^^^^^
81 | ------
|
-sections.py:172:5: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:172:5
|
170 | """Toggle the gizmo.
171 |
172 | Returns
- | ^^^^^^^ D414
+ | ^^^^^^^
173 | -------
174 | """
|
-sections.py:266:5: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:266:5
|
264 | note: A random string.
265 |
266 | Returns:
- | ^^^^^^^ D414
+ | ^^^^^^^
267 |
268 | Raises:
|
-sections.py:563:9: D414 Section has no content ("Returns")
+D414 Section has no content ("Returns")
+ --> sections.py:563:9
|
561 | Here's a note.
562 |
563 | Returns:
- | ^^^^^^^ D414
+ | ^^^^^^^
564 | """
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap
index 83922317dc..f342894e32 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:355:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:355:5
|
353 | "or exclamation point (not 'y')")
354 | def lwnlkjl():
355 | """Summary"""
- | ^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
352 352 | @expect("D415: First line should end with a period, question mark, "
@@ -20,14 +21,15 @@ D.py:355:5: D415 [*] First line should end with a period, question mark, or excl
357 357 |
358 358 | @expect("D401: First line should be in imperative mood "
-D.py:406:25: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:406:25
|
404 | @expect("D415: First line should end with a period, question mark,"
405 | " or exclamation point (not 'r')")
406 | def oneliner_withdoc(): """One liner"""
- | ^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
403 403 | @expect("D400: First line should end with a period (not 'r')")
@@ -39,15 +41,16 @@ D.py:406:25: D415 [*] First line should end with a period, question mark, or exc
408 408 |
409 409 | def ignored_decorator(func): # noqa: D400,D401,D415
-D.py:410:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:410:5
|
409 | def ignored_decorator(func): # noqa: D400,D401,D415
410 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
411 | func()
412 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
407 407 |
@@ -59,15 +62,16 @@ D.py:410:5: D415 [*] First line should end with a period, question mark, or excl
412 412 | pass
413 413 |
-D.py:416:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:416:5
|
415 | def decorator_for_test(func): # noqa: D400,D401,D415
416 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
417 | func()
418 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
413 413 |
@@ -79,13 +83,14 @@ D.py:416:5: D415 [*] First line should end with a period, question mark, or excl
418 418 | pass
419 419 |
-D.py:422:35: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:422:35
|
421 | @ignored_decorator
422 | def oneliner_ignored_decorator(): """One liner"""
- | ^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
419 419 |
@@ -97,14 +102,15 @@ D.py:422:35: D415 [*] First line should end with a period, question mark, or exc
424 424 |
425 425 | @decorator_for_test
-D.py:429:49: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:429:49
|
427 | @expect("D415: First line should end with a period, question mark,"
428 | " or exclamation point (not 'r')")
429 | def oneliner_with_decorator_expecting_errors(): """One liner"""
- | ^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
426 426 | @expect("D400: First line should end with a period (not 'r')")
@@ -116,15 +122,16 @@ D.py:429:49: D415 [*] First line should end with a period, question mark, or exc
431 431 |
432 432 | @decorator_for_test
-D.py:470:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:470:5
|
468 | "or exclamation point (not 'g')")
469 | def docstring_bad():
470 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
471 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
467 467 | @expect("D415: First line should end with a period, question mark, "
@@ -136,14 +143,15 @@ D.py:470:5: D415 [*] First line should end with a period, question mark, or excl
472 472 |
473 473 |
-D.py:475:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:475:5
|
474 | def docstring_bad_ignore_all(): # noqa
475 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
476 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
472 472 |
@@ -155,14 +163,15 @@ D.py:475:5: D415 [*] First line should end with a period, question mark, or excl
477 477 |
478 478 |
-D.py:480:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:480:5
|
479 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415
480 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
481 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
477 477 |
@@ -174,15 +183,16 @@ D.py:480:5: D415 [*] First line should end with a period, question mark, or excl
482 482 |
483 483 |
-D.py:487:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:487:5
|
485 | "(perhaps 'Run', not 'Runs')")
486 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415
487 | """Runs something"""
- | ^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^
488 | pass
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
484 484 | @expect("D401: First line should be in imperative mood "
@@ -194,14 +204,15 @@ D.py:487:5: D415 [*] First line should end with a period, question mark, or excl
489 489 |
490 490 |
-D.py:520:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:520:5
|
518 | "or exclamation point (not 'g')")
519 | def bad_google_string(): # noqa: D400
520 | """Test a valid something"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
517 517 | @expect("D415: First line should end with a period, question mark, "
@@ -213,14 +224,15 @@ D.py:520:5: D415 [*] First line should end with a period, question mark, or excl
522 522 |
523 523 | # This is reproducing a bug where AttributeError is raised when parsing class
-D.py:581:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:581:5
|
579 | "or exclamation point (not '\"')")
580 | def endswith_quote():
581 | """Whitespace at the end, but also a quote" """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
578 578 | @expect("D415: First line should end with a period, question mark, "
@@ -232,16 +244,17 @@ D.py:581:5: D415 [*] First line should end with a period, question mark, or excl
583 583 |
584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate '
-D.py:615:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:615:5
|
613 | @expect('D212: Multi-line docstring summary should start at the first line')
614 | def one_liner():
615 | / """Wrong."
616 | |
617 | | """
- | |_______^ D415
+ | |_______^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
612 612 | '(found 3)')
@@ -253,14 +266,15 @@ D.py:615:5: D415 [*] First line should end with a period, question mark, or excl
617 617 | """
618 618 |
-D.py:639:17: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:639:17
|
639 | class SameLine: """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
640 |
641 | def same_line(): """This is a docstring on the same line"""
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
636 636 | """ This is a docstring that starts with a space.""" # noqa: D210
@@ -272,14 +286,15 @@ D.py:639:17: D415 [*] First line should end with a period, question mark, or exc
641 641 | def same_line(): """This is a docstring on the same line"""
642 642 |
-D.py:641:18: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:641:18
|
639 | class SameLine: """This is a docstring on the same line"""
640 |
641 | def same_line(): """This is a docstring on the same line"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
638 638 |
@@ -291,14 +306,15 @@ D.py:641:18: D415 [*] First line should end with a period, question mark, or exc
643 643 |
644 644 | def single_line_docstring_with_an_escaped_backslash():
-D.py:664:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D.py:664:5
|
663 | def newline_after_closing_quote(self):
664 | / "We enforce a newline after the closing quote for a multi-line docstring \
665 | | but continuations shouldn't be considered multi-line"
- | |_________________________________________________________^ D415
+ | |_________________________________________________________^
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
662 662 |
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D400_415.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D400_415.py.snap
index 2fdb5bc6c2..eba6769802 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D400_415.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D400_415.py.snap
@@ -1,33 +1,35 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D400_415.py:11:5: D415 First line should end with a period, question mark, or exclamation point
+D415 First line should end with a period, question mark, or exclamation point
+ --> D400_415.py:11:5
|
10 | def f():
11 | """Here's a line ending in a colon:"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | ...
|
- = help: Add closing punctuation
+help: Add closing punctuation
-D400_415.py:15:5: D415 First line should end with a period, question mark, or exclamation point
+D415 First line should end with a period, question mark, or exclamation point
+ --> D400_415.py:15:5
|
14 | def f():
15 | """Here's a line ending in a semi colon;"""
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 | ...
|
- = help: Add closing punctuation
+help: Add closing punctuation
-D400_415.py:19:5: D415 [*] First line should end with a period, question mark, or exclamation point
+D415 [*] First line should end with a period, question mark, or exclamation point
+ --> D400_415.py:19:5
|
18 | def f():
19 | """Here's a line ending with a whitespace """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 | ...
|
- = help: Add closing punctuation
+help: Add closing punctuation
ℹ Unsafe fix
16 16 | ...
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D417_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D417_sections.py.snap
index 17d957fa2b..79fa8e46b8 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D417_sections.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D417_sections.py.snap
@@ -1,101 +1,112 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-sections.py:292:9: D417 Missing argument description in the docstring for `bar`: `y`
+D417 Missing argument description in the docstring for `bar`: `y`
+ --> sections.py:292:9
|
290 | x = 1
291 |
292 | def bar(y=2): # noqa: D207, D213, D406, D407
- | ^^^ D417
+ | ^^^
293 | """Nested function test for docstrings.
|
-sections.py:309:5: D417 Missing argument description in the docstring for `test_missing_google_args`: `y`
+D417 Missing argument description in the docstring for `test_missing_google_args`: `y`
+ --> sections.py:309:5
|
307 | "(argument(s) y are missing descriptions in "
308 | "'test_missing_google_args' docstring)")
309 | def test_missing_google_args(x=1, y=2, _private=3): # noqa: D406, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
310 | """Toggle the gizmo.
|
-sections.py:333:9: D417 Missing argument descriptions in the docstring for `test_missing_args`: `test`, `y`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args`: `test`, `y`, `z`
+ --> sections.py:333:9
|
331 | "(argument(s) test, y, z are missing descriptions in "
332 | "'test_missing_args' docstring)", arg_count=5)
333 | def test_missing_args(self, test, x, y, z=3, _private_arg=3): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^
334 | """Test a valid args section.
|
-sections.py:345:9: D417 Missing argument descriptions in the docstring for `test_missing_args_class_method`: `test`, `y`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args_class_method`: `test`, `y`, `z`
+ --> sections.py:345:9
|
343 | "(argument(s) test, y, z are missing descriptions in "
344 | "'test_missing_args_class_method' docstring)", arg_count=5)
345 | def test_missing_args_class_method(cls, test, x, y, _, z=3): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346 | """Test a valid args section.
|
-sections.py:358:9: D417 Missing argument descriptions in the docstring for `test_missing_args_static_method`: `a`, `y`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args_static_method`: `a`, `y`, `z`
+ --> sections.py:358:9
|
356 | "(argument(s) a, y, z are missing descriptions in "
357 | "'test_missing_args_static_method' docstring)", arg_count=4)
358 | def test_missing_args_static_method(a, x, y, _test, z=3): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
359 | """Test a valid args section.
|
-sections.py:370:9: D417 Missing argument descriptions in the docstring for `test_missing_docstring`: `a`, `b`
+D417 Missing argument descriptions in the docstring for `test_missing_docstring`: `a`, `b`
+ --> sections.py:370:9
|
368 | "(argument(s) a, b are missing descriptions in "
369 | "'test_missing_docstring' docstring)", arg_count=2)
370 | def test_missing_docstring(a, b): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^
371 | """Test a valid args section.
|
-sections.py:398:5: D417 Missing argument description in the docstring for `test_missing_numpy_args`: `y`
+D417 Missing argument description in the docstring for `test_missing_numpy_args`: `y`
+ --> sections.py:398:5
|
396 | "(argument(s) y are missing descriptions in "
397 | "'test_missing_numpy_args' docstring)")
398 | def test_missing_numpy_args(_private_arg=0, x=1, y=2): # noqa: D406, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^
399 | """Toggle the gizmo.
|
-sections.py:434:9: D417 Missing argument descriptions in the docstring for `test_missing_args`: `test`, `y`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args`: `test`, `y`, `z`
+ --> sections.py:434:9
|
432 | "(argument(s) test, y, z are missing descriptions in "
433 | "'test_missing_args' docstring)", arg_count=5)
434 | def test_missing_args(self, test, x, y, z=3, t=1, _private=0): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^
435 | """Test a valid args section.
|
-sections.py:449:9: D417 Missing argument descriptions in the docstring for `test_missing_args_class_method`: `test`, `y`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args_class_method`: `test`, `y`, `z`
+ --> sections.py:449:9
|
447 | "(argument(s) test, y, z are missing descriptions in "
448 | "'test_missing_args_class_method' docstring)", arg_count=4)
449 | def test_missing_args_class_method(cls, test, x, y, z=3): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
450 | """Test a valid args section.
|
-sections.py:468:9: D417 Missing argument descriptions in the docstring for `test_missing_args_static_method`: `a`, `z`
+D417 Missing argument descriptions in the docstring for `test_missing_args_static_method`: `a`, `z`
+ --> sections.py:468:9
|
466 | "(argument(s) a, z are missing descriptions in "
467 | "'test_missing_args_static_method' docstring)", arg_count=3)
468 | def test_missing_args_static_method(a, x, y, z=3, t=1): # noqa: D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
469 | """Test a valid args section.
|
-sections.py:498:9: D417 Missing argument description in the docstring for `test_incorrect_indent`: `y`
+D417 Missing argument description in the docstring for `test_incorrect_indent`: `y`
+ --> sections.py:498:9
|
496 | "(argument(s) y are missing descriptions in "
497 | "'test_incorrect_indent' docstring)", arg_count=3)
498 | def test_incorrect_indent(self, x=1, y=2): # noqa: D207, D213, D407
- | ^^^^^^^^^^^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^^^^^^^^^^^
499 | """Reproducing issue #437.
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D418_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D418_D.py.snap
index 515371cb79..850d6f3b93 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D418_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D418_D.py.snap
@@ -1,30 +1,32 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-D.py:34:9: D418 Function decorated with `@overload` shouldn't contain a docstring
+D418 Function decorated with `@overload` shouldn't contain a docstring
+ --> D.py:34:9
|
33 | @overload
34 | def overloaded_method(self, a: str) -> str:
- | ^^^^^^^^^^^^^^^^^ D418
+ | ^^^^^^^^^^^^^^^^^
35 | """Foo bar documentation."""
36 | ...
|
-D.py:90:9: D418 Function decorated with `@overload` shouldn't contain a docstring
+D418 Function decorated with `@overload` shouldn't contain a docstring
+ --> D.py:90:9
|
89 | @overload
90 | def nested_overloaded_func(a: str) -> str:
- | ^^^^^^^^^^^^^^^^^^^^^^ D418
+ | ^^^^^^^^^^^^^^^^^^^^^^
91 | """Foo bar documentation."""
92 | ...
|
-D.py:110:5: D418 Function decorated with `@overload` shouldn't contain a docstring
+D418 Function decorated with `@overload` shouldn't contain a docstring
+ --> D.py:110:5
|
109 | @overload
110 | def overloaded_func(a: str) -> str:
- | ^^^^^^^^^^^^^^^ D418
+ | ^^^^^^^^^^^^^^^
111 | """Foo bar documentation."""
112 | ...
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap
index 18f659a0c5..e6077f93ad 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap
@@ -1,29 +1,32 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D.py:20:9: D419 Docstring is empty
+D419 Docstring is empty
+ --> D.py:20:9
|
19 | class meta:
20 | """"""
- | ^^^^^^ D419
+ | ^^^^^^
21 |
22 | @expect('D102: Missing docstring in public method')
|
-D.py:74:5: D419 Docstring is empty
+D419 Docstring is empty
+ --> D.py:74:5
|
72 | @expect('D419: Docstring is empty')
73 | def function():
74 | """ """
- | ^^^^^^^ D419
+ | ^^^^^^^
75 | def ok_since_nested():
76 | pass
|
-D.py:80:9: D419 Docstring is empty
+D419 Docstring is empty
+ --> D.py:80:9
|
78 | @expect('D419: Docstring is empty')
79 | def nested():
80 | ''
- | ^^ D419
+ | ^^
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap
index 4c659e417b..60a797e364 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap
@@ -1,27 +1,31 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-all.py:1:1: D100 Missing docstring in public module
-all.py:1:5: D103 Missing docstring in public function
+D100 Missing docstring in public module
+--> all.py:1:1
+
+D103 Missing docstring in public function
+ --> all.py:1:5
|
1 | def public_func():
- | ^^^^^^^^^^^ D103
+ | ^^^^^^^^^^^
2 | pass
|
-all.py:9:7: D101 Missing docstring in public class
+D101 Missing docstring in public class
+ --> all.py:9:7
|
9 | class PublicClass:
- | ^^^^^^^^^^^ D101
+ | ^^^^^^^^^^^
10 | class PublicNestedClass:
11 | pass
|
-all.py:10:11: D106 Missing docstring in public nested class
+D106 Missing docstring in public nested class
+ --> all.py:10:11
|
9 | class PublicClass:
10 | class PublicNestedClass:
- | ^^^^^^^^^^^^^^^^^ D106
+ | ^^^^^^^^^^^^^^^^^
11 | pass
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap
index 503c830dd1..5c3bf3e0bd 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
-snapshot_kind: text
---
-bom.py:1:1: D300 [*] Use triple double quotes `"""`
+D300 [*] Use triple double quotes `"""`
+ --> bom.py:1:1
|
-1 | ''' SAM macro definitions '''
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300
+1 | ''' SAM macro definitions '''
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Convert to triple double quotes
+help: Convert to triple double quotes
ℹ Safe fix
1 |-''' SAM macro definitions '''
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap
index 00b6e1887d..262bc67768 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D209_D400.py:2:5: D209 [*] Multi-line docstring closing quotes should be on a separate line
+D209 [*] Multi-line docstring closing quotes should be on a separate line
+ --> D209_D400.py:2:5
|
1 | def lorem():
2 | / """lorem ipsum dolor sit amet consectetur adipiscing elit
3 | | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"""
- | |________________________________________________________________________^ D209
+ | |________________________________________________________________________^
|
- = help: Move closing quotes to new line
+help: Move closing quotes to new line
ℹ Safe fix
1 1 | def lorem():
@@ -17,14 +18,15 @@ D209_D400.py:2:5: D209 [*] Multi-line docstring closing quotes should be on a se
3 |+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
4 |+ """
-D209_D400.py:2:5: D400 [*] First line should end with a period
+D400 [*] First line should end with a period
+ --> D209_D400.py:2:5
|
1 | def lorem():
2 | / """lorem ipsum dolor sit amet consectetur adipiscing elit
3 | | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"""
- | |________________________________________________________________________^ D400
+ | |________________________________________________________________________^
|
- = help: Add period
+help: Add period
ℹ Unsafe fix
1 1 | def lorem():
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google.snap
index f99e5d73fb..63b975feb9 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google.snap
@@ -1,91 +1,103 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D417.py:1:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:1:5
|
1 | def f(x, y, z):
- | ^ D417
+ | ^
2 | """Do something.
|
-D417.py:14:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:14:5
|
14 | def f(x, y, z):
- | ^ D417
+ | ^
15 | """Do something.
|
-D417.py:27:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:27:5
|
27 | def f(x, y, z):
- | ^ D417
+ | ^
28 | """Do something.
|
-D417.py:39:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:39:5
|
39 | def f(x, y, z):
- | ^ D417
+ | ^
40 | """Do something.
|
-D417.py:52:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:52:5
|
52 | def f(x, y, z):
- | ^ D417
+ | ^
53 | """Do something.
|
-D417.py:65:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:65:5
|
65 | def f(x, y, z):
- | ^ D417
+ | ^
66 | """Do something.
|
-D417.py:77:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:77:5
|
77 | def f(x, y, z):
- | ^ D417
+ | ^
78 | """Do something.
|
-D417.py:98:5: D417 Missing argument description in the docstring for `f`: `x`
+D417 Missing argument description in the docstring for `f`: `x`
+ --> D417.py:98:5
|
98 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
99 | """Do something.
|
-D417.py:108:5: D417 Missing argument description in the docstring for `f`: `*args`
+D417 Missing argument description in the docstring for `f`: `*args`
+ --> D417.py:108:5
|
108 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
109 | """Do something.
|
-D417.py:155:5: D417 Missing argument description in the docstring for `select_data`: `auto_save`
+D417 Missing argument description in the docstring for `select_data`: `auto_save`
+ --> D417.py:155:5
|
155 | def select_data(
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
156 | query: str,
157 | args: tuple,
|
-D417.py:172:5: D417 Missing argument description in the docstring for `f`: `**kwargs`
+D417 Missing argument description in the docstring for `f`: `**kwargs`
+ --> D417.py:172:5
|
170 | """
171 |
172 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
173 | """Do something.
|
-D417.py:199:5: D417 Missing argument description in the docstring for `should_fail`: `Args`
+D417 Missing argument description in the docstring for `should_fail`: `Args`
+ --> D417.py:199:5
|
198 | # undocumented argument with the same name as a section
199 | def should_fail(payload, Args):
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
200 | """
201 | Send a message.
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google_ignore_var_parameters.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google_ignore_var_parameters.snap
index d09b599a09..f645ff960e 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google_ignore_var_parameters.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_google_ignore_var_parameters.snap
@@ -1,75 +1,85 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D417.py:1:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:1:5
|
1 | def f(x, y, z):
- | ^ D417
+ | ^
2 | """Do something.
|
-D417.py:14:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:14:5
|
14 | def f(x, y, z):
- | ^ D417
+ | ^
15 | """Do something.
|
-D417.py:27:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:27:5
|
27 | def f(x, y, z):
- | ^ D417
+ | ^
28 | """Do something.
|
-D417.py:39:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:39:5
|
39 | def f(x, y, z):
- | ^ D417
+ | ^
40 | """Do something.
|
-D417.py:52:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:52:5
|
52 | def f(x, y, z):
- | ^ D417
+ | ^
53 | """Do something.
|
-D417.py:65:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:65:5
|
65 | def f(x, y, z):
- | ^ D417
+ | ^
66 | """Do something.
|
-D417.py:77:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:77:5
|
77 | def f(x, y, z):
- | ^ D417
+ | ^
78 | """Do something.
|
-D417.py:98:5: D417 Missing argument description in the docstring for `f`: `x`
+D417 Missing argument description in the docstring for `f`: `x`
+ --> D417.py:98:5
|
98 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
99 | """Do something.
|
-D417.py:155:5: D417 Missing argument description in the docstring for `select_data`: `auto_save`
+D417 Missing argument description in the docstring for `select_data`: `auto_save`
+ --> D417.py:155:5
|
155 | def select_data(
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
156 | query: str,
157 | args: tuple,
|
-D417.py:199:5: D417 Missing argument description in the docstring for `should_fail`: `Args`
+D417 Missing argument description in the docstring for `should_fail`: `Args`
+ --> D417.py:199:5
|
198 | # undocumented argument with the same name as a section
199 | def should_fail(payload, Args):
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
200 | """
201 | Send a message.
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified.snap
index f99e5d73fb..63b975feb9 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified.snap
@@ -1,91 +1,103 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D417.py:1:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:1:5
|
1 | def f(x, y, z):
- | ^ D417
+ | ^
2 | """Do something.
|
-D417.py:14:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:14:5
|
14 | def f(x, y, z):
- | ^ D417
+ | ^
15 | """Do something.
|
-D417.py:27:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:27:5
|
27 | def f(x, y, z):
- | ^ D417
+ | ^
28 | """Do something.
|
-D417.py:39:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:39:5
|
39 | def f(x, y, z):
- | ^ D417
+ | ^
40 | """Do something.
|
-D417.py:52:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:52:5
|
52 | def f(x, y, z):
- | ^ D417
+ | ^
53 | """Do something.
|
-D417.py:65:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:65:5
|
65 | def f(x, y, z):
- | ^ D417
+ | ^
66 | """Do something.
|
-D417.py:77:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:77:5
|
77 | def f(x, y, z):
- | ^ D417
+ | ^
78 | """Do something.
|
-D417.py:98:5: D417 Missing argument description in the docstring for `f`: `x`
+D417 Missing argument description in the docstring for `f`: `x`
+ --> D417.py:98:5
|
98 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
99 | """Do something.
|
-D417.py:108:5: D417 Missing argument description in the docstring for `f`: `*args`
+D417 Missing argument description in the docstring for `f`: `*args`
+ --> D417.py:108:5
|
108 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
109 | """Do something.
|
-D417.py:155:5: D417 Missing argument description in the docstring for `select_data`: `auto_save`
+D417 Missing argument description in the docstring for `select_data`: `auto_save`
+ --> D417.py:155:5
|
155 | def select_data(
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
156 | query: str,
157 | args: tuple,
|
-D417.py:172:5: D417 Missing argument description in the docstring for `f`: `**kwargs`
+D417 Missing argument description in the docstring for `f`: `**kwargs`
+ --> D417.py:172:5
|
170 | """
171 |
172 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
173 | """Do something.
|
-D417.py:199:5: D417 Missing argument description in the docstring for `should_fail`: `Args`
+D417 Missing argument description in the docstring for `should_fail`: `Args`
+ --> D417.py:199:5
|
198 | # undocumented argument with the same name as a section
199 | def should_fail(payload, Args):
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
200 | """
201 | Send a message.
|
diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified_ignore_var_parameters.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified_ignore_var_parameters.snap
index f99e5d73fb..63b975feb9 100644
--- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified_ignore_var_parameters.snap
+++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d417_unspecified_ignore_var_parameters.snap
@@ -1,91 +1,103 @@
---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
-D417.py:1:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:1:5
|
1 | def f(x, y, z):
- | ^ D417
+ | ^
2 | """Do something.
|
-D417.py:14:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:14:5
|
14 | def f(x, y, z):
- | ^ D417
+ | ^
15 | """Do something.
|
-D417.py:27:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:27:5
|
27 | def f(x, y, z):
- | ^ D417
+ | ^
28 | """Do something.
|
-D417.py:39:5: D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+D417 Missing argument descriptions in the docstring for `f`: `y`, `z`
+ --> D417.py:39:5
|
39 | def f(x, y, z):
- | ^ D417
+ | ^
40 | """Do something.
|
-D417.py:52:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:52:5
|
52 | def f(x, y, z):
- | ^ D417
+ | ^
53 | """Do something.
|
-D417.py:65:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:65:5
|
65 | def f(x, y, z):
- | ^ D417
+ | ^
66 | """Do something.
|
-D417.py:77:5: D417 Missing argument description in the docstring for `f`: `y`
+D417 Missing argument description in the docstring for `f`: `y`
+ --> D417.py:77:5
|
77 | def f(x, y, z):
- | ^ D417
+ | ^
78 | """Do something.
|
-D417.py:98:5: D417 Missing argument description in the docstring for `f`: `x`
+D417 Missing argument description in the docstring for `f`: `x`
+ --> D417.py:98:5
|
98 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
99 | """Do something.
|
-D417.py:108:5: D417 Missing argument description in the docstring for `f`: `*args`
+D417 Missing argument description in the docstring for `f`: `*args`
+ --> D417.py:108:5
|
108 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
109 | """Do something.
|
-D417.py:155:5: D417 Missing argument description in the docstring for `select_data`: `auto_save`
+D417 Missing argument description in the docstring for `select_data`: `auto_save`
+ --> D417.py:155:5
|
155 | def select_data(
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
156 | query: str,
157 | args: tuple,
|
-D417.py:172:5: D417 Missing argument description in the docstring for `f`: `**kwargs`
+D417 Missing argument description in the docstring for `f`: `**kwargs`
+ --> D417.py:172:5
|
170 | """
171 |
172 | def f(x, *args, **kwargs):
- | ^ D417
+ | ^
173 | """Do something.
|
-D417.py:199:5: D417 Missing argument description in the docstring for `should_fail`: `Args`
+D417 Missing argument description in the docstring for `should_fail`: `Args`
+ --> D417.py:199:5
|
198 | # undocumented argument with the same name as a section
199 | def should_fail(payload, Args):
- | ^^^^^^^^^^^ D417
+ | ^^^^^^^^^^^
200 | """
201 | Send a message.
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap
index 386a6e2892..68c8fc9e8a 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_0.py:2:8: F401 [*] `functools` imported but unused
+F401 [*] `functools` imported but unused
+ --> F401_0.py:2:8
|
1 | from __future__ import all_feature_names
2 | import functools, os
- | ^^^^^^^^^ F401
+ | ^^^^^^^^^
3 | from datetime import datetime
4 | from collections import (
|
- = help: Remove unused import: `functools`
+help: Remove unused import: `functools`
ℹ Safe fix
1 1 | from __future__ import all_feature_names
@@ -19,16 +20,17 @@ F401_0.py:2:8: F401 [*] `functools` imported but unused
4 4 | from collections import (
5 5 | Counter,
-F401_0.py:6:5: F401 [*] `collections.OrderedDict` imported but unused
+F401 [*] `collections.OrderedDict` imported but unused
+ --> F401_0.py:6:5
|
4 | from collections import (
5 | Counter,
6 | OrderedDict,
- | ^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^
7 | namedtuple,
8 | )
|
- = help: Remove unused import: `collections.OrderedDict`
+help: Remove unused import: `collections.OrderedDict`
ℹ Safe fix
3 3 | from datetime import datetime
@@ -39,16 +41,17 @@ F401_0.py:6:5: F401 [*] `collections.OrderedDict` imported but unused
8 7 | )
9 8 | import multiprocessing.pool
-F401_0.py:12:8: F401 [*] `logging.handlers` imported but unused
+F401 [*] `logging.handlers` imported but unused
+ --> F401_0.py:12:8
|
10 | import multiprocessing.process
11 | import logging.config
12 | import logging.handlers
- | ^^^^^^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^^^^^^
13 | from typing import (
14 | TYPE_CHECKING,
|
- = help: Remove unused import: `logging.handlers`
+help: Remove unused import: `logging.handlers`
ℹ Safe fix
9 9 | import multiprocessing.pool
@@ -59,14 +62,15 @@ F401_0.py:12:8: F401 [*] `logging.handlers` imported but unused
14 13 | TYPE_CHECKING,
15 14 | NamedTuple,
-F401_0.py:32:12: F401 [*] `shelve` imported but unused
+F401 [*] `shelve` imported but unused
+ --> F401_0.py:32:12
|
31 | if TYPE_CHECKING:
32 | import shelve
- | ^^^^^^ F401
+ | ^^^^^^
33 | import importlib
|
- = help: Remove unused import: `shelve`
+help: Remove unused import: `shelve`
ℹ Safe fix
29 29 | from models import Fruit, Nut, Vegetable
@@ -77,16 +81,17 @@ F401_0.py:32:12: F401 [*] `shelve` imported but unused
34 33 |
35 34 | if TYPE_CHECKING:
-F401_0.py:33:12: F401 [*] `importlib` imported but unused
+F401 [*] `importlib` imported but unused
+ --> F401_0.py:33:12
|
31 | if TYPE_CHECKING:
32 | import shelve
33 | import importlib
- | ^^^^^^^^^ F401
+ | ^^^^^^^^^
34 |
35 | if TYPE_CHECKING:
|
- = help: Remove unused import: `importlib`
+help: Remove unused import: `importlib`
ℹ Safe fix
30 30 |
@@ -97,16 +102,17 @@ F401_0.py:33:12: F401 [*] `importlib` imported but unused
35 34 | if TYPE_CHECKING:
36 35 | """Hello, world!"""
-F401_0.py:37:12: F401 [*] `pathlib` imported but unused
+F401 [*] `pathlib` imported but unused
+ --> F401_0.py:37:12
|
35 | if TYPE_CHECKING:
36 | """Hello, world!"""
37 | import pathlib
- | ^^^^^^^ F401
+ | ^^^^^^^
38 |
39 | z = 1
|
- = help: Remove unused import: `pathlib`
+help: Remove unused import: `pathlib`
ℹ Safe fix
34 34 |
@@ -117,13 +123,14 @@ F401_0.py:37:12: F401 [*] `pathlib` imported but unused
39 38 | z = 1
40 39 |
-F401_0.py:52:16: F401 [*] `pickle` imported but unused
+F401 [*] `pickle` imported but unused
+ --> F401_0.py:52:16
|
51 | def b(self) -> None:
52 | import pickle
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import: `pickle`
+help: Remove unused import: `pickle`
ℹ Safe fix
49 49 | z = multiprocessing.pool.ThreadPool()
@@ -135,15 +142,16 @@ F401_0.py:52:16: F401 [*] `pickle` imported but unused
54 54 |
55 55 | __all__ = ["ClassA"] + ["ClassB"]
-F401_0.py:93:16: F401 [*] `x` imported but unused
+F401 [*] `x` imported but unused
+ --> F401_0.py:93:16
|
91 | match *0, 1, *2:
92 | case 0,:
93 | import x
- | ^ F401
+ | ^
94 | import y
|
- = help: Remove unused import: `x`
+help: Remove unused import: `x`
ℹ Safe fix
90 90 | # Test: match statements.
@@ -154,14 +162,15 @@ F401_0.py:93:16: F401 [*] `x` imported but unused
95 94 |
96 95 |
-F401_0.py:94:16: F401 [*] `y` imported but unused
+F401 [*] `y` imported but unused
+ --> F401_0.py:94:16
|
92 | case 0,:
93 | import x
94 | import y
- | ^ F401
+ | ^
|
- = help: Remove unused import: `y`
+help: Remove unused import: `y`
ℹ Safe fix
91 91 | match *0, 1, *2:
@@ -172,16 +181,17 @@ F401_0.py:94:16: F401 [*] `y` imported but unused
96 95 |
97 96 | # Test: access a sub-importation via an alias.
-F401_0.py:99:8: F401 [*] `foo.bar.baz` imported but unused
+F401 [*] `foo.bar.baz` imported but unused
+ --> F401_0.py:99:8
|
97 | # Test: access a sub-importation via an alias.
98 | import foo.bar as bop
99 | import foo.bar.baz
- | ^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^
100 |
101 | print(bop.baz.read_csv("test.csv"))
|
- = help: Remove unused import: `foo.bar.baz`
+help: Remove unused import: `foo.bar.baz`
ℹ Safe fix
96 96 |
@@ -192,16 +202,17 @@ F401_0.py:99:8: F401 [*] `foo.bar.baz` imported but unused
101 100 | print(bop.baz.read_csv("test.csv"))
102 101 |
-F401_0.py:105:12: F401 [*] `a1` imported but unused
+F401 [*] `a1` imported but unused
+ --> F401_0.py:105:12
|
103 | # Test: isolated deletions.
104 | if TYPE_CHECKING:
105 | import a1
- | ^^ F401
+ | ^^
106 |
107 | import a2
|
- = help: Remove unused import: `a1`
+help: Remove unused import: `a1`
ℹ Safe fix
102 102 |
@@ -212,14 +223,15 @@ F401_0.py:105:12: F401 [*] `a1` imported but unused
107 106 | import a2
108 107 |
-F401_0.py:107:12: F401 [*] `a2` imported but unused
+F401 [*] `a2` imported but unused
+ --> F401_0.py:107:12
|
105 | import a1
106 |
107 | import a2
- | ^^ F401
+ | ^^
|
- = help: Remove unused import: `a2`
+help: Remove unused import: `a2`
ℹ Safe fix
104 104 | if TYPE_CHECKING:
@@ -230,16 +242,17 @@ F401_0.py:107:12: F401 [*] `a2` imported but unused
109 108 |
110 109 | match *0, 1, *2:
-F401_0.py:112:16: F401 [*] `b1` imported but unused
+F401 [*] `b1` imported but unused
+ --> F401_0.py:112:16
|
110 | match *0, 1, *2:
111 | case 0,:
112 | import b1
- | ^^ F401
+ | ^^
113 |
114 | import b2
|
- = help: Remove unused import: `b1`
+help: Remove unused import: `b1`
ℹ Safe fix
109 109 |
@@ -250,14 +263,15 @@ F401_0.py:112:16: F401 [*] `b1` imported but unused
114 113 | import b2
115 114 |
-F401_0.py:114:16: F401 [*] `b2` imported but unused
+F401 [*] `b2` imported but unused
+ --> F401_0.py:114:16
|
112 | import b1
113 |
114 | import b2
- | ^^ F401
+ | ^^
|
- = help: Remove unused import: `b2`
+help: Remove unused import: `b2`
ℹ Safe fix
111 111 | case 0,:
@@ -268,13 +282,14 @@ F401_0.py:114:16: F401 [*] `b2` imported but unused
116 115 |
117 116 | # Regression test for: https://github.com/astral-sh/ruff/issues/7244
-F401_0.py:122:1: F401 [*] `datameta_client_lib.model_helpers.noqa` imported but unused
+F401 [*] `datameta_client_lib.model_helpers.noqa` imported but unused
+ --> F401_0.py:122:1
|
121 | from datameta_client_lib.model_helpers import (
122 | noqa )
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `datameta_client_lib.model_helpers.noqa`
+help: Remove unused import: `datameta_client_lib.model_helpers.noqa`
ℹ Safe fix
118 118 | from datameta_client_lib.model_utils import ( # noqa: F401
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_10.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_10.py.snap
index 55ff498a05..5ed90379ca 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_10.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_10.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_10.py:6:16: F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability
+F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability
+ --> F401_10.py:6:16
|
4 | def module_not_found_error():
5 | try:
6 | import orjson
- | ^^^^^^ F401
+ | ^^^^^^
7 |
8 | return True
|
- = help: Remove unused import: `orjson`
+help: Remove unused import: `orjson`
-F401_10.py:15:16: F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability
+F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability
+ --> F401_10.py:15:16
|
13 | def import_error():
14 | try:
15 | import orjson
- | ^^^^^^ F401
+ | ^^^^^^
16 |
17 | return True
|
- = help: Remove unused import: `orjson`
+help: Remove unused import: `orjson`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap
index 88d251d0fa..365fd6bce5 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_11.py:4:27: F401 [*] `pathlib.PurePath` imported but unused
+F401 [*] `pathlib.PurePath` imported but unused
+ --> F401_11.py:4:27
|
3 | from typing import List
4 | from pathlib import Path, PurePath
- | ^^^^^^^^ F401
+ | ^^^^^^^^
|
- = help: Remove unused import: `pathlib.PurePath`
+help: Remove unused import: `pathlib.PurePath`
ℹ Safe fix
1 1 | """Test: parsing of nested string annotations."""
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap
index e868e4a466..f1a83cee3e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_15.py:5:25: F401 [*] `pathlib.Path` imported but unused
+F401 [*] `pathlib.Path` imported but unused
+ --> F401_15.py:5:25
|
4 | if TYPE_CHECKING:
5 | from pathlib import Path
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `pathlib.Path`
+help: Remove unused import: `pathlib.Path`
ℹ Safe fix
2 2 | from django.db.models import ForeignKey
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_17.py.snap
index 24a1dc4ff1..a3d870b502 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_17.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_17.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_17.py:12:27: F401 [*] `threading.Thread` imported but unused
+F401 [*] `threading.Thread` imported but unused
+ --> F401_17.py:12:27
|
11 | def fn(thread: Thread):
12 | from threading import Thread
- | ^^^^^^ F401
+ | ^^^^^^
13 |
14 | # The `Thread` on the left-hand side should resolve to the `Thread` imported at the
|
- = help: Remove unused import: `threading.Thread`
+help: Remove unused import: `threading.Thread`
ℹ Safe fix
9 9 |
@@ -20,15 +21,16 @@ F401_17.py:12:27: F401 [*] `threading.Thread` imported but unused
14 13 | # The `Thread` on the left-hand side should resolve to the `Thread` imported at the
15 14 | # top level.
-F401_17.py:20:27: F401 [*] `threading.Thread` imported but unused
+F401 [*] `threading.Thread` imported but unused
+ --> F401_17.py:20:27
|
19 | def fn(thread: Thread):
20 | from threading import Thread
- | ^^^^^^ F401
+ | ^^^^^^
21 |
22 | # The `Thread` on the left-hand side should resolve to the `Thread` imported at the
|
- = help: Remove unused import: `threading.Thread`
+help: Remove unused import: `threading.Thread`
ℹ Safe fix
17 17 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap
index 031fe90e78..3bef4fd0f4 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_18.py:5:12: F401 [*] `__future__` imported but unused
+F401 [*] `__future__` imported but unused
+ --> F401_18.py:5:12
|
4 | def f():
5 | import __future__
- | ^^^^^^^^^^ F401
+ | ^^^^^^^^^^
|
- = help: Remove unused import: `__future__`
+help: Remove unused import: `__future__`
ℹ Safe fix
2 2 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_23.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_23.py.snap
index 5fabeda173..13551928bf 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_23.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_23.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_23.py:4:16: F401 [*] `re.RegexFlag` imported but unused
+F401 [*] `re.RegexFlag` imported but unused
+ --> F401_23.py:4:16
|
3 | from pathlib import Path
4 | from re import RegexFlag
- | ^^^^^^^^^ F401
+ | ^^^^^^^^^
5 | from typing import Annotated
|
- = help: Remove unused import: `re.RegexFlag`
+help: Remove unused import: `re.RegexFlag`
ℹ Safe fix
1 1 | """Test: ensure that we treat strings in `typing.Annotation` as type definitions."""
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_34.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_34.py.snap
index 519e21f21a..dbbc13c516 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_34.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_34.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_34.py:45:24: F401 [*] `typing.Union` imported but unused
+F401 [*] `typing.Union` imported but unused
+ --> F401_34.py:45:24
|
43 | # expressions either!)
44 | def f():
45 | from typing import Union
- | ^^^^^ F401
+ | ^^^^^
46 |
47 | from typing_extensions import TypeAliasType
|
- = help: Remove unused import: `typing.Union`
+help: Remove unused import: `typing.Union`
ℹ Safe fix
42 42 | # expressions (and type checkers probably wouldn't understand them as type
@@ -21,15 +22,16 @@ F401_34.py:45:24: F401 [*] `typing.Union` imported but unused
47 46 | from typing_extensions import TypeAliasType
48 47 |
-F401_34.py:58:24: F401 [*] `typing.Union` imported but unused
+F401 [*] `typing.Union` imported but unused
+ --> F401_34.py:58:24
|
57 | def f():
58 | from typing import Union
- | ^^^^^ F401
+ | ^^^^^
59 |
60 | from typing_extensions import TypeAliasType
|
- = help: Remove unused import: `typing.Union`
+help: Remove unused import: `typing.Union`
ℹ Safe fix
55 55 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap
index 5fe20fdee4..c1e8f17a83 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_5.py:2:17: F401 [*] `a.b.c` imported but unused
+F401 [*] `a.b.c` imported but unused
+ --> F401_5.py:2:17
|
1 | """Test: removal of multi-segment and aliases imports."""
2 | from a.b import c
- | ^ F401
+ | ^
3 | from d.e import f as g
4 | import h.i
|
- = help: Remove unused import: `a.b.c`
+help: Remove unused import: `a.b.c`
ℹ Safe fix
1 1 | """Test: removal of multi-segment and aliases imports."""
@@ -19,16 +19,17 @@ F401_5.py:2:17: F401 [*] `a.b.c` imported but unused
4 3 | import h.i
5 4 | import j.k as l
-F401_5.py:3:22: F401 [*] `d.e.f` imported but unused
+F401 [*] `d.e.f` imported but unused
+ --> F401_5.py:3:22
|
1 | """Test: removal of multi-segment and aliases imports."""
2 | from a.b import c
3 | from d.e import f as g
- | ^ F401
+ | ^
4 | import h.i
5 | import j.k as l
|
- = help: Remove unused import: `d.e.f`
+help: Remove unused import: `d.e.f`
ℹ Safe fix
1 1 | """Test: removal of multi-segment and aliases imports."""
@@ -37,15 +38,16 @@ F401_5.py:3:22: F401 [*] `d.e.f` imported but unused
4 3 | import h.i
5 4 | import j.k as l
-F401_5.py:4:8: F401 [*] `h.i` imported but unused
+F401 [*] `h.i` imported but unused
+ --> F401_5.py:4:8
|
2 | from a.b import c
3 | from d.e import f as g
4 | import h.i
- | ^^^ F401
+ | ^^^
5 | import j.k as l
|
- = help: Remove unused import: `h.i`
+help: Remove unused import: `h.i`
ℹ Safe fix
1 1 | """Test: removal of multi-segment and aliases imports."""
@@ -54,14 +56,15 @@ F401_5.py:4:8: F401 [*] `h.i` imported but unused
4 |-import h.i
5 4 | import j.k as l
-F401_5.py:5:15: F401 [*] `j.k` imported but unused
+F401 [*] `j.k` imported but unused
+ --> F401_5.py:5:15
|
3 | from d.e import f as g
4 | import h.i
5 | import j.k as l
- | ^ F401
+ | ^
|
- = help: Remove unused import: `j.k`
+help: Remove unused import: `j.k`
ℹ Safe fix
2 2 | from a.b import c
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap
index 24dbe932b4..97f478faa2 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_6.py:7:25: F401 [*] `.background.BackgroundTasks` imported but unused
+F401 [*] `.background.BackgroundTasks` imported but unused
+ --> F401_6.py:7:25
|
6 | # F401 `background.BackgroundTasks` imported but unused
7 | from .background import BackgroundTasks
- | ^^^^^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^^^^^
8 |
9 | # F401 `datastructures.UploadFile` imported but unused
|
- = help: Remove unused import: `.background.BackgroundTasks`
+help: Remove unused import: `.background.BackgroundTasks`
ℹ Safe fix
4 4 | from .applications import FastAPI as FastAPI
@@ -20,15 +21,16 @@ F401_6.py:7:25: F401 [*] `.background.BackgroundTasks` imported but unused
9 8 | # F401 `datastructures.UploadFile` imported but unused
10 9 | from .datastructures import UploadFile as FileUpload
-F401_6.py:10:43: F401 [*] `.datastructures.UploadFile` imported but unused
+F401 [*] `.datastructures.UploadFile` imported but unused
+ --> F401_6.py:10:43
|
9 | # F401 `datastructures.UploadFile` imported but unused
10 | from .datastructures import UploadFile as FileUpload
- | ^^^^^^^^^^ F401
+ | ^^^^^^^^^^
11 |
12 | # OK
|
- = help: Remove unused import: `.datastructures.UploadFile`
+help: Remove unused import: `.datastructures.UploadFile`
ℹ Safe fix
7 7 | from .background import BackgroundTasks
@@ -39,15 +41,16 @@ F401_6.py:10:43: F401 [*] `.datastructures.UploadFile` imported but unused
12 11 | # OK
13 12 | import applications as applications
-F401_6.py:16:8: F401 [*] `background` imported but unused
+F401 [*] `background` imported but unused
+ --> F401_6.py:16:8
|
15 | # F401 `background` imported but unused
16 | import background
- | ^^^^^^^^^^ F401
+ | ^^^^^^^^^^
17 |
18 | # F401 `datastructures` imported but unused
|
- = help: Remove unused import: `background`
+help: Remove unused import: `background`
ℹ Safe fix
13 13 | import applications as applications
@@ -58,13 +61,14 @@ F401_6.py:16:8: F401 [*] `background` imported but unused
18 17 | # F401 `datastructures` imported but unused
19 18 | import datastructures as structures
-F401_6.py:19:26: F401 [*] `datastructures` imported but unused
+F401 [*] `datastructures` imported but unused
+ --> F401_6.py:19:26
|
18 | # F401 `datastructures` imported but unused
19 | import datastructures as structures
- | ^^^^^^^^^^ F401
+ | ^^^^^^^^^^
|
- = help: Remove unused import: `datastructures`
+help: Remove unused import: `datastructures`
ℹ Safe fix
16 16 | import background
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap
index 0b27d19ff6..f269ad8657 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_7.py:30:5: F401 [*] `typing.Union` imported but unused
+F401 [*] `typing.Union` imported but unused
+ --> F401_7.py:30:5
|
28 | from typing import (
29 | Mapping, # noqa: F401
30 | Union,
- | ^^^^^ F401
+ | ^^^^^
31 | )
|
- = help: Remove unused import: `typing.Union`
+help: Remove unused import: `typing.Union`
ℹ Safe fix
27 27 | # This should ignore the first error.
@@ -23,13 +23,14 @@ F401_7.py:30:5: F401 [*] `typing.Union` imported but unused
33 32 | # This should ignore both errors.
34 33 | from typing import ( # noqa
-F401_7.py:66:20: F401 [*] `typing.Awaitable` imported but unused
+F401 [*] `typing.Awaitable` imported but unused
+ --> F401_7.py:66:20
|
65 | # This should mark F501 as unused.
66 | from typing import Awaitable, AwaitableGenerator # noqa: F501
- | ^^^^^^^^^ F401
+ | ^^^^^^^^^
|
- = help: Remove unused import
+help: Remove unused import
ℹ Safe fix
63 63 | from typing import AsyncIterable, AsyncGenerator # noqa
@@ -37,13 +38,14 @@ F401_7.py:66:20: F401 [*] `typing.Awaitable` imported but unused
65 65 | # This should mark F501 as unused.
66 |-from typing import Awaitable, AwaitableGenerator # noqa: F501
-F401_7.py:66:31: F401 [*] `typing.AwaitableGenerator` imported but unused
+F401 [*] `typing.AwaitableGenerator` imported but unused
+ --> F401_7.py:66:31
|
65 | # This should mark F501 as unused.
66 | from typing import Awaitable, AwaitableGenerator # noqa: F501
- | ^^^^^^^^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^^^^^^^^
|
- = help: Remove unused import
+help: Remove unused import
ℹ Safe fix
63 63 | from typing import AsyncIterable, AsyncGenerator # noqa
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap
index 5c8875f802..85c2ef1cc8 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_9.py:4:22: F401 [*] `foo.baz` imported but unused
+F401 [*] `foo.baz` imported but unused
+ --> F401_9.py:4:22
|
3 | __all__ = ("bar",)
4 | from foo import bar, baz
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `foo.baz`
+help: Remove unused import: `foo.baz`
ℹ Safe fix
1 1 | """Test: late-binding of `__all__`."""
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap
index 895939cdf6..62d0728c6f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 [*] `sys` imported but unused
+F401 [*] `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
ℹ Unsafe fix
16 16 | import argparse as argparse # Ok: is redundant alias
@@ -18,12 +18,13 @@ __init__.py:19:8: F401 [*] `sys` imported but unused
21 20 |
22 21 | # first-party
-__init__.py:33:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:33:15
|
33 | from . import unused # F401: change to redundant alias
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import: `.unused`
+help: Remove unused import: `.unused`
ℹ Unsafe fix
30 30 | from . import aliased as aliased # Ok: is redundant alias
@@ -34,12 +35,13 @@ __init__.py:33:15: F401 [*] `.unused` imported but unused; consider removing, ad
35 34 |
36 35 | from . import renamed as bees # F401: no fix
-__init__.py:36:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:26
|
36 | from . import renamed as bees # F401: no fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `.renamed`
+help: Remove unused import: `.renamed`
ℹ Unsafe fix
33 33 | from . import unused # F401: change to redundant alias
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap
index 419a8ae236..3be84f3e29 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 [*] `sys` imported but unused
+F401 [*] `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
ℹ Unsafe fix
16 16 | import argparse # Ok: is exported in __all__
@@ -18,12 +18,13 @@ __init__.py:19:8: F401 [*] `sys` imported but unused
21 20 |
22 21 | # first-party
-__init__.py:36:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:15
|
36 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import: `.unused`
+help: Remove unused import: `.unused`
ℹ Unsafe fix
33 33 | from . import exported # Ok: is exported in __all__
@@ -34,12 +35,13 @@ __init__.py:36:15: F401 [*] `.unused` imported but unused; consider removing, ad
38 37 |
39 38 | from . import renamed as bees # F401: add to __all__
-__init__.py:39:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:39:26
|
39 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `.renamed`
+help: Remove unused import: `.renamed`
ℹ Unsafe fix
36 36 | from . import unused # F401: add to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap
index 165f850183..52b04aa829 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import: `.unused`
+help: Remove unused import: `.unused`
ℹ Unsafe fix
2 2 | """
@@ -18,12 +18,13 @@ __init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, add
7 6 |
8 7 | from . import renamed as bees # F401: add to __all__
-__init__.py:8:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `.renamed`
+help: Remove unused import: `.renamed`
ℹ Unsafe fix
5 5 | from . import unused # F401: add to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap
index b20f2f1cf7..5308d3121e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: recommend add to all w/o fix
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import: `.unused`
+help: Remove unused import: `.unused`
ℹ Unsafe fix
2 2 | """
@@ -18,12 +18,13 @@ __init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, add
7 6 |
8 7 | from . import renamed as bees # F401: recommend add to all w/o fix
-__init__.py:8:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: recommend add to all w/o fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `.renamed`
+help: Remove unused import: `.renamed`
ℹ Unsafe fix
5 5 | from . import unused # F401: recommend add to all w/o fix
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap
index 6cde57d135..6f5291bb12 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Remove unused import
+help: Remove unused import
ℹ Unsafe fix
2 2 | """
@@ -18,12 +18,13 @@ __init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, add
7 6 |
8 7 | __all__ = [];
-__init__.py:5:34: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:34
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import
+help: Remove unused import
ℹ Unsafe fix
2 2 | """
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_29__all_conditional____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_29__all_conditional____init__.py.snap
index be576ca11c..8483e6b58f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_29__all_conditional____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_29__all_conditional____init__.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:8:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:15
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^^^ F401
+ | ^^^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
ℹ Unsafe fix
5 5 |
@@ -22,16 +23,17 @@ __init__.py:8:15: F401 [*] `.unused` imported but unused; consider removing, add
10 10 | if sys.version_info > (3, 9):
11 11 | from . import also_exported
-__init__.py:8:44: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:44
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^ F401
+ | ^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
ℹ Unsafe fix
5 5 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap
index f65dc78b59..09741b40a6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F401_30.py:6:19: F401 [*] `.main.MaμToMan` imported but unused
+F401 [*] `.main.MaμToMan` imported but unused
+ --> F401_30.py:6:19
|
4 | """
5 |
6 | from .main import MaµToMan
- | ^^^^^^^^ F401
+ | ^^^^^^^^
|
- = help: Remove unused import: `.main.MaμToMan`
+help: Remove unused import: `.main.MaμToMan`
ℹ Safe fix
3 3 | even if they have characters in them that undergo NFKC normalization
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap
index 52c0e6801f..e1c221c259 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 `sys` imported but unused
+F401 `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
-__init__.py:33:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:33:15
|
33 | from . import unused # F401: change to redundant alias
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Use an explicit re-export: `unused as unused`
+help: Use an explicit re-export: `unused as unused`
-__init__.py:36:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:26
|
36 | from . import renamed as bees # F401: no fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Use an explicit re-export: `renamed as renamed`
+help: Use an explicit re-export: `renamed as renamed`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap
index ccac7c81c5..778c49ba2d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 `sys` imported but unused
+F401 `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
-__init__.py:36:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:15
|
36 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
-__init__.py:39:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:39:26
|
39 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap
index c6f6913969..24e342c8ae 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
-__init__.py:8:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap
index 17856067e6..f74e91a35b 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: recommend add to all w/o fix
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
-__init__.py:8:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: recommend add to all w/o fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap
index 0ba97b9289..011604a75c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
-__init__.py:5:34: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:34
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_29__all_conditional____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_29__all_conditional____init__.py.snap
index 57c17bb0c5..3cc9d9eac6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_29__all_conditional____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_29__all_conditional____init__.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:8:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:15
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^^^ F401
+ | ^^^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
-__init__.py:8:44: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:44
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^ F401
+ | ^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.ipynb.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.ipynb.snap
index 3681a82bf4..f306dca43e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.ipynb.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.ipynb.snap
@@ -1,22 +1,23 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F402.ipynb:3:5: F402 Import `os` from cell 1, line 1 shadowed by loop variable
+F402 Import `os` from cell 1, line 1 shadowed by loop variable
+ --> F402.ipynb:3:5
|
1 | import os
2 | import os.path as path
3 | for os in range(3):
- | ^^ F402
+ | ^^
4 | pass
5 | for path in range(3):
|
-F402.ipynb:5:5: F402 Import `path` from cell 1, line 2 shadowed by loop variable
+F402 Import `path` from cell 1, line 2 shadowed by loop variable
+ --> F402.ipynb:5:5
|
3 | for os in range(3):
4 | pass
5 | for path in range(3):
- | ^^^^ F402
+ | ^^^^
6 | pass
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.py.snap
index b6c04ece22..e077b7ad40 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F402_F402.py.snap
@@ -1,18 +1,20 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F402.py:5:5: F402 Import `os` from line 1 shadowed by loop variable
+F402 Import `os` from line 1 shadowed by loop variable
+ --> F402.py:5:5
|
5 | for os in range(3):
- | ^^ F402
+ | ^^
6 | pass
|
-F402.py:8:5: F402 Import `path` from line 2 shadowed by loop variable
+F402 Import `path` from line 2 shadowed by loop variable
+ --> F402.py:8:5
|
6 | pass
7 |
8 | for path in range(3):
- | ^^^^ F402
+ | ^^^^
9 | pass
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F403_F403.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F403_F403.py.snap
index 954899e12a..a990db7a60 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F403_F403.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F403_F403.py.snap
@@ -1,18 +1,20 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F403.py:1:1: F403 `from F634 import *` used; unable to detect undefined names
+F403 `from F634 import *` used; unable to detect undefined names
+ --> F403.py:1:1
|
1 | from F634 import *
- | ^^^^^^^^^^^^^^^^^^ F403
+ | ^^^^^^^^^^^^^^^^^^
2 | from F634 import * # noqa: E501
|
-F403.py:2:1: F403 `from F634 import *` used; unable to detect undefined names
+F403 `from F634 import *` used; unable to detect undefined names
+ --> F403.py:2:1
|
1 | from F634 import *
2 | from F634 import * # noqa: E501
- | ^^^^^^^^^^^^^^^^^^ F403
+ | ^^^^^^^^^^^^^^^^^^
3 |
4 | from F634 import * # noqa
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_0.py.snap
index 0e5776e9b3..aa61d93701 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_0.py.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F404_0.py:6:1: F404 `from __future__` imports must occur at the beginning of the file
+F404 `from __future__` imports must occur at the beginning of the file
+ --> F404_0.py:6:1
|
4 | from collections import namedtuple
5 |
6 | from __future__ import print_function
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 |
8 | import __future__
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap
index 533b95b9a7..af21b5f916 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F404_1.py:5:1: F404 `from __future__` imports must occur at the beginning of the file
+F404 `from __future__` imports must occur at the beginning of the file
+ --> F404_1.py:5:1
|
3 | """Non-docstring"""
4 |
5 | from __future__ import absolute_import
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F404
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap
index 566ebc15bb..382d83dce7 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap
@@ -1,17 +1,19 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F405.py:5:11: F405 `name` may be undefined, or defined from star imports
+F405 `name` may be undefined, or defined from star imports
+ --> F405.py:5:11
|
4 | def print_name():
5 | print(name)
- | ^^^^ F405
+ | ^^^^
|
-F405.py:11:12: F405 `a` may be undefined, or defined from star imports
+F405 `a` may be undefined, or defined from star imports
+ --> F405.py:11:12
|
9 | print(name)
10 |
11 | __all__ = ['a']
- | ^^^ F405
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap
index 4b7e774e13..e09f491710 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F406.py:5:5: F406 `from F634 import *` only allowed at module level
+F406 `from F634 import *` only allowed at module level
+ --> F406.py:5:5
|
4 | def f():
5 | from F634 import *
- | ^^^^^^^^^^^^^^^^^^ F406
+ | ^^^^^^^^^^^^^^^^^^
|
-F406.py:9:5: F406 `from F634 import *` only allowed at module level
+F406 `from F634 import *` only allowed at module level
+ --> F406.py:9:5
|
8 | class F:
9 | from F634 import *
- | ^^^^^^^^^^^^^^^^^^ F406
+ | ^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap
index faf0e89f01..8354bd9884 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F407.py:2:24: F407 Future feature `non_existent_feature` is not defined
+F407 Future feature `non_existent_feature` is not defined
+ --> F407.py:2:24
|
1 | from __future__ import print_function
2 | from __future__ import non_existent_feature
- | ^^^^^^^^^^^^^^^^^^^^ F407
+ | ^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F501_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F501_F50x.py.snap
index e08ce6e14b..b91dc6a2a6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F501_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F501_F50x.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:1:1: F501 `%`-format string has invalid format string: incomplete format
+F501 `%`-format string has invalid format string: incomplete format
+ --> F50x.py:1:1
|
1 | '%(foo)' % {'foo': 'bar'} # F501
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ F501
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
2 | '%s %(foo)s' % {'foo': 'bar'} # F506
3 | '%(foo)s %s' % {'foo': 'bar'} # F506
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap
index be81d392b1..25dc86c080 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap
@@ -1,70 +1,76 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F502.py:6:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:6:1
|
4 | "%(bob)s" % {"bob": "bob"}
5 | "%(bob)s" % {**{"bob": "bob"}}
6 | "%(bob)s" % ["bob"] # F202
- | ^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^
7 | "%(bob)s" % ("bob",) # F202
8 | "%(bob)s" % {"bob"} # F202
|
-F502.py:7:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:7:1
|
5 | "%(bob)s" % {**{"bob": "bob"}}
6 | "%(bob)s" % ["bob"] # F202
7 | "%(bob)s" % ("bob",) # F202
- | ^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^
8 | "%(bob)s" % {"bob"} # F202
9 | "%(bob)s" % [*["bob"]] # F202
|
-F502.py:8:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:8:1
|
6 | "%(bob)s" % ["bob"] # F202
7 | "%(bob)s" % ("bob",) # F202
8 | "%(bob)s" % {"bob"} # F202
- | ^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^
9 | "%(bob)s" % [*["bob"]] # F202
10 | "%(bob)s" % {"bob": "bob" for _ in range(1)}
|
-F502.py:9:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:9:1
|
7 | "%(bob)s" % ("bob",) # F202
8 | "%(bob)s" % {"bob"} # F202
9 | "%(bob)s" % [*["bob"]] # F202
- | ^^^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^^^
10 | "%(bob)s" % {"bob": "bob" for _ in range(1)}
11 | "%(bob)s" % ["bob" for _ in range(1)] # F202
|
-F502.py:11:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:11:1
|
9 | "%(bob)s" % [*["bob"]] # F202
10 | "%(bob)s" % {"bob": "bob" for _ in range(1)}
11 | "%(bob)s" % ["bob" for _ in range(1)] # F202
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | "%(bob)s" % ("bob" for _ in range(1)) # F202
13 | "%(bob)s" % {"bob" for _ in range(1)} # F202
|
-F502.py:12:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:12:1
|
10 | "%(bob)s" % {"bob": "bob" for _ in range(1)}
11 | "%(bob)s" % ["bob" for _ in range(1)] # F202
12 | "%(bob)s" % ("bob" for _ in range(1)) # F202
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 | "%(bob)s" % {"bob" for _ in range(1)} # F202
|
-F502.py:13:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F502.py:13:1
|
11 | "%(bob)s" % ["bob" for _ in range(1)] # F202
12 | "%(bob)s" % ("bob" for _ in range(1)) # F202
13 | "%(bob)s" % {"bob" for _ in range(1)} # F202
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F50x.py.snap
index d95359d029..a80ee33ccd 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F50x.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:9:1: F502 `%`-format string expected mapping but got sequence
+F502 `%`-format string expected mapping but got sequence
+ --> F50x.py:9:1
|
7 | '%(bar)s' % {} # F505
8 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504
9 | '%(bar)s' % (1, 2, 3) # F502
- | ^^^^^^^^^^^^^^^^^^^^^ F502
+ | ^^^^^^^^^^^^^^^^^^^^^
10 | '%s %s' % {'k': 'v'} # F503
11 | '%(bar)*s' % {'bar': 'baz'} # F506, F508
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F503.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F503.py.snap
index f143255f41..2b42a94777 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F503.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F503.py.snap
@@ -1,33 +1,35 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F503.py:17:1: F503 `%`-format string expected sequence but got mapping
+F503 `%`-format string expected sequence but got mapping
+ --> F503.py:17:1
|
15 | # Multiple placeholders
16 | "%s %s" % dog
17 | "%s %s" % {"bob": "bob"} # F503
- | ^^^^^^^^^^^^^^^^^^^^^^^^ F503
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
18 | "%s %s" % {**{"bob": "bob"}} # F503
19 | "%s %s" % ["bob"]
|
-F503.py:18:1: F503 `%`-format string expected sequence but got mapping
+F503 `%`-format string expected sequence but got mapping
+ --> F503.py:18:1
|
16 | "%s %s" % dog
17 | "%s %s" % {"bob": "bob"} # F503
18 | "%s %s" % {**{"bob": "bob"}} # F503
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F503
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 | "%s %s" % ["bob"]
20 | "%s %s" % ("bob",)
|
-F503.py:23:1: F503 `%`-format string expected sequence but got mapping
+F503 `%`-format string expected sequence but got mapping
+ --> F503.py:23:1
|
21 | "%s %s" % {"bob"}
22 | "%s %s" % [*["bob"]]
23 | "%s %s" % {"bob": "bob" for _ in range(1)} # F503
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F503
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | "%s %s" % ["bob" for _ in range(1)]
25 | "%s %s" % ("bob" for _ in range(1))
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F50x.py.snap
index a09a97f4a5..9bca2287bc 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F503_F50x.py.snap
@@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:10:1: F503 `%`-format string expected sequence but got mapping
+F503 `%`-format string expected sequence but got mapping
+ --> F50x.py:10:1
|
8 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504
9 | '%(bar)s' % (1, 2, 3) # F502
10 | '%s %s' % {'k': 'v'} # F503
- | ^^^^^^^^^^^^^^^^^^^^ F503
+ | ^^^^^^^^^^^^^^^^^^^^
11 | '%(bar)*s' % {'bar': 'baz'} # F506, F508
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap
index 175af6e93b..e12ae328c0 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F504.py:3:1: F504 [*] `%`-format string has unused named argument(s): b
+F504 [*] `%`-format string has unused named argument(s): b
+ --> F504.py:3:1
|
1 | # Ruff has no way of knowing if the following are F505s
2 | a = "wrong"
3 | "%(a)s %(c)s" % {a: "?", "b": "!"} # F504 ("b" not used)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | hidden = {"a": "!"}
|
- = help: Remove extra named arguments: b
+help: Remove extra named arguments: b
ℹ Safe fix
1 1 | # Ruff has no way of knowing if the following are F505s
@@ -21,15 +22,16 @@ F504.py:3:1: F504 [*] `%`-format string has unused named argument(s): b
5 5 | hidden = {"a": "!"}
6 6 | "%(a)s %(c)s" % {"x": 1, **hidden} # Ok (cannot see through splat)
-F504.py:8:1: F504 [*] `%`-format string has unused named argument(s): b
+F504 [*] `%`-format string has unused named argument(s): b
+ --> F504.py:8:1
|
6 | "%(a)s %(c)s" % {"x": 1, **hidden} # Ok (cannot see through splat)
7 |
8 | "%(a)s" % {"a": 1, r"b": "!"} # F504 ("b" not used)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | "%(a)s" % {'a': 1, u"b": "!"} # F504 ("b" not used)
|
- = help: Remove extra named arguments: b
+help: Remove extra named arguments: b
ℹ Safe fix
5 5 | hidden = {"a": "!"}
@@ -41,15 +43,16 @@ F504.py:8:1: F504 [*] `%`-format string has unused named argument(s): b
10 10 |
11 11 | '' % {'a''b' : ''} # F504 ("ab" not used)
-F504.py:9:1: F504 [*] `%`-format string has unused named argument(s): b
+F504 [*] `%`-format string has unused named argument(s): b
+ --> F504.py:9:1
|
8 | "%(a)s" % {"a": 1, r"b": "!"} # F504 ("b" not used)
9 | "%(a)s" % {'a': 1, u"b": "!"} # F504 ("b" not used)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |
11 | '' % {'a''b' : ''} # F504 ("ab" not used)
|
- = help: Remove extra named arguments: b
+help: Remove extra named arguments: b
ℹ Safe fix
6 6 | "%(a)s %(c)s" % {"x": 1, **hidden} # Ok (cannot see through splat)
@@ -61,16 +64,17 @@ F504.py:9:1: F504 [*] `%`-format string has unused named argument(s): b
11 11 | '' % {'a''b' : ''} # F504 ("ab" not used)
12 12 |
-F504.py:11:1: F504 [*] `%`-format string has unused named argument(s): ab
+F504 [*] `%`-format string has unused named argument(s): ab
+ --> F504.py:11:1
|
9 | "%(a)s" % {'a': 1, u"b": "!"} # F504 ("b" not used)
10 |
11 | '' % {'a''b' : ''} # F504 ("ab" not used)
- | ^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^
12 |
13 | # https://github.com/astral-sh/ruff/issues/4899
|
- = help: Remove extra named arguments: ab
+help: Remove extra named arguments: ab
ℹ Safe fix
8 8 | "%(a)s" % {"a": 1, r"b": "!"} # F504 ("b" not used)
@@ -82,17 +86,19 @@ F504.py:11:1: F504 [*] `%`-format string has unused named argument(s): ab
13 13 | # https://github.com/astral-sh/ruff/issues/4899
14 14 | "" % {
-F504.py:14:1: F504 [*] `%`-format string has unused named argument(s): test1, test2
+F504 [*] `%`-format string has unused named argument(s): test1, test2
+ --> F504.py:14:1
|
13 | # https://github.com/astral-sh/ruff/issues/4899
14 | / "" % {
-15 | | 'test1': '',
'test2': '',
-16 | | }
- | |_^ F504
-17 |
-18 | # https://github.com/astral-sh/ruff/issues/18806
+15 | | 'test1': '',
+16 | | 'test2': '',
+17 | | }
+ | |_^
+18 |
+19 | # https://github.com/astral-sh/ruff/issues/18806
|
- = help: Remove extra named arguments: test1, test2
+help: Remove extra named arguments: test1, test2
ℹ Safe fix
12 12 |
@@ -104,13 +110,14 @@ F504.py:14:1: F504 [*] `%`-format string has unused named argument(s): test1, te
18 17 |
19 18 | # https://github.com/astral-sh/ruff/issues/18806
-F504.py:20:1: F504 [*] `%`-format string has unused named argument(s): greeting
+F504 [*] `%`-format string has unused named argument(s): greeting
+ --> F504.py:20:1
|
19 | # https://github.com/astral-sh/ruff/issues/18806
20 | "Hello, %(name)s" % {"greeting": print(1), "name": "World"}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove extra named arguments: greeting
+help: Remove extra named arguments: greeting
ℹ Unsafe fix
17 17 | }
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F50x.py.snap
index 9aeabf5636..a20aace19c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F50x.py.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:8:1: F504 [*] `%`-format string has unused named argument(s): baz
+F504 [*] `%`-format string has unused named argument(s): baz
+ --> F50x.py:8:1
|
6 | '%s %s' % (1, 2, 3) # F507
7 | '%(bar)s' % {} # F505
8 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | '%(bar)s' % (1, 2, 3) # F502
10 | '%s %s' % {'k': 'v'} # F503
|
- = help: Remove extra named arguments: baz
+help: Remove extra named arguments: baz
ℹ Safe fix
5 5 | '%s %s' % (1,) # F507
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F505_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F505_F50x.py.snap
index af45048c88..89bd0a6076 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F505_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F505_F50x.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:7:1: F505 `%`-format string is missing argument(s) for placeholder(s): bar
+F505 `%`-format string is missing argument(s) for placeholder(s): bar
+ --> F50x.py:7:1
|
5 | '%s %s' % (1,) # F507
6 | '%s %s' % (1, 2, 3) # F507
7 | '%(bar)s' % {} # F505
- | ^^^^^^^^^^^^^^ F505
+ | ^^^^^^^^^^^^^^
8 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504
9 | '%(bar)s' % (1, 2, 3) # F502
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F506_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F506_F50x.py.snap
index 8014d22098..3f3ee5f0ba 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F506_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F506_F50x.py.snap
@@ -1,31 +1,34 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F50x.py:2:1: F506 `%`-format string has mixed positional and named placeholders
+F506 `%`-format string has mixed positional and named placeholders
+ --> F50x.py:2:1
|
1 | '%(foo)' % {'foo': 'bar'} # F501
2 | '%s %(foo)s' % {'foo': 'bar'} # F506
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F506
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | '%(foo)s %s' % {'foo': 'bar'} # F506
4 | '%j' % (1,) # F509
|
-F50x.py:3:1: F506 `%`-format string has mixed positional and named placeholders
+F506 `%`-format string has mixed positional and named placeholders
+ --> F50x.py:3:1
|
1 | '%(foo)' % {'foo': 'bar'} # F501
2 | '%s %(foo)s' % {'foo': 'bar'} # F506
3 | '%(foo)s %s' % {'foo': 'bar'} # F506
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F506
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | '%j' % (1,) # F509
5 | '%s %s' % (1,) # F507
|
-F50x.py:11:1: F506 `%`-format string has mixed positional and named placeholders
+F506 `%`-format string has mixed positional and named placeholders
+ --> F50x.py:11:1
|
9 | '%(bar)s' % (1, 2, 3) # F502
10 | '%s %s' % {'k': 'v'} # F503
11 | '%(bar)*s' % {'bar': 'baz'} # F506, F508
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ F506
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 |
13 | # ok: single %s with mapping
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F507_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F507_F50x.py.snap
index 6b7efd75fe..6528dd1901 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F507_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F507_F50x.py.snap
@@ -1,23 +1,24 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:5:1: F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
+F507 `%`-format string has 2 placeholder(s) but 1 substitution(s)
+ --> F50x.py:5:1
|
3 | '%(foo)s %s' % {'foo': 'bar'} # F506
4 | '%j' % (1,) # F509
5 | '%s %s' % (1,) # F507
- | ^^^^^^^^^^^^^^ F507
+ | ^^^^^^^^^^^^^^
6 | '%s %s' % (1, 2, 3) # F507
7 | '%(bar)s' % {} # F505
|
-F50x.py:6:1: F507 `%`-format string has 2 placeholder(s) but 3 substitution(s)
+F507 `%`-format string has 2 placeholder(s) but 3 substitution(s)
+ --> F50x.py:6:1
|
4 | '%j' % (1,) # F509
5 | '%s %s' % (1,) # F507
6 | '%s %s' % (1, 2, 3) # F507
- | ^^^^^^^^^^^^^^^^^^^ F507
+ | ^^^^^^^^^^^^^^^^^^^
7 | '%(bar)s' % {} # F505
8 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F508_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F508_F50x.py.snap
index b441512343..a15979f5b0 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F508_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F508_F50x.py.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F50x.py:11:1: F508 `%`-format string `*` specifier requires sequence
+F508 `%`-format string `*` specifier requires sequence
+ --> F50x.py:11:1
|
9 | '%(bar)s' % (1, 2, 3) # F502
10 | '%s %s' % {'k': 'v'} # F503
11 | '%(bar)*s' % {'bar': 'baz'} # F506, F508
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ F508
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 |
13 | # ok: single %s with mapping
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F509_F50x.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F509_F50x.py.snap
index fa405f0915..e3e36bd11e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F509_F50x.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F509_F50x.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F50x.py:4:1: F509 `%`-format string has unsupported format character `j`
+F509 `%`-format string has unsupported format character `j`
+ --> F50x.py:4:1
|
2 | '%s %(foo)s' % {'foo': 'bar'} # F506
3 | '%(foo)s %s' % {'foo': 'bar'} # F506
4 | '%j' % (1,) # F509
- | ^^^^^^^^^^^ F509
+ | ^^^^^^^^^^^
5 | '%s %s' % (1,) # F507
6 | '%s %s' % (1, 2, 3) # F507
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F521_F521.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F521_F521.py.snap
index c9f840f58a..6a61cb53a4 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F521_F521.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F521_F521.py.snap
@@ -1,68 +1,75 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F521.py:1:1: F521 `.format` call has invalid format string: Single '{' encountered in format string
+F521 `.format` call has invalid format string: Single '{' encountered in format string
+ --> F521.py:1:1
|
1 | "{".format(1)
- | ^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^
2 | "}".format(1)
3 | "{foo[}".format(foo=1)
|
-F521.py:2:1: F521 `.format` call has invalid format string: Single '}' encountered in format string
+F521 `.format` call has invalid format string: Single '}' encountered in format string
+ --> F521.py:2:1
|
1 | "{".format(1)
2 | "}".format(1)
- | ^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^
3 | "{foo[}".format(foo=1)
4 | # too much string recursion (placeholder-in-placeholder)
|
-F521.py:3:1: F521 `.format` call has invalid format string: Expected '}' before end of string
+F521 `.format` call has invalid format string: Expected '}' before end of string
+ --> F521.py:3:1
|
1 | "{".format(1)
2 | "}".format(1)
3 | "{foo[}".format(foo=1)
- | ^^^^^^^^^^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^^^^^^^^^^
4 | # too much string recursion (placeholder-in-placeholder)
5 | "{:{:{}}}".format(1, 2, 3)
|
-F521.py:5:1: F521 `.format` call has invalid format string: Max format placeholder recursion exceeded
+F521 `.format` call has invalid format string: Max format placeholder recursion exceeded
+ --> F521.py:5:1
|
3 | "{foo[}".format(foo=1)
4 | # too much string recursion (placeholder-in-placeholder)
5 | "{:{:{}}}".format(1, 2, 3)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | # ruff picks these issues up, but flake8 doesn't
7 | "{foo[]}".format(foo={"": 1})
|
-F521.py:7:1: F521 `.format` call has invalid format string: Empty attribute in format string
+F521 `.format` call has invalid format string: Empty attribute in format string
+ --> F521.py:7:1
|
5 | "{:{:{}}}".format(1, 2, 3)
6 | # ruff picks these issues up, but flake8 doesn't
7 | "{foo[]}".format(foo={"": 1})
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | "{foo..}".format(foo=1)
9 | "{foo..bar}".format(foo=1)
|
-F521.py:8:1: F521 `.format` call has invalid format string: Empty attribute in format string
+F521 `.format` call has invalid format string: Empty attribute in format string
+ --> F521.py:8:1
|
6 | # ruff picks these issues up, but flake8 doesn't
7 | "{foo[]}".format(foo={"": 1})
8 | "{foo..}".format(foo=1)
- | ^^^^^^^^^^^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^^^^^^^^^^^
9 | "{foo..bar}".format(foo=1)
|
-F521.py:9:1: F521 `.format` call has invalid format string: Empty attribute in format string
+F521 `.format` call has invalid format string: Empty attribute in format string
+ --> F521.py:9:1
|
7 | "{foo[]}".format(foo={"": 1})
8 | "{foo..}".format(foo=1)
9 | "{foo..bar}".format(foo=1)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ F521
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |
11 | # The following are all "good" uses of .format
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap
index f6a9f22629..e3cd10e673 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F522.py:1:1: F522 [*] `.format` call has unused named argument(s): bar
+F522 [*] `.format` call has unused named argument(s): bar
+ --> F522.py:1:1
|
1 | "{}".format(1, bar=2) # F522
- | ^^^^^^^^^^^^^^^^^^^^^ F522
+ | ^^^^^^^^^^^^^^^^^^^^^
2 | "{bar}{}".format(1, bar=2, spam=3) # F522
3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
|
- = help: Remove extra named arguments: bar
+help: Remove extra named arguments: bar
ℹ Safe fix
1 |-"{}".format(1, bar=2) # F522
@@ -17,15 +18,16 @@ F522.py:1:1: F522 [*] `.format` call has unused named argument(s): bar
3 3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
4 4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522
-F522.py:2:1: F522 [*] `.format` call has unused named argument(s): spam
+F522 [*] `.format` call has unused named argument(s): spam
+ --> F522.py:2:1
|
1 | "{}".format(1, bar=2) # F522
2 | "{bar}{}".format(1, bar=2, spam=3) # F522
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F522
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522
|
- = help: Remove extra named arguments: spam
+help: Remove extra named arguments: spam
ℹ Safe fix
1 1 | "{}".format(1, bar=2) # F522
@@ -35,16 +37,17 @@ F522.py:2:1: F522 [*] `.format` call has unused named argument(s): spam
4 4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522
5 5 | (''
-F522.py:4:1: F522 [*] `.format` call has unused named argument(s): eggs, ham
+F522 [*] `.format` call has unused named argument(s): eggs, ham
+ --> F522.py:4:1
|
2 | "{bar}{}".format(1, bar=2, spam=3) # F522
3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F522
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | (''
6 | .format(x=2)) # F522
|
- = help: Remove extra named arguments: eggs, ham
+help: Remove extra named arguments: eggs, ham
ℹ Safe fix
1 1 | "{}".format(1, bar=2) # F522
@@ -56,18 +59,19 @@ F522.py:4:1: F522 [*] `.format` call has unused named argument(s): eggs, ham
6 6 | .format(x=2)) # F522
7 7 |
-F522.py:5:2: F522 [*] `.format` call has unused named argument(s): x
+F522 [*] `.format` call has unused named argument(s): x
+ --> F522.py:5:2
|
3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522
5 | (''
| __^
6 | | .format(x=2)) # F522
- | |_____________^ F522
+ | |_____________^
7 |
8 | # https://github.com/astral-sh/ruff/issues/18806
|
- = help: Remove extra named arguments: x
+help: Remove extra named arguments: x
ℹ Safe fix
3 3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues
@@ -79,16 +83,17 @@ F522.py:5:2: F522 [*] `.format` call has unused named argument(s): x
8 8 | # https://github.com/astral-sh/ruff/issues/18806
9 9 | # The fix here is unsafe because the unused argument has side effect
-F522.py:10:1: F522 [*] `.format` call has unused named argument(s): greeting
+F522 [*] `.format` call has unused named argument(s): greeting
+ --> F522.py:10:1
|
8 | # https://github.com/astral-sh/ruff/issues/18806
9 | # The fix here is unsafe because the unused argument has side effect
10 | "Hello, {name}".format(greeting=print(1), name="World")
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F522
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | # The fix here is safe because the unused argument has no side effect,
|
- = help: Remove extra named arguments: greeting
+help: Remove extra named arguments: greeting
ℹ Unsafe fix
7 7 |
@@ -100,14 +105,15 @@ F522.py:10:1: F522 [*] `.format` call has unused named argument(s): greeting
12 12 | # The fix here is safe because the unused argument has no side effect,
13 13 | # even though the used argument has a side effect
-F522.py:14:1: F522 [*] `.format` call has unused named argument(s): greeting
+F522 [*] `.format` call has unused named argument(s): greeting
+ --> F522.py:14:1
|
12 | # The fix here is safe because the unused argument has no side effect,
13 | # even though the used argument has a side effect
14 | "Hello, {name}".format(greeting="Pikachu", name=print(1))
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F522
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove extra named arguments: greeting
+help: Remove extra named arguments: greeting
ℹ Safe fix
11 11 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap
index 373bf431e6..73bff9f750 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F523.py:2:1: F523 [*] `.format` call has unused arguments at position(s): 1
+F523 [*] `.format` call has unused arguments at position(s): 1
+ --> F523.py:2:1
|
1 | # With indexes
2 | "{0}".format(1, 2) # F523
- | ^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^
3 | "{1}".format(1, 2, 3) # F523
4 | "{1:{0}}".format(1, 2) # No issues
|
- = help: Remove extra positional arguments at position(s): 1
+help: Remove extra positional arguments at position(s): 1
ℹ Safe fix
1 1 | # With indexes
@@ -19,27 +20,29 @@ F523.py:2:1: F523 [*] `.format` call has unused arguments at position(s): 1
4 4 | "{1:{0}}".format(1, 2) # No issues
5 5 | "{1:{0}}".format(1, 2, 3) # F523
-F523.py:3:1: F523 `.format` call has unused arguments at position(s): 0, 2
+F523 `.format` call has unused arguments at position(s): 0, 2
+ --> F523.py:3:1
|
1 | # With indexes
2 | "{0}".format(1, 2) # F523
3 | "{1}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^
4 | "{1:{0}}".format(1, 2) # No issues
5 | "{1:{0}}".format(1, 2, 3) # F523
|
- = help: Remove extra positional arguments at position(s): 0, 2
+help: Remove extra positional arguments at position(s): 0, 2
-F523.py:5:1: F523 [*] `.format` call has unused arguments at position(s): 2
+F523 [*] `.format` call has unused arguments at position(s): 2
+ --> F523.py:5:1
|
3 | "{1}".format(1, 2, 3) # F523
4 | "{1:{0}}".format(1, 2) # No issues
5 | "{1:{0}}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
6 | "{0}{2}".format(1, 2) # F523, # F524
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
|
- = help: Remove extra positional arguments at position(s): 2
+help: Remove extra positional arguments at position(s): 2
ℹ Safe fix
2 2 | "{0}".format(1, 2) # F523
@@ -51,15 +54,16 @@ F523.py:5:1: F523 [*] `.format` call has unused arguments at position(s): 2
7 7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
8 8 |
-F523.py:6:1: F523 [*] `.format` call has unused arguments at position(s): 1
+F523 [*] `.format` call has unused arguments at position(s): 1
+ --> F523.py:6:1
|
4 | "{1:{0}}".format(1, 2) # No issues
5 | "{1:{0}}".format(1, 2, 3) # F523
6 | "{0}{2}".format(1, 2) # F523, # F524
- | ^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
|
- = help: Remove extra positional arguments at position(s): 1
+help: Remove extra positional arguments at position(s): 1
ℹ Safe fix
3 3 | "{1}".format(1, 2, 3) # F523
@@ -71,26 +75,28 @@ F523.py:6:1: F523 [*] `.format` call has unused arguments at position(s): 1
8 8 |
9 9 | # With no indexes
-F523.py:7:1: F523 `.format` call has unused arguments at position(s): 0, 3
+F523 `.format` call has unused arguments at position(s): 0, 3
+ --> F523.py:7:1
|
5 | "{1:{0}}".format(1, 2, 3) # F523
6 | "{0}{2}".format(1, 2) # F523, # F524
7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 | # With no indexes
|
- = help: Remove extra positional arguments at position(s): 0, 3
+help: Remove extra positional arguments at position(s): 0, 3
-F523.py:10:1: F523 [*] `.format` call has unused arguments at position(s): 1
+F523 [*] `.format` call has unused arguments at position(s): 1
+ --> F523.py:10:1
|
9 | # With no indexes
10 | "{}".format(1, 2) # F523
- | ^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^
11 | "{}".format(1, 2, 3) # F523
12 | "{:{}}".format(1, 2) # No issues
|
- = help: Remove extra positional arguments at position(s): 1
+help: Remove extra positional arguments at position(s): 1
ℹ Safe fix
7 7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523
@@ -102,16 +108,17 @@ F523.py:10:1: F523 [*] `.format` call has unused arguments at position(s): 1
12 12 | "{:{}}".format(1, 2) # No issues
13 13 | "{:{}}".format(1, 2, 3) # F523
-F523.py:11:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2
+F523 [*] `.format` call has unused arguments at position(s): 1, 2
+ --> F523.py:11:1
|
9 | # With no indexes
10 | "{}".format(1, 2) # F523
11 | "{}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^
12 | "{:{}}".format(1, 2) # No issues
13 | "{:{}}".format(1, 2, 3) # F523
|
- = help: Remove extra positional arguments at position(s): 1, 2
+help: Remove extra positional arguments at position(s): 1, 2
ℹ Safe fix
8 8 |
@@ -123,16 +130,17 @@ F523.py:11:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2
13 13 | "{:{}}".format(1, 2, 3) # F523
14 14 |
-F523.py:13:1: F523 [*] `.format` call has unused arguments at position(s): 2
+F523 [*] `.format` call has unused arguments at position(s): 2
+ --> F523.py:13:1
|
11 | "{}".format(1, 2, 3) # F523
12 | "{:{}}".format(1, 2) # No issues
13 | "{:{}}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 | # With *args
|
- = help: Remove extra positional arguments at position(s): 2
+help: Remove extra positional arguments at position(s): 2
ℹ Safe fix
10 10 | "{}".format(1, 2) # F523
@@ -144,26 +152,28 @@ F523.py:13:1: F523 [*] `.format` call has unused arguments at position(s): 2
15 15 | # With *args
16 16 | "{0}{1}".format(*args) # No issues
-F523.py:19:1: F523 `.format` call has unused arguments at position(s): 2
+F523 `.format` call has unused arguments at position(s): 2
+ --> F523.py:19:1
|
17 | "{0}{1}".format(1, *args) # No issues
18 | "{0}{1}".format(1, 2, *args) # No issues
19 | "{0}{1}".format(1, 2, 3, *args) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 |
21 | # With nested quotes
|
- = help: Remove extra positional arguments at position(s): 2
+help: Remove extra positional arguments at position(s): 2
-F523.py:22:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2
+F523 [*] `.format` call has unused arguments at position(s): 1, 2
+ --> F523.py:22:1
|
21 | # With nested quotes
22 | "''1{0}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
23 | "\"\"{1}{0}".format(1, 2, 3) # F523
24 | '""{1}{0}'.format(1, 2, 3) # F523
|
- = help: Remove extra positional arguments at position(s): 1, 2
+help: Remove extra positional arguments at position(s): 1, 2
ℹ Safe fix
19 19 | "{0}{1}".format(1, 2, 3, *args) # F523
@@ -175,15 +185,16 @@ F523.py:22:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2
24 24 | '""{1}{0}'.format(1, 2, 3) # F523
25 25 |
-F523.py:23:1: F523 [*] `.format` call has unused arguments at position(s): 2
+F523 [*] `.format` call has unused arguments at position(s): 2
+ --> F523.py:23:1
|
21 | # With nested quotes
22 | "''1{0}".format(1, 2, 3) # F523
23 | "\"\"{1}{0}".format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | '""{1}{0}'.format(1, 2, 3) # F523
|
- = help: Remove extra positional arguments at position(s): 2
+help: Remove extra positional arguments at position(s): 2
ℹ Safe fix
20 20 |
@@ -195,16 +206,17 @@ F523.py:23:1: F523 [*] `.format` call has unused arguments at position(s): 2
25 25 |
26 26 | # With modified indexes
-F523.py:24:1: F523 [*] `.format` call has unused arguments at position(s): 2
+F523 [*] `.format` call has unused arguments at position(s): 2
+ --> F523.py:24:1
|
22 | "''1{0}".format(1, 2, 3) # F523
23 | "\"\"{1}{0}".format(1, 2, 3) # F523
24 | '""{1}{0}'.format(1, 2, 3) # F523
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
25 |
26 | # With modified indexes
|
- = help: Remove extra positional arguments at position(s): 2
+help: Remove extra positional arguments at position(s): 2
ℹ Safe fix
21 21 | # With nested quotes
@@ -216,48 +228,52 @@ F523.py:24:1: F523 [*] `.format` call has unused arguments at position(s): 2
26 26 | # With modified indexes
27 27 | "{1}{2}".format(1, 2, 3) # F523, # F524
-F523.py:27:1: F523 `.format` call has unused arguments at position(s): 0
+F523 `.format` call has unused arguments at position(s): 0
+ --> F523.py:27:1
|
26 | # With modified indexes
27 | "{1}{2}".format(1, 2, 3) # F523, # F524
- | ^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
28 | "{1}{3}".format(1, 2, 3, 4) # F523, # F524
29 | "{1} {8}".format(0, 1) # F523, # F524
|
- = help: Remove extra positional arguments at position(s): 0
+help: Remove extra positional arguments at position(s): 0
-F523.py:28:1: F523 `.format` call has unused arguments at position(s): 0, 2
+F523 `.format` call has unused arguments at position(s): 0, 2
+ --> F523.py:28:1
|
26 | # With modified indexes
27 | "{1}{2}".format(1, 2, 3) # F523, # F524
28 | "{1}{3}".format(1, 2, 3, 4) # F523, # F524
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | "{1} {8}".format(0, 1) # F523, # F524
|
- = help: Remove extra positional arguments at position(s): 0, 2
+help: Remove extra positional arguments at position(s): 0, 2
-F523.py:29:1: F523 `.format` call has unused arguments at position(s): 0
+F523 `.format` call has unused arguments at position(s): 0
+ --> F523.py:29:1
|
27 | "{1}{2}".format(1, 2, 3) # F523, # F524
28 | "{1}{3}".format(1, 2, 3, 4) # F523, # F524
29 | "{1} {8}".format(0, 1) # F523, # F524
- | ^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^
30 |
31 | # Multiline
|
- = help: Remove extra positional arguments at position(s): 0
+help: Remove extra positional arguments at position(s): 0
-F523.py:32:2: F523 [*] `.format` call has unused arguments at position(s): 0
+F523 [*] `.format` call has unused arguments at position(s): 0
+ --> F523.py:32:2
|
31 | # Multiline
32 | (''
| __^
33 | | .format(2))
- | |__________^ F523
+ | |__________^
34 |
35 | # Removing the final argument.
|
- = help: Remove extra positional arguments at position(s): 0
+help: Remove extra positional arguments at position(s): 0
ℹ Safe fix
29 29 | "{1} {8}".format(0, 1) # F523, # F524
@@ -270,14 +286,15 @@ F523.py:32:2: F523 [*] `.format` call has unused arguments at position(s): 0
35 34 | # Removing the final argument.
36 35 | "Hello".format("world")
-F523.py:36:1: F523 [*] `.format` call has unused arguments at position(s): 0
+F523 [*] `.format` call has unused arguments at position(s): 0
+ --> F523.py:36:1
|
35 | # Removing the final argument.
36 | "Hello".format("world")
- | ^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^
37 | "Hello".format("world", key="value")
|
- = help: Remove extra positional arguments at position(s): 0
+help: Remove extra positional arguments at position(s): 0
ℹ Safe fix
33 33 | .format(2))
@@ -289,16 +306,17 @@ F523.py:36:1: F523 [*] `.format` call has unused arguments at position(s): 0
38 38 |
39 39 | # https://github.com/astral-sh/ruff/issues/18806
-F523.py:37:1: F523 [*] `.format` call has unused arguments at position(s): 0
+F523 [*] `.format` call has unused arguments at position(s): 0
+ --> F523.py:37:1
|
35 | # Removing the final argument.
36 | "Hello".format("world")
37 | "Hello".format("world", key="value")
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 |
39 | # https://github.com/astral-sh/ruff/issues/18806
|
- = help: Remove extra positional arguments at position(s): 0
+help: Remove extra positional arguments at position(s): 0
ℹ Safe fix
34 34 |
@@ -310,16 +328,17 @@ F523.py:37:1: F523 [*] `.format` call has unused arguments at position(s): 0
39 39 | # https://github.com/astral-sh/ruff/issues/18806
40 40 | # The fix here is unsafe because the unused argument has side effect
-F523.py:41:1: F523 [*] `.format` call has unused arguments at position(s): 1
+F523 [*] `.format` call has unused arguments at position(s): 1
+ --> F523.py:41:1
|
39 | # https://github.com/astral-sh/ruff/issues/18806
40 | # The fix here is unsafe because the unused argument has side effect
41 | "Hello, {0}".format("world", print(1))
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 |
43 | # The fix here is safe because the unused argument has no side effect,
|
- = help: Remove extra positional arguments at position(s): 1
+help: Remove extra positional arguments at position(s): 1
ℹ Unsafe fix
38 38 |
@@ -331,14 +350,15 @@ F523.py:41:1: F523 [*] `.format` call has unused arguments at position(s): 1
43 43 | # The fix here is safe because the unused argument has no side effect,
44 44 | # even though the used argument has a side effect
-F523.py:45:1: F523 [*] `.format` call has unused arguments at position(s): 1
+F523 [*] `.format` call has unused arguments at position(s): 1
+ --> F523.py:45:1
|
43 | # The fix here is safe because the unused argument has no side effect,
44 | # even though the used argument has a side effect
45 | "Hello, {0}".format(print(1), "Pikachu")
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F523
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove extra positional arguments at position(s): 1
+help: Remove extra positional arguments at position(s): 1
ℹ Safe fix
42 42 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap
index c7b28c0dfa..fa097d75ff 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap
@@ -1,67 +1,73 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F524.py:1:1: F524 `.format` call is missing argument(s) for placeholder(s): 1
+F524 `.format` call is missing argument(s) for placeholder(s): 1
+ --> F524.py:1:1
|
1 | "{} {}".format(1) # F524
- | ^^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^^
2 | "{2}".format() # F524
3 | "{bar}".format() # F524
|
-F524.py:2:1: F524 `.format` call is missing argument(s) for placeholder(s): 2
+F524 `.format` call is missing argument(s) for placeholder(s): 2
+ --> F524.py:2:1
|
1 | "{} {}".format(1) # F524
2 | "{2}".format() # F524
- | ^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^
3 | "{bar}".format() # F524
4 | "{0} {bar}".format(1) # F524
|
-F524.py:3:1: F524 `.format` call is missing argument(s) for placeholder(s): bar
+F524 `.format` call is missing argument(s) for placeholder(s): bar
+ --> F524.py:3:1
|
1 | "{} {}".format(1) # F524
2 | "{2}".format() # F524
3 | "{bar}".format() # F524
- | ^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^
4 | "{0} {bar}".format(1) # F524
5 | "{0} {bar}".format() # F524
|
-F524.py:4:1: F524 `.format` call is missing argument(s) for placeholder(s): bar
+F524 `.format` call is missing argument(s) for placeholder(s): bar
+ --> F524.py:4:1
|
2 | "{2}".format() # F524
3 | "{bar}".format() # F524
4 | "{0} {bar}".format(1) # F524
- | ^^^^^^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^^^^^^
5 | "{0} {bar}".format() # F524
6 | "{bar} {0}".format() # F524
|
-F524.py:5:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar
+F524 `.format` call is missing argument(s) for placeholder(s): 0, bar
+ --> F524.py:5:1
|
3 | "{bar}".format() # F524
4 | "{0} {bar}".format(1) # F524
5 | "{0} {bar}".format() # F524
- | ^^^^^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^^^^^
6 | "{bar} {0}".format() # F524
7 | "{1} {8}".format(0, 1)
|
-F524.py:6:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar
+F524 `.format` call is missing argument(s) for placeholder(s): 0, bar
+ --> F524.py:6:1
|
4 | "{0} {bar}".format(1) # F524
5 | "{0} {bar}".format() # F524
6 | "{bar} {0}".format() # F524
- | ^^^^^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^^^^^
7 | "{1} {8}".format(0, 1)
|
-F524.py:7:1: F524 `.format` call is missing argument(s) for placeholder(s): 8
+F524 `.format` call is missing argument(s) for placeholder(s): 8
+ --> F524.py:7:1
|
5 | "{0} {bar}".format() # F524
6 | "{bar} {0}".format() # F524
7 | "{1} {8}".format(0, 1)
- | ^^^^^^^^^^^^^^^^^^^^^^ F524
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap
index c4d45bde61..c6a8823ae1 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F525.py:1:1: F525 `.format` string mixes automatic and manual numbering
+F525 `.format` string mixes automatic and manual numbering
+ --> F525.py:1:1
|
1 | "{} {1}".format(1, 2) # F525
- | ^^^^^^^^^^^^^^^^^^^^^ F525
+ | ^^^^^^^^^^^^^^^^^^^^^
2 | "{0} {}".format(1, 2) # F523, F525
|
-F525.py:2:1: F525 `.format` string mixes automatic and manual numbering
+F525 `.format` string mixes automatic and manual numbering
+ --> F525.py:2:1
|
1 | "{} {1}".format(1, 2) # F525
2 | "{0} {}".format(1, 2) # F523, F525
- | ^^^^^^^^^^^^^^^^^^^^^ F525
+ | ^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap
index a7938d42ab..a479bd02cb 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F541.py:6:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:6:5
|
5 | # Errors
6 | c = f"def"
- | ^^^^^^ F541
+ | ^^^^^^
7 | d = f"def" + "ghi"
8 | e = (
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
3 3 | b = f"ghi{'jkl'}"
@@ -21,16 +22,17 @@ F541.py:6:5: F541 [*] f-string without any placeholders
8 8 | e = (
9 9 | f"def" +
-F541.py:7:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:7:5
|
5 | # Errors
6 | c = f"def"
7 | d = f"def" + "ghi"
- | ^^^^^^ F541
+ | ^^^^^^
8 | e = (
9 | f"def" +
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
4 4 |
@@ -42,16 +44,17 @@ F541.py:7:5: F541 [*] f-string without any placeholders
9 9 | f"def" +
10 10 | "ghi"
-F541.py:9:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:9:5
|
7 | d = f"def" + "ghi"
8 | e = (
9 | f"def" +
- | ^^^^^^ F541
+ | ^^^^^^
10 | "ghi"
11 | )
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
6 6 | c = f"def"
@@ -63,16 +66,17 @@ F541.py:9:5: F541 [*] f-string without any placeholders
11 11 | )
12 12 | f = (
-F541.py:13:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:13:5
|
11 | )
12 | f = (
13 | f"a"
- | ^^^^ F541
+ | ^^^^
14 | F"b"
15 | "c"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
10 10 | "ghi"
@@ -84,16 +88,17 @@ F541.py:13:5: F541 [*] f-string without any placeholders
15 15 | "c"
16 16 | rf"d"
-F541.py:14:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:14:5
|
12 | f = (
13 | f"a"
14 | F"b"
- | ^^^^ F541
+ | ^^^^
15 | "c"
16 | rf"d"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
11 11 | )
@@ -105,16 +110,17 @@ F541.py:14:5: F541 [*] f-string without any placeholders
16 16 | rf"d"
17 17 | fr"e"
-F541.py:16:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:16:5
|
14 | F"b"
15 | "c"
16 | rf"d"
- | ^^^^^ F541
+ | ^^^^^
17 | fr"e"
18 | )
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
13 13 | f"a"
@@ -126,16 +132,17 @@ F541.py:16:5: F541 [*] f-string without any placeholders
18 18 | )
19 19 | g = f""
-F541.py:17:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:17:5
|
15 | "c"
16 | rf"d"
17 | fr"e"
- | ^^^^^ F541
+ | ^^^^^
18 | )
19 | g = f""
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
14 14 | F"b"
@@ -147,16 +154,17 @@ F541.py:17:5: F541 [*] f-string without any placeholders
19 19 | g = f""
20 20 |
-F541.py:19:5: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:19:5
|
17 | fr"e"
18 | )
19 | g = f""
- | ^^^ F541
+ | ^^^
20 |
21 | # OK
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
16 16 | rf"d"
@@ -168,15 +176,16 @@ F541.py:19:5: F541 [*] f-string without any placeholders
21 21 | # OK
22 22 | g = f"ghi{123:{45}}"
-F541.py:25:13: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:25:13
|
24 | # Error
25 | h = "x" "y" f"z"
- | ^^^^ F541
+ | ^^^^
26 |
27 | v = 23.234234
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
22 22 | g = f"ghi{123:{45}}"
@@ -188,15 +197,16 @@ F541.py:25:13: F541 [*] f-string without any placeholders
27 27 | v = 23.234234
28 28 |
-F541.py:34:7: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:34:7
|
33 | # Errors
34 | f"{v:{f'0.2f'}}"
- | ^^^^^^^ F541
+ | ^^^^^^^
35 | f"{f''}"
36 | f"{{test}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
31 31 | f"{f'{v:0.2f}'}"
@@ -208,16 +218,17 @@ F541.py:34:7: F541 [*] f-string without any placeholders
36 36 | f"{{test}}"
37 37 | f'{{ 40 }}'
-F541.py:35:4: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:35:4
|
33 | # Errors
34 | f"{v:{f'0.2f'}}"
35 | f"{f''}"
- | ^^^ F541
+ | ^^^
36 | f"{{test}}"
37 | f'{{ 40 }}'
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
32 32 |
@@ -229,16 +240,17 @@ F541.py:35:4: F541 [*] f-string without any placeholders
37 37 | f'{{ 40 }}'
38 38 | f"{{a {{x}}"
-F541.py:36:1: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:36:1
|
34 | f"{v:{f'0.2f'}}"
35 | f"{f''}"
36 | f"{{test}}"
- | ^^^^^^^^^^^ F541
+ | ^^^^^^^^^^^
37 | f'{{ 40 }}'
38 | f"{{a {{x}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
33 33 | # Errors
@@ -250,16 +262,17 @@ F541.py:36:1: F541 [*] f-string without any placeholders
38 38 | f"{{a {{x}}"
39 39 | f"{{{{x}}}}"
-F541.py:37:1: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:37:1
|
35 | f"{f''}"
36 | f"{{test}}"
37 | f'{{ 40 }}'
- | ^^^^^^^^^^^ F541
+ | ^^^^^^^^^^^
38 | f"{{a {{x}}"
39 | f"{{{{x}}}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
34 34 | f"{v:{f'0.2f'}}"
@@ -271,16 +284,17 @@ F541.py:37:1: F541 [*] f-string without any placeholders
39 39 | f"{{{{x}}}}"
40 40 | ""f""
-F541.py:38:1: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:38:1
|
36 | f"{{test}}"
37 | f'{{ 40 }}'
38 | f"{{a {{x}}"
- | ^^^^^^^^^^^^ F541
+ | ^^^^^^^^^^^^
39 | f"{{{{x}}}}"
40 | ""f""
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
35 35 | f"{f''}"
@@ -292,16 +306,17 @@ F541.py:38:1: F541 [*] f-string without any placeholders
40 40 | ""f""
41 41 | ''f""
-F541.py:39:1: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:39:1
|
37 | f'{{ 40 }}'
38 | f"{{a {{x}}"
39 | f"{{{{x}}}}"
- | ^^^^^^^^^^^^ F541
+ | ^^^^^^^^^^^^
40 | ""f""
41 | ''f""
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
36 36 | f"{{test}}"
@@ -313,16 +328,17 @@ F541.py:39:1: F541 [*] f-string without any placeholders
41 41 | ''f""
42 42 | (""f""r"")
-F541.py:40:3: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:40:3
|
38 | f"{{a {{x}}"
39 | f"{{{{x}}}}"
40 | ""f""
- | ^^^ F541
+ | ^^^
41 | ''f""
42 | (""f""r"")
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
37 37 | f'{{ 40 }}'
@@ -334,16 +350,17 @@ F541.py:40:3: F541 [*] f-string without any placeholders
42 42 | (""f""r"")
43 43 | f"{v:{f"0.2f"}}"
-F541.py:41:3: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:41:3
|
39 | f"{{{{x}}}}"
40 | ""f""
41 | ''f""
- | ^^^ F541
+ | ^^^
42 | (""f""r"")
43 | f"{v:{f"0.2f"}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
38 38 | f"{{a {{x}}"
@@ -355,16 +372,17 @@ F541.py:41:3: F541 [*] f-string without any placeholders
43 43 | f"{v:{f"0.2f"}}"
44 44 | f"\{{x}}"
-F541.py:42:4: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:42:4
|
40 | ""f""
41 | ''f""
42 | (""f""r"")
- | ^^^ F541
+ | ^^^
43 | f"{v:{f"0.2f"}}"
44 | f"\{{x}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
39 39 | f"{{{{x}}}}"
@@ -375,15 +393,16 @@ F541.py:42:4: F541 [*] f-string without any placeholders
43 43 | f"{v:{f"0.2f"}}"
44 44 | f"\{{x}}"
-F541.py:43:7: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:43:7
|
41 | ''f""
42 | (""f""r"")
43 | f"{v:{f"0.2f"}}"
- | ^^^^^^^ F541
+ | ^^^^^^^
44 | f"\{{x}}"
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
40 40 | ""f""
@@ -393,14 +412,15 @@ F541.py:43:7: F541 [*] f-string without any placeholders
43 |+f"{v:{"0.2f"}}"
44 44 | f"\{{x}}"
-F541.py:44:1: F541 [*] f-string without any placeholders
+F541 [*] f-string without any placeholders
+ --> F541.py:44:1
|
42 | (""f""r"")
43 | f"{v:{f"0.2f"}}"
44 | f"\{{x}}"
- | ^^^^^^^^^ F541
+ | ^^^^^^^^^
|
- = help: Remove extraneous `f` prefix
+help: Remove extraneous `f` prefix
ℹ Safe fix
41 41 | ''f""
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap
index b16b7bea64..adf7c6cfb2 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap
@@ -1,91 +1,99 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F601.py:3:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:3:5
|
1 | x = {
2 | "a": 1,
3 | "a": 2,
- | ^^^ F601
+ | ^^^
4 | "b": 3,
5 | ("a", "b"): 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:6:5: F601 Dictionary key literal `("a", "b")` repeated
+F601 Dictionary key literal `("a", "b")` repeated
+ --> F601.py:6:5
|
4 | "b": 3,
5 | ("a", "b"): 3,
6 | ("a", "b"): 4,
- | ^^^^^^^^^^ F601
+ | ^^^^^^^^^^
7 | 1.0: 2,
8 | 1: 0,
|
- = help: Remove repeated key literal `("a", "b")`
+help: Remove repeated key literal `("a", "b")`
-F601.py:8:5: F601 Dictionary key literal `1` repeated (`1` hashes to the same value as `1.0`)
+F601 Dictionary key literal `1` repeated (`1` hashes to the same value as `1.0`)
+ --> F601.py:8:5
|
6 | ("a", "b"): 4,
7 | 1.0: 2,
8 | 1: 0,
- | ^ F601
+ | ^
9 | 1: 3,
10 | b"123": 1,
|
- = help: Remove repeated key literal `1`
+help: Remove repeated key literal `1`
-F601.py:9:5: F601 Dictionary key literal `1` repeated (`1` hashes to the same value as `1.0`)
+F601 Dictionary key literal `1` repeated (`1` hashes to the same value as `1.0`)
+ --> F601.py:9:5
|
7 | 1.0: 2,
8 | 1: 0,
9 | 1: 3,
- | ^ F601
+ | ^
10 | b"123": 1,
11 | b"123": 4,
|
- = help: Remove repeated key literal `1`
+help: Remove repeated key literal `1`
-F601.py:11:5: F601 Dictionary key literal `b"123"` repeated
+F601 Dictionary key literal `b"123"` repeated
+ --> F601.py:11:5
|
9 | 1: 3,
10 | b"123": 1,
11 | b"123": 4,
- | ^^^^^^ F601
+ | ^^^^^^
12 | }
|
- = help: Remove repeated key literal `b"123"`
+help: Remove repeated key literal `b"123"`
-F601.py:16:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:16:5
|
14 | x = {
15 | "a": 1,
16 | "a": 2,
- | ^^^ F601
+ | ^^^
17 | "a": 3,
18 | "a": 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:17:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:17:5
|
15 | "a": 1,
16 | "a": 2,
17 | "a": 3,
- | ^^^ F601
+ | ^^^
18 | "a": 3,
19 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:18:5: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:18:5
|
16 | "a": 2,
17 | "a": 3,
18 | "a": 3,
- | ^^^ F601
+ | ^^^
19 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
15 15 | "a": 1,
@@ -96,38 +104,41 @@ F601.py:18:5: F601 [*] Dictionary key literal `"a"` repeated
20 19 |
21 20 | x = {
-F601.py:23:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:23:5
|
21 | x = {
22 | "a": 1,
23 | "a": 2,
- | ^^^ F601
+ | ^^^
24 | "a": 3,
25 | "a": 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:24:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:24:5
|
22 | "a": 1,
23 | "a": 2,
24 | "a": 3,
- | ^^^ F601
+ | ^^^
25 | "a": 3,
26 | "a": 4,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:25:5: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:25:5
|
23 | "a": 2,
24 | "a": 3,
25 | "a": 3,
- | ^^^ F601
+ | ^^^
26 | "a": 4,
27 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
22 22 | "a": 1,
@@ -138,26 +149,28 @@ F601.py:25:5: F601 [*] Dictionary key literal `"a"` repeated
27 26 | }
28 27 |
-F601.py:26:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:26:5
|
24 | "a": 3,
25 | "a": 3,
26 | "a": 4,
- | ^^^ F601
+ | ^^^
27 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:31:5: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:31:5
|
29 | x = {
30 | "a": 1,
31 | "a": 1,
- | ^^^ F601
+ | ^^^
32 | "a": 2,
33 | "a": 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
28 28 |
@@ -168,70 +181,76 @@ F601.py:31:5: F601 [*] Dictionary key literal `"a"` repeated
33 32 | "a": 3,
34 33 | "a": 4,
-F601.py:32:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:32:5
|
30 | "a": 1,
31 | "a": 1,
32 | "a": 2,
- | ^^^ F601
+ | ^^^
33 | "a": 3,
34 | "a": 4,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:33:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:33:5
|
31 | "a": 1,
32 | "a": 2,
33 | "a": 3,
- | ^^^ F601
+ | ^^^
34 | "a": 4,
35 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:34:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:34:5
|
32 | "a": 2,
33 | "a": 3,
34 | "a": 4,
- | ^^^ F601
+ | ^^^
35 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:41:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:41:5
|
39 | "a": 1,
40 | a: 1,
41 | "a": 2,
- | ^^^ F601
+ | ^^^
42 | a: 2,
43 | "a": 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:43:5: F601 Dictionary key literal `"a"` repeated
+F601 Dictionary key literal `"a"` repeated
+ --> F601.py:43:5
|
41 | "a": 2,
42 | a: 2,
43 | "a": 3,
- | ^^^ F601
+ | ^^^
44 | a: 3,
45 | "a": 3,
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
-F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:45:5
|
43 | "a": 3,
44 | a: 3,
45 | "a": 3,
- | ^^^ F601
+ | ^^^
46 | a: 4,
47 | }
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
42 42 | a: 2,
@@ -242,15 +261,16 @@ F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated
47 46 | }
48 47 |
-F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:49:14
|
47 | }
48 |
49 | x = {"a": 1, "a": 1}
- | ^^^ F601
+ | ^^^
50 | x = {"a": 1, "b": 2, "a": 1}
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
46 46 | a: 4,
@@ -262,15 +282,16 @@ F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated
51 51 |
52 52 | x = {
-F601.py:50:22: F601 [*] Dictionary key literal `"a"` repeated
+F601 [*] Dictionary key literal `"a"` repeated
+ --> F601.py:50:22
|
49 | x = {"a": 1, "a": 1}
50 | x = {"a": 1, "b": 2, "a": 1}
- | ^^^ F601
+ | ^^^
51 |
52 | x = {
|
- = help: Remove repeated key literal `"a"`
+help: Remove repeated key literal `"a"`
ℹ Unsafe fix
47 47 | }
@@ -282,25 +303,27 @@ F601.py:50:22: F601 [*] Dictionary key literal `"a"` repeated
52 52 | x = {
53 53 | ('a', 'b'): 'asdf',
-F601.py:54:5: F601 Dictionary key literal `('a', 'b')` repeated
+F601 Dictionary key literal `('a', 'b')` repeated
+ --> F601.py:54:5
|
52 | x = {
53 | ('a', 'b'): 'asdf',
54 | ('a', 'b'): 'qwer',
- | ^^^^^^^^^^ F601
+ | ^^^^^^^^^^
55 | }
|
- = help: Remove repeated key literal `('a', 'b')`
+help: Remove repeated key literal `('a', 'b')`
-F601.py:58:19: F601 [*] Dictionary key literal `"x"` repeated
+F601 [*] Dictionary key literal `"x"` repeated
+ --> F601.py:58:19
|
57 | # Regression test for: https://github.com/astral-sh/ruff/issues/4897
58 | t={"x":"test123", "x":("test123")}
- | ^^^ F601
+ | ^^^
59 |
60 | t={"x":("test123"), "x":"test123"}
|
- = help: Remove repeated key literal `"x"`
+help: Remove repeated key literal `"x"`
ℹ Unsafe fix
55 55 | }
@@ -312,16 +335,17 @@ F601.py:58:19: F601 [*] Dictionary key literal `"x"` repeated
60 60 | t={"x":("test123"), "x":"test123"}
61 61 |
-F601.py:60:21: F601 [*] Dictionary key literal `"x"` repeated
+F601 [*] Dictionary key literal `"x"` repeated
+ --> F601.py:60:21
|
58 | t={"x":"test123", "x":("test123")}
59 |
60 | t={"x":("test123"), "x":"test123"}
- | ^^^ F601
+ | ^^^
61 |
62 | # Regression test for: https://github.com/astral-sh/ruff/issues/12772
|
- = help: Remove repeated key literal `"x"`
+help: Remove repeated key literal `"x"`
ℹ Unsafe fix
57 57 | # Regression test for: https://github.com/astral-sh/ruff/issues/4897
@@ -333,45 +357,49 @@ F601.py:60:21: F601 [*] Dictionary key literal `"x"` repeated
62 62 | # Regression test for: https://github.com/astral-sh/ruff/issues/12772
63 63 | x = {
-F601.py:65:5: F601 Dictionary key literal `1` repeated
+F601 Dictionary key literal `1` repeated
+ --> F601.py:65:5
|
63 | x = {
64 | 1: "abc",
65 | 1: "def",
- | ^ F601
+ | ^
66 | True: "ghi",
67 | 0: "foo",
|
- = help: Remove repeated key literal `1`
+help: Remove repeated key literal `1`
-F601.py:66:5: F601 Dictionary key literal `True` repeated (`True` hashes to the same value as `1`)
+F601 Dictionary key literal `True` repeated (`True` hashes to the same value as `1`)
+ --> F601.py:66:5
|
64 | 1: "abc",
65 | 1: "def",
66 | True: "ghi",
- | ^^^^ F601
+ | ^^^^
67 | 0: "foo",
68 | 0: "bar",
|
- = help: Remove repeated key literal `True`
+help: Remove repeated key literal `True`
-F601.py:68:5: F601 Dictionary key literal `0` repeated
+F601 Dictionary key literal `0` repeated
+ --> F601.py:68:5
|
66 | True: "ghi",
67 | 0: "foo",
68 | 0: "bar",
- | ^ F601
+ | ^
69 | False: "baz",
70 | }
|
- = help: Remove repeated key literal `0`
+help: Remove repeated key literal `0`
-F601.py:69:5: F601 Dictionary key literal `False` repeated (`False` hashes to the same value as `0`)
+F601 Dictionary key literal `False` repeated (`False` hashes to the same value as `0`)
+ --> F601.py:69:5
|
67 | 0: "foo",
68 | 0: "bar",
69 | False: "baz",
- | ^^^^^ F601
+ | ^^^^^
70 | }
|
- = help: Remove repeated key literal `False`
+help: Remove repeated key literal `False`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap
index 6fe76f9fd0..f49f8ea2ec 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap
@@ -1,48 +1,52 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F602.py:5:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:5:5
|
3 | x = {
4 | a: 1,
5 | a: 2,
- | ^ F602
+ | ^
6 | b: 3,
7 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:11:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:11:5
|
9 | x = {
10 | a: 1,
11 | a: 2,
- | ^ F602
+ | ^
12 | a: 3,
13 | a: 3,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:12:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:12:5
|
10 | a: 1,
11 | a: 2,
12 | a: 3,
- | ^ F602
+ | ^
13 | a: 3,
14 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:13:5: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:13:5
|
11 | a: 2,
12 | a: 3,
13 | a: 3,
- | ^ F602
+ | ^
14 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
10 10 | a: 1,
@@ -53,38 +57,41 @@ F602.py:13:5: F602 [*] Dictionary key `a` repeated
15 14 |
16 15 | x = {
-F602.py:18:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:18:5
|
16 | x = {
17 | a: 1,
18 | a: 2,
- | ^ F602
+ | ^
19 | a: 3,
20 | a: 3,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:19:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:19:5
|
17 | a: 1,
18 | a: 2,
19 | a: 3,
- | ^ F602
+ | ^
20 | a: 3,
21 | a: 4,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:20:5: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:20:5
|
18 | a: 2,
19 | a: 3,
20 | a: 3,
- | ^ F602
+ | ^
21 | a: 4,
22 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
17 17 | a: 1,
@@ -95,26 +102,28 @@ F602.py:20:5: F602 [*] Dictionary key `a` repeated
22 21 | }
23 22 |
-F602.py:21:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:21:5
|
19 | a: 3,
20 | a: 3,
21 | a: 4,
- | ^ F602
+ | ^
22 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:26:5: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:26:5
|
24 | x = {
25 | a: 1,
26 | a: 1,
- | ^ F602
+ | ^
27 | a: 2,
28 | a: 3,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
23 23 |
@@ -125,48 +134,52 @@ F602.py:26:5: F602 [*] Dictionary key `a` repeated
28 27 | a: 3,
29 28 | a: 4,
-F602.py:27:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:27:5
|
25 | a: 1,
26 | a: 1,
27 | a: 2,
- | ^ F602
+ | ^
28 | a: 3,
29 | a: 4,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:28:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:28:5
|
26 | a: 1,
27 | a: 2,
28 | a: 3,
- | ^ F602
+ | ^
29 | a: 4,
30 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:29:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:29:5
|
27 | a: 2,
28 | a: 3,
29 | a: 4,
- | ^ F602
+ | ^
30 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:35:5: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:35:5
|
33 | a: 1,
34 | "a": 1,
35 | a: 1,
- | ^ F602
+ | ^
36 | "a": 2,
37 | a: 2,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
32 32 | x = {
@@ -177,47 +190,51 @@ F602.py:35:5: F602 [*] Dictionary key `a` repeated
37 36 | a: 2,
38 37 | "a": 3,
-F602.py:37:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:37:5
|
35 | a: 1,
36 | "a": 2,
37 | a: 2,
- | ^ F602
+ | ^
38 | "a": 3,
39 | a: 3,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:39:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:39:5
|
37 | a: 2,
38 | "a": 3,
39 | a: 3,
- | ^ F602
+ | ^
40 | "a": 3,
41 | a: 4,
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:41:5: F602 Dictionary key `a` repeated
+F602 Dictionary key `a` repeated
+ --> F602.py:41:5
|
39 | a: 3,
40 | "a": 3,
41 | a: 4,
- | ^ F602
+ | ^
42 | }
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
-F602.py:44:12: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:44:12
|
42 | }
43 |
44 | x = {a: 1, a: 1}
- | ^ F602
+ | ^
45 | x = {a: 1, b: 2, a: 1}
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
41 41 | a: 4,
@@ -227,13 +244,14 @@ F602.py:44:12: F602 [*] Dictionary key `a` repeated
44 |+x = {a: 1}
45 45 | x = {a: 1, b: 2, a: 1}
-F602.py:45:18: F602 [*] Dictionary key `a` repeated
+F602 [*] Dictionary key `a` repeated
+ --> F602.py:45:18
|
44 | x = {a: 1, a: 1}
45 | x = {a: 1, b: 2, a: 1}
- | ^ F602
+ | ^
|
- = help: Remove repeated key `a`
+help: Remove repeated key `a`
ℹ Unsafe fix
42 42 | }
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F622_F622.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F622_F622.py.snap
index a99d31d8a4..9f4e6e9946 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F622_F622.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F622_F622.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F622.py:1:1: F622 Two starred expressions in assignment
+F622 Two starred expressions in assignment
+ --> F622.py:1:1
|
1 | *a, *b, c = (1, 2, 3)
- | ^^^^^^^^^ F622
+ | ^^^^^^^^^
2 | *a, b, c = (1, 2, 3)
3 | a, b, *c = (1, 2, 3)
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F631_F631.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F631_F631.py.snap
index 1a7624182d..eb05b93694 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F631_F631.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F631_F631.py.snap
@@ -1,20 +1,21 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F631.py:1:1: F631 Assert test is a non-empty tuple, which is always `True`
+F631 Assert test is a non-empty tuple, which is always `True`
+ --> F631.py:1:1
|
1 | assert (False, "x")
- | ^^^^^^^^^^^^^^^^^^^ F631
+ | ^^^^^^^^^^^^^^^^^^^
2 | assert (False,)
3 | assert ()
|
-F631.py:2:1: F631 Assert test is a non-empty tuple, which is always `True`
+F631 Assert test is a non-empty tuple, which is always `True`
+ --> F631.py:2:1
|
1 | assert (False, "x")
2 | assert (False,)
- | ^^^^^^^^^^^^^^^ F631
+ | ^^^^^^^^^^^^^^^
3 | assert ()
4 | assert True
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap
index 0bf2cf432b..a0fc045e36 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F632.py:1:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> F632.py:1:4
|
1 | if x is "abc":
- | ^^^^^^^^^^ F632
+ | ^^^^^^^^^^
2 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
1 |-if x is "abc":
@@ -16,15 +17,16 @@ F632.py:1:4: F632 [*] Use `==` to compare constant literals
3 3 |
4 4 | if 123 is not y:
-F632.py:4:4: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:4:4
|
2 | pass
3 |
4 | if 123 is not y:
- | ^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^
5 | pass
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
1 1 | if x is "abc":
@@ -36,17 +38,18 @@ F632.py:4:4: F632 [*] Use `!=` to compare constant literals
6 6 |
7 7 | if 123 is \
-F632.py:7:4: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:7:4
|
5 | pass
6 |
7 | if 123 is \
| ____^
8 | | not y:
- | |_____________^ F632
+ | |_____________^
9 | pass
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
4 4 | if 123 is not y:
@@ -59,15 +62,16 @@ F632.py:7:4: F632 [*] Use `!=` to compare constant literals
10 9 |
11 10 | if "123" is x < 3:
-F632.py:11:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> F632.py:11:4
|
9 | pass
10 |
11 | if "123" is x < 3:
- | ^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^
12 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
8 8 | not y:
@@ -79,15 +83,16 @@ F632.py:11:4: F632 [*] Use `==` to compare constant literals
13 13 |
14 14 | if "123" != x is 3:
-F632.py:14:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> F632.py:14:4
|
12 | pass
13 |
14 | if "123" != x is 3:
- | ^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^
15 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
11 11 | if "123" is x < 3:
@@ -99,15 +104,16 @@ F632.py:14:4: F632 [*] Use `==` to compare constant literals
16 16 |
17 17 | if ("123" != x) is 3:
-F632.py:17:4: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> F632.py:17:4
|
15 | pass
16 |
17 | if ("123" != x) is 3:
- | ^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^
18 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
14 14 | if "123" != x is 3:
@@ -119,15 +125,16 @@ F632.py:17:4: F632 [*] Use `==` to compare constant literals
19 19 |
20 20 | if "123" != (x is 3):
-F632.py:20:14: F632 [*] Use `==` to compare constant literals
+F632 [*] Use `==` to compare constant literals
+ --> F632.py:20:14
|
18 | pass
19 |
20 | if "123" != (x is 3):
- | ^^^^^^ F632
+ | ^^^^^^
21 | pass
|
- = help: Replace `is` with `==`
+help: Replace `is` with `==`
ℹ Safe fix
17 17 | if ("123" != x) is 3:
@@ -139,18 +146,19 @@ F632.py:20:14: F632 [*] Use `==` to compare constant literals
22 22 |
23 23 | {2 is
-F632.py:23:2: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:23:2
|
21 | pass
22 |
23 | {2 is
| __^
24 | | not ''}
- | |______^ F632
+ | |______^
25 |
26 | {2 is
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
20 20 | if "123" != (x is 3):
@@ -163,18 +171,19 @@ F632.py:23:2: F632 [*] Use `!=` to compare constant literals
26 25 | {2 is
27 26 | not ''}
-F632.py:26:2: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:26:2
|
24 | not ''}
25 |
26 | {2 is
| __^
27 | | not ''}
- | |_______^ F632
+ | |_______^
28 |
29 | # Regression test for
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
23 23 | {2 is
@@ -187,14 +196,15 @@ F632.py:26:2: F632 [*] Use `!=` to compare constant literals
29 28 | # Regression test for
30 29 | if values[1is not None ] is not '-':
-F632.py:30:4: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:30:4
|
29 | # Regression test for
30 | if values[1is not None ] is not '-':
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 | pass
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
27 27 | not ''}
@@ -206,14 +216,15 @@ F632.py:30:4: F632 [*] Use `!=` to compare constant literals
32 32 |
33 33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736
-F632.py:30:11: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:30:11
|
29 | # Regression test for
30 | if values[1is not None ] is not '-':
- | ^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^
31 | pass
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
27 27 | not ''}
@@ -225,13 +236,14 @@ F632.py:30:11: F632 [*] Use `!=` to compare constant literals
32 32 |
33 33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736
-F632.py:34:12: F632 [*] Use `!=` to compare constant literals
+F632 [*] Use `!=` to compare constant literals
+ --> F632.py:34:12
|
33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736
34 | variable: "123 is not y"
- | ^^^^^^^^^^^^ F632
+ | ^^^^^^^^^^^^
|
- = help: Replace `is not` with `!=`
+help: Replace `is not` with `!=`
ℹ Safe fix
31 31 | pass
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap
index 1399617c01..3e06e1bd63 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F633.py:4:1: F633 Use of `>>` is invalid with `print` function
+F633 Use of `>>` is invalid with `print` function
+ --> F633.py:4:1
|
2 | import sys
3 |
4 | print >> sys.stderr, "Hello"
- | ^^^^^ F633
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F634_F634.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F634_F634.py.snap
index ce4f4be9aa..8015323bd4 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F634_F634.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F634_F634.py.snap
@@ -1,29 +1,32 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F634.py:1:4: F634 If test is a tuple, which is always `True`
+F634 If test is a tuple, which is always `True`
+ --> F634.py:1:4
|
1 | if (1, 2):
- | ^^^^^^ F634
+ | ^^^^^^
2 | pass
|
-F634.py:4:4: F634 If test is a tuple, which is always `True`
+F634 If test is a tuple, which is always `True`
+ --> F634.py:4:4
|
2 | pass
3 |
4 | if (3, 4):
- | ^^^^^^ F634
+ | ^^^^^^
5 | pass
6 | elif foo:
|
-F634.py:12:10: F634 If test is a tuple, which is always `True`
+F634 If test is a tuple, which is always `True`
+ --> F634.py:12:10
|
10 | if True:
11 | pass
12 | elif (3, 4):
- | ^^^^^^ F634
+ | ^^^^^^
13 | pass
14 | elif ():
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap
index 775b955209..cd32ed927c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap
@@ -1,33 +1,37 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F701.py:4:5: F701 `break` outside loop
+F701 `break` outside loop
+ --> F701.py:4:5
|
2 | break
3 | else:
4 | break
- | ^^^^^ F701
+ | ^^^^^
5 |
6 | i = 0
|
-F701.py:16:5: F701 `break` outside loop
+F701 `break` outside loop
+ --> F701.py:16:5
|
14 | break
15 |
16 | break
- | ^^^^^ F701
+ | ^^^^^
|
-F701.py:20:5: F701 `break` outside loop
+F701 `break` outside loop
+ --> F701.py:20:5
|
19 | class Foo:
20 | break
- | ^^^^^ F701
+ | ^^^^^
|
-F701.py:23:1: F701 `break` outside loop
+F701 `break` outside loop
+ --> F701.py:23:1
|
23 | break
- | ^^^^^ F701
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap
index 89f8fd3cc0..5e121ca2c7 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap
@@ -1,33 +1,37 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F702.py:4:5: F702 `continue` not properly in loop
+F702 `continue` not properly in loop
+ --> F702.py:4:5
|
2 | continue
3 | else:
4 | continue
- | ^^^^^^^^ F702
+ | ^^^^^^^^
5 |
6 | i = 0
|
-F702.py:16:5: F702 `continue` not properly in loop
+F702 `continue` not properly in loop
+ --> F702.py:16:5
|
14 | continue
15 |
16 | continue
- | ^^^^^^^^ F702
+ | ^^^^^^^^
|
-F702.py:20:5: F702 `continue` not properly in loop
+F702 `continue` not properly in loop
+ --> F702.py:20:5
|
19 | class Foo:
20 | continue
- | ^^^^^^^^ F702
+ | ^^^^^^^^
|
-F702.py:23:1: F702 `continue` not properly in loop
+F702 `continue` not properly in loop
+ --> F702.py:23:1
|
23 | continue
- | ^^^^^^^^ F702
+ | ^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap
index 4afdfc8bb6..25a0fe321a 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap
@@ -1,35 +1,39 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F704.py:6:5: F704 `yield` statement outside of a function
+F704 `yield` statement outside of a function
+ --> F704.py:6:5
|
5 | class Foo:
6 | yield 2
- | ^^^^^^^ F704
+ | ^^^^^^^
|
-F704.py:9:1: F704 `yield` statement outside of a function
+F704 `yield` statement outside of a function
+ --> F704.py:9:1
|
9 | yield 3
- | ^^^^^^^ F704
+ | ^^^^^^^
10 | yield from 3
11 | await f()
|
-F704.py:10:1: F704 `yield from` statement outside of a function
+F704 `yield from` statement outside of a function
+ --> F704.py:10:1
|
9 | yield 3
10 | yield from 3
- | ^^^^^^^^^^^^ F704
+ | ^^^^^^^^^^^^
11 | await f()
|
-F704.py:11:1: F704 `await` statement outside of a function
+F704 `await` statement outside of a function
+ --> F704.py:11:1
|
9 | yield 3
10 | yield from 3
11 | await f()
- | ^^^^^^^^^ F704
+ | ^^^^^^^^^
12 |
13 | def _():
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap
index c6f545f5af..a547bebd4f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F706.py:6:5: F706 `return` statement outside of a function/method
+F706 `return` statement outside of a function/method
+ --> F706.py:6:5
|
5 | class Foo:
6 | return 2
- | ^^^^^^^^ F706
+ | ^^^^^^^^
|
-F706.py:9:1: F706 `return` statement outside of a function/method
+F706 `return` statement outside of a function/method
+ --> F706.py:9:1
|
9 | return 3
- | ^^^^^^^^ F706
+ | ^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F707_F707.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F707_F707.py.snap
index 7cb4461bd3..24dd7e01de 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F707_F707.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F707_F707.py.snap
@@ -1,33 +1,35 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F707.py:3:1: F707 An `except` block as not the last exception handler
+F707 An `except` block as not the last exception handler
+ --> F707.py:3:1
|
1 | try:
2 | pass
3 | except:
- | ^^^^^^ F707
+ | ^^^^^^
4 | pass
5 | except ValueError:
|
-F707.py:10:1: F707 An `except` block as not the last exception handler
+F707 An `except` block as not the last exception handler
+ --> F707.py:10:1
|
8 | try:
9 | pass
10 | except:
- | ^^^^^^ F707
+ | ^^^^^^
11 | pass
12 | except ValueError:
|
-F707.py:19:1: F707 An `except` block as not the last exception handler
+F707 An `except` block as not the last exception handler
+ --> F707.py:19:1
|
17 | try:
18 | pass
19 | except:
- | ^^^^^^ F707
+ | ^^^^^^
20 | pass
21 | except ValueError:
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap
index 54646f4ff3..674c6f2bf2 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap
@@ -1,22 +1,25 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F722.py:9:12: F722 Syntax error in forward annotation: Expected an expression
+F722 Syntax error in forward annotation: Expected an expression
+ --> F722.py:9:12
|
9 | def g() -> "///":
- | ^^^^^ F722
+ | ^^^^^
10 | pass
|
-F722.py:13:4: F722 Syntax error in forward annotation: Got unexpected token ☃
+F722 Syntax error in forward annotation: Got unexpected token ☃
+ --> F722.py:13:4
|
13 | X: """List[int]"""'☃' = []
- | ^^^^^^^^^^^^^^^^^^ F722
+ | ^^^^^^^^^^^^^^^^^^
14 |
15 | # Type annotations with triple quotes can contain newlines and indentation
|
-F722.py:30:11: F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+ --> F722.py:30:11
|
28 | """
29 |
@@ -25,12 +28,13 @@ F722.py:30:11: F722 Syntax error in forward annotation: Unexpected token at the
31 | | int |
32 | | str)
33 | | """
- | |___^ F722
+ | |___^
34 |
35 | invalid2: """
|
-F722.py:35:11: F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+ --> F722.py:35:11
|
33 | """
34 |
@@ -39,12 +43,13 @@ F722.py:35:11: F722 Syntax error in forward annotation: Unexpected token at the
36 | | int) |
37 | | str
38 | | """
- | |___^ F722
+ | |___^
39 | invalid3: """
40 | ((int)
|
-F722.py:39:11: F722 Syntax error in forward annotation: unexpected EOF while parsing
+F722 Syntax error in forward annotation: unexpected EOF while parsing
+ --> F722.py:39:11
|
37 | str
38 | """
@@ -52,12 +57,13 @@ F722.py:39:11: F722 Syntax error in forward annotation: unexpected EOF while par
| ___________^
40 | | ((int)
41 | | """
- | |___^ F722
+ | |___^
42 | invalid4: """
43 | (int
|
-F722.py:42:11: F722 Syntax error in forward annotation: unexpected EOF while parsing
+F722 Syntax error in forward annotation: unexpected EOF while parsing
+ --> F722.py:42:11
|
40 | ((int)
41 | """
@@ -65,5 +71,5 @@ F722.py:42:11: F722 Syntax error in forward annotation: unexpected EOF while par
| ___________^
43 | | (int
44 | | """
- | |___^ F722
+ | |___^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap
index 1fd4f43abd..c01fb48cff 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap
@@ -1,28 +1,31 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F722_1.py:8:22: F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+ --> F722_1.py:8:22
|
6 | @no_type_check
7 | class C:
8 | def f(self, arg: "this isn't python") -> "this isn't python either":
- | ^^^^^^^^^^^^^^^^^^^ F722
+ | ^^^^^^^^^^^^^^^^^^^
9 | x: "this also isn't python" = 1
|
-F722_1.py:8:46: F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+ --> F722_1.py:8:46
|
6 | @no_type_check
7 | class C:
8 | def f(self, arg: "this isn't python") -> "this isn't python either":
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ F722
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | x: "this also isn't python" = 1
|
-F722_1.py:9:12: F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+F722 Syntax error in forward annotation: Unexpected token at the end of an expression
+ --> F722_1.py:9:12
|
7 | class C:
8 | def f(self, arg: "this isn't python") -> "this isn't python either":
9 | x: "this also isn't python" = 1
- | ^^^^^^^^^^^^^^^^^^^^^^^^ F722
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_0.py.snap
index 8b084ccac6..9dbabf2cf2 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_0.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_0.py:10:5: F811 Redefinition of unused `bar` from line 6
+F811 Redefinition of unused `bar` from line 6
+ --> F811_0.py:10:5
|
10 | def bar():
- | ^^^ F811
+ | ^^^
11 | pass
|
- = help: Remove definition: `bar`
+help: Remove definition: `bar`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap
index 7c96ecba03..e666db4b81 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_1.py:1:25: F811 Redefinition of unused `FU` from line 1
+F811 Redefinition of unused `FU` from line 1
+ --> F811_1.py:1:25
|
1 | import fu as FU, bar as FU
- | ^^ F811
+ | ^^
|
- = help: Remove definition: `FU`
+help: Remove definition: `FU`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap
index cd7495ada0..58f521edf0 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_12.py:6:20: F811 Redefinition of unused `mixer` from line 2
+F811 Redefinition of unused `mixer` from line 2
+ --> F811_12.py:6:20
|
4 | pass
5 | else:
6 | from bb import mixer
- | ^^^^^ F811
+ | ^^^^^
7 | mixer(123)
|
- = help: Remove definition: `mixer`
+help: Remove definition: `mixer`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap
index eb43408a7c..d457a39a20 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_15.py:4:5: F811 Redefinition of unused `fu` from line 1
+F811 Redefinition of unused `fu` from line 1
+ --> F811_15.py:4:5
|
4 | def fu():
- | ^^ F811
+ | ^^
5 | pass
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap
index af91808f2d..f8a1351dff 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_16.py:8:13: F811 Redefinition of unused `fu` from line 3
+F811 Redefinition of unused `fu` from line 3
+ --> F811_16.py:8:13
|
6 | def bar():
7 | def baz():
8 | def fu():
- | ^^ F811
+ | ^^
9 | pass
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap
index 367f5873a0..6e16f53992 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_17.py:6:12: F811 [*] Redefinition of unused `fu` from line 2
+F811 [*] Redefinition of unused `fu` from line 2
+ --> F811_17.py:6:12
|
5 | def bar():
6 | import fu
- | ^^ F811
+ | ^^
7 |
8 | def baz():
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
ℹ Safe fix
3 3 |
@@ -20,11 +21,12 @@ F811_17.py:6:12: F811 [*] Redefinition of unused `fu` from line 2
8 7 | def baz():
9 8 | def fu():
-F811_17.py:9:13: F811 Redefinition of unused `fu` from line 6
+F811 Redefinition of unused `fu` from line 6
+ --> F811_17.py:9:13
|
8 | def baz():
9 | def fu():
- | ^^ F811
+ | ^^
10 | pass
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap
index 3dcdb002cb..05ec31f26c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_2.py:1:34: F811 Redefinition of unused `FU` from line 1
+F811 Redefinition of unused `FU` from line 1
+ --> F811_2.py:1:34
|
1 | from moo import fu as FU, bar as FU
- | ^^ F811
+ | ^^
|
- = help: Remove definition: `FU`
+help: Remove definition: `FU`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_21.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_21.py.snap
index 8432ce531c..9cf6effbe6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_21.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_21.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_21.py:32:5: F811 [*] Redefinition of unused `Sequence` from line 26
+F811 [*] Redefinition of unused `Sequence` from line 26
+ --> F811_21.py:32:5
|
30 | from typing import (
31 | List, # noqa: F811
32 | Sequence,
- | ^^^^^^^^ F811
+ | ^^^^^^^^
33 | )
|
- = help: Remove definition: `Sequence`
+help: Remove definition: `Sequence`
ℹ Safe fix
27 27 | )
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap
index b503ae6f3b..d56b340e5b 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_23.py:4:15: F811 Redefinition of unused `foo` from line 3
+F811 Redefinition of unused `foo` from line 3
+ --> F811_23.py:4:15
|
3 | import foo as foo
4 | import bar as foo
- | ^^^ F811
+ | ^^^
|
- = help: Remove definition: `foo`
+help: Remove definition: `foo`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap
index 91cacac98d..2a8febc47c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_26.py:5:9: F811 Redefinition of unused `func` from line 2
+F811 Redefinition of unused `func` from line 2
+ --> F811_26.py:5:9
|
3 | pass
4 |
5 | def func(self):
- | ^^^^ F811
+ | ^^^^
6 | pass
|
- = help: Remove definition: `func`
+help: Remove definition: `func`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap
index 69b2869a43..302c8ebf9f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_28.py:4:22: F811 Redefinition of unused `datetime` from line 3
+F811 Redefinition of unused `datetime` from line 3
+ --> F811_28.py:4:22
|
3 | import datetime
4 | from datetime import datetime
- | ^^^^^^^^ F811
+ | ^^^^^^^^
5 |
6 | datetime(1, 2, 3)
|
- = help: Remove definition: `datetime`
+help: Remove definition: `datetime`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap
index b67239e5d4..d2a1b5e0ca 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap
@@ -1,11 +1,12 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_29.pyi:8:1: F811 Redefinition of unused `Bar` from line 3
+F811 Redefinition of unused `Bar` from line 3
+ --> F811_29.pyi:8:1
|
6 | Bar: int # OK
7 |
8 | Bar = 1 # F811
- | ^^^ F811
+ | ^^^
|
- = help: Remove definition: `Bar`
+help: Remove definition: `Bar`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap
index 430522582f..2e51c6831c 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_3.py:1:12: F811 Redefinition of unused `fu` from line 1
+F811 Redefinition of unused `fu` from line 1
+ --> F811_3.py:1:12
|
1 | import fu; fu = 3
- | ^^ F811
+ | ^^
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap
index b2955d6075..09bae7b514 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap
@@ -1,30 +1,33 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_30.py:12:9: F811 Redefinition of unused `bar` from line 10
+F811 Redefinition of unused `bar` from line 10
+ --> F811_30.py:12:9
|
10 | bar = foo
11 |
12 | def bar(self) -> None:
- | ^^^ F811
+ | ^^^
13 | """Bar."""
|
- = help: Remove definition: `bar`
+help: Remove definition: `bar`
-F811_30.py:21:5: F811 Redefinition of unused `baz` from line 18
+F811 Redefinition of unused `baz` from line 18
+ --> F811_30.py:21:5
|
19 | """Baz."""
20 |
21 | baz = 1
- | ^^^ F811
+ | ^^^
|
- = help: Remove definition: `baz`
+help: Remove definition: `baz`
-F811_30.py:29:12: F811 Redefinition of unused `foo` from line 26
+F811 Redefinition of unused `foo` from line 26
+ --> F811_30.py:29:12
|
27 | """Foo."""
28 |
29 | bar = (foo := 1)
- | ^^^ F811
+ | ^^^
|
- = help: Remove definition: `foo`
+help: Remove definition: `foo`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap
index bb4eb97b10..7a08ea3888 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_31.py:19:29: F811 Redefinition of unused `baz` from line 17
+F811 Redefinition of unused `baz` from line 17
+ --> F811_31.py:19:29
|
17 | baz = None
18 |
19 | from some_module import baz
- | ^^^ F811
+ | ^^^
20 | except ImportError:
21 | pass
|
- = help: Remove definition: `baz`
+help: Remove definition: `baz`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap
index 8424433dd2..6b00fc2d31 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F811_32.py:5:5: F811 [*] Redefinition of unused `List` from line 4
+F811 [*] Redefinition of unused `List` from line 4
+ --> F811_32.py:5:5
|
3 | from typing import (
4 | List,
5 | List,
- | ^^^^ F811
+ | ^^^^
6 | )
|
- = help: Remove definition: `List`
+help: Remove definition: `List`
ℹ Safe fix
2 2 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap
index dfccff0534..11bb7bd824 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_4.py:1:12: F811 Redefinition of unused `fu` from line 1
+F811 Redefinition of unused `fu` from line 1
+ --> F811_4.py:1:12
|
1 | import fu; fu, bar = 3
- | ^^ F811
+ | ^^
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap
index 0a44f240a5..908d45c1bb 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_5.py:1:13: F811 Redefinition of unused `fu` from line 1
+F811 Redefinition of unused `fu` from line 1
+ --> F811_5.py:1:13
|
1 | import fu; [fu, bar] = 3
- | ^^ F811
+ | ^^
|
- = help: Remove definition: `fu`
+help: Remove definition: `fu`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap
index 5c2de08fd9..e2c3c0cf88 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_6.py:6:12: F811 [*] Redefinition of unused `os` from line 5
+F811 [*] Redefinition of unused `os` from line 5
+ --> F811_6.py:6:12
|
4 | if i == 1:
5 | import os
6 | import os
- | ^^ F811
+ | ^^
7 | os.path
|
- = help: Remove definition: `os`
+help: Remove definition: `os`
ℹ Safe fix
3 3 | i = 2
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap
index 186d426ff2..a3236f8fbe 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F811_8.py:5:12: F811 [*] Redefinition of unused `os` from line 4
+F811 [*] Redefinition of unused `os` from line 4
+ --> F811_8.py:5:12
|
3 | try:
4 | import os
5 | import os
- | ^^ F811
+ | ^^
6 | except:
7 | pass
|
- = help: Remove definition: `os`
+help: Remove definition: `os`
ℹ Safe fix
2 2 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap
index ad83ffe0ac..fd16a70827 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap
@@ -1,115 +1,128 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_0.py:2:12: F821 Undefined name `self`
+F821 Undefined name `self`
+ --> F821_0.py:2:12
|
1 | def get_name():
2 | return self.name
- | ^^^^ F821
+ | ^^^^
|
-F821_0.py:6:13: F821 Undefined name `self`
+F821 Undefined name `self`
+ --> F821_0.py:6:13
|
5 | def get_name():
6 | return (self.name,)
- | ^^^^ F821
+ | ^^^^
|
-F821_0.py:10:9: F821 Undefined name `self`
+F821 Undefined name `self`
+ --> F821_0.py:10:9
|
9 | def get_name():
10 | del self.name
- | ^^^^ F821
+ | ^^^^
|
-F821_0.py:21:12: F821 Undefined name `numeric_string`
+F821 Undefined name `numeric_string`
+ --> F821_0.py:21:12
|
20 | def randdec(maxprec, maxexp):
21 | return numeric_string(maxprec, maxexp)
- | ^^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^^
|
-F821_0.py:58:5: F821 Undefined name `Bar`
+F821 Undefined name `Bar`
+ --> F821_0.py:58:5
|
56 | y: int = 1
57 |
58 | x: "Bar" = 1
- | ^^^ F821
+ | ^^^
59 |
60 | [first] = ["yup"]
|
-F821_0.py:83:11: F821 Undefined name `TOMATO`
+F821 Undefined name `TOMATO`
+ --> F821_0.py:83:11
|
82 | def update_tomato():
83 | print(TOMATO)
- | ^^^^^^ F821
+ | ^^^^^^
84 | TOMATO = "cherry tomato"
|
-F821_0.py:87:8: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_0.py:87:8
|
87 | A = f'{B}'
- | ^ F821
+ | ^
88 | A = (
89 | f'B'
|
-F821_0.py:90:8: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_0.py:90:8
|
88 | A = (
89 | f'B'
90 | f'{B}'
- | ^ F821
+ | ^
91 | )
92 | C = f'{A:{B}}'
|
-F821_0.py:92:11: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_0.py:92:11
|
90 | f'{B}'
91 | )
92 | C = f'{A:{B}}'
- | ^ F821
+ | ^
93 | C = f'{A:{f"{B}"}}'
|
-F821_0.py:93:14: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_0.py:93:14
|
91 | )
92 | C = f'{A:{B}}'
93 | C = f'{A:{f"{B}"}}'
- | ^ F821
+ | ^
94 |
95 | from typing import Annotated, Literal
|
-F821_0.py:115:10: F821 Undefined name `PEP593Test123`
+F821 Undefined name `PEP593Test123`
+ --> F821_0.py:115:10
|
113 | ]
114 | field_with_undefined_stringified_type: Annotated[
115 | "PEP593Test123",
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
116 | 123,
117 | ]
|
-F821_0.py:123:15: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> F821_0.py:123:15
|
121 | ]
122 | field_with_undefined_nested_subscript: Annotated[
123 | dict["foo", "bar"], # Expected to fail as undefined.
- | ^^^ F821
+ | ^^^
124 | 123,
125 | ]
|
-F821_0.py:123:22: F821 Undefined name `bar`
+F821 Undefined name `bar`
+ --> F821_0.py:123:22
|
121 | ]
122 | field_with_undefined_nested_subscript: Annotated[
123 | dict["foo", "bar"], # Expected to fail as undefined.
- | ^^^ F821
+ | ^^^
124 | 123,
125 | ]
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap
index 388a7b77a3..7df73254f3 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap
@@ -1,31 +1,34 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_1.py:11:11: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_1.py:11:11
|
10 | # F821 Undefined name `Model`
11 | x = cast("Model", x)
- | ^^^^^ F821
+ | ^^^^^
|
-F821_1.py:18:18: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_1.py:18:18
|
17 | # F821 Undefined name `Model`
18 | x = typing.cast("Model", x)
- | ^^^^^ F821
+ | ^^^^^
|
-F821_1.py:24:14: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_1.py:24:14
|
23 | # F821 Undefined name `Model`
24 | x = Pattern["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
-F821_1.py:30:12: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_1.py:30:12
|
29 | # F821 Undefined name `Model`
30 | x = Match["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap
index fe57c5320d..18a0d3e859 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_11.py:18:28: F821 Undefined name `os`
+F821 Undefined name `os`
+ --> F821_11.py:18:28
|
18 | def f(x: Callable[[VarArg("os")], None]): # F821
- | ^^ F821
+ | ^^
19 | pass
|
-F821_11.py:23:14: F821 Undefined name `Baz`
+F821 Undefined name `Baz`
+ --> F821_11.py:23:14
|
22 | f(Callable[["Bar"], None])
23 | f(Callable[["Baz"], None])
- | ^^^ F821
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.pyi.snap
index 9716d11d90..3af4836d2d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.pyi.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.pyi.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_11.pyi:15:28: F821 Undefined name `os`
+F821 Undefined name `os`
+ --> F821_11.pyi:15:28
|
15 | def f(x: Callable[[VarArg("os")], None]): # F821
- | ^^ F821
+ | ^^
16 | pass
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap
index d2b5a37fd2..fda19cffaf 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_12.py:20:28: F821 Undefined name `os`
+F821 Undefined name `os`
+ --> F821_12.py:20:28
|
20 | def f(x: Callable[[VarArg("os")], None]): # F821
- | ^^ F821
+ | ^^
21 | pass
|
-F821_12.py:25:14: F821 Undefined name `Baz`
+F821 Undefined name `Baz`
+ --> F821_12.py:25:14
|
24 | f(Callable[["Bar"], None])
25 | f(Callable[["Baz"], None])
- | ^^^ F821
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap
index d156dc3ea9..0b977f2213 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_13.py:8:19: F821 Undefined name `List`
+F821 Undefined name `List`
+ --> F821_13.py:8:19
|
6 | Y: ForwardRef("List[int]")
7 |
8 | Z = TypeVar("X", "List[int]", "int")
- | ^^^^ F821
+ | ^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap
index ad86315ccc..fbbd199636 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap
@@ -1,267 +1,296 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_17.py:16:12: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:16:12
|
14 | # Types used in aliased assignment must exist
15 |
16 | type Foo = DoesNotExist # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
17 | type Foo = list[DoesNotExist] # F821: Undefined name `DoesNotExist`
|
-F821_17.py:17:17: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:17:17
|
16 | type Foo = DoesNotExist # F821: Undefined name `DoesNotExist`
17 | type Foo = list[DoesNotExist] # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
18 |
19 | # Type parameters do not escape alias scopes
|
-F821_17.py:22:1: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:22:1
|
21 | type Foo[T] = T
22 | T # F821: Undefined name `T` - not accessible afterward alias scope
- | ^ F821
+ | ^
23 |
24 | # Type parameters in functions
|
-F821_17.py:39:17: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:39:17
|
37 | from some_library import some_decorator
38 |
39 | @some_decorator(T) # F821: Undefined name `T` - not accessible in decorators
- | ^ F821
+ | ^
40 |
41 | def foo[T](t: T) -> None: ...
|
-F821_17.py:42:1: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:42:1
|
41 | def foo[T](t: T) -> None: ...
42 | T # F821: Undefined name `T` - not accessible afterward function scope
- | ^ F821
+ | ^
|
-F821_17.py:64:17: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:64:17
|
63 | from some_library import some_decorator
64 | @some_decorator(T) # F821: Undefined name `T` - not accessible in decorators
- | ^ F821
+ | ^
65 |
66 | class Foo[T](list[T]): ...
|
-F821_17.py:67:1: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:67:1
|
66 | class Foo[T](list[T]): ...
67 | T # F821: Undefined name `T` - not accessible after class scope
- | ^ F821
+ | ^
68 |
69 | # Types specified in bounds should exist
|
-F821_17.py:71:13: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:71:13
|
69 | # Types specified in bounds should exist
70 |
71 | type Foo[T: DoesNotExist] = T # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
72 | def foo[T: DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
73 | class Foo[T: DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
|
-F821_17.py:72:12: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:72:12
|
71 | type Foo[T: DoesNotExist] = T # F821: Undefined name `DoesNotExist`
72 | def foo[T: DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
73 | class Foo[T: DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
|
-F821_17.py:73:14: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:73:14
|
71 | type Foo[T: DoesNotExist] = T # F821: Undefined name `DoesNotExist`
72 | def foo[T: DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
73 | class Foo[T: DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
74 |
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:75:14: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:75:14
|
73 | class Foo[T: DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
74 |
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:75:29: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:75:29
|
73 | class Foo[T: DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
74 |
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:76:13: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:76:13
|
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:76:28: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:76:28
|
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:77:15: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:77:15
|
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
78 |
79 | # Same in defaults
|
-F821_17.py:77:30: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:77:30
|
75 | type Foo[T: (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
76 | def foo[T: (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
77 | class Foo[T: (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
78 |
79 | # Same in defaults
|
-F821_17.py:81:14: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:81:14
|
79 | # Same in defaults
80 |
81 | type Foo[T = DoesNotExist] = T # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
82 | def foo[T = DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
83 | class Foo[T = DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
|
-F821_17.py:82:13: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:82:13
|
81 | type Foo[T = DoesNotExist] = T # F821: Undefined name `DoesNotExist`
82 | def foo[T = DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
83 | class Foo[T = DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
|
-F821_17.py:83:15: F821 Undefined name `DoesNotExist`
+F821 Undefined name `DoesNotExist`
+ --> F821_17.py:83:15
|
81 | type Foo[T = DoesNotExist] = T # F821: Undefined name `DoesNotExist`
82 | def foo[T = DoesNotExist](t: T) -> T: return t # F821: Undefined name `DoesNotExist`
83 | class Foo[T = DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
- | ^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^
84 |
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:85:15: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:85:15
|
83 | class Foo[T = DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
84 |
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:85:30: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:85:30
|
83 | class Foo[T = DoesNotExist](list[T]): ... # F821: Undefined name `DoesNotExist`
84 |
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:86:14: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:86:14
|
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:86:29: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:86:29
|
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
|
-F821_17.py:87:16: F821 Undefined name `DoesNotExist1`
+F821 Undefined name `DoesNotExist1`
+ --> F821_17.py:87:16
|
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
88 |
89 | # Type parameters in nested classes
|
-F821_17.py:87:31: F821 Undefined name `DoesNotExist2`
+F821 Undefined name `DoesNotExist2`
+ --> F821_17.py:87:31
|
85 | type Foo[T = (DoesNotExist1, DoesNotExist2)] = T # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
86 | def foo[T = (DoesNotExist1, DoesNotExist2)](t: T) -> T: return t # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist…
87 | class Foo[T = (DoesNotExist1, DoesNotExist2)](list[T]): ... # F821: Undefined name `DoesNotExist1`, Undefined name `DoesNotExist2`
- | ^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^
88 |
89 | # Type parameters in nested classes
|
-F821_17.py:102:52: F821 Undefined name `t`
+F821 Undefined name `t`
+ --> F821_17.py:102:52
|
100 | return x
101 |
102 | def cannot_access_parent_variable(self, x: t) -> t: # F821: Undefined name `T`
- | ^ F821
+ | ^
103 | t # F821: Undefined name `t`
104 | return x
|
-F821_17.py:102:58: F821 Undefined name `t`
+F821 Undefined name `t`
+ --> F821_17.py:102:58
|
100 | return x
101 |
102 | def cannot_access_parent_variable(self, x: t) -> t: # F821: Undefined name `T`
- | ^ F821
+ | ^
103 | t # F821: Undefined name `t`
104 | return x
|
-F821_17.py:103:17: F821 Undefined name `t`
+F821 Undefined name `t`
+ --> F821_17.py:103:17
|
102 | def cannot_access_parent_variable(self, x: t) -> t: # F821: Undefined name `T`
103 | t # F821: Undefined name `t`
- | ^ F821
+ | ^
104 | return x
|
-F821_17.py:116:40: F821 Undefined name `T`
+F821 Undefined name `T`
+ --> F821_17.py:116:40
|
116 | def cannot_access_in_default[T](t: T = T): # F821
- | ^ F821
+ | ^
117 | pass
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap
index 65844fc9f6..022fe287ba 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_19.py:21:7: F821 Undefined name `y`
+F821 Undefined name `y`
+ --> F821_19.py:21:7
|
19 | # Error: `y` is not defined.
20 | x: (y := 1)
21 | print(y)
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_2.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_2.py.snap
index 643cc2a4cb..89dd2df81f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_2.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_2.py.snap
@@ -1,11 +1,12 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_2.py:5:13: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_2.py:5:13
|
4 | # F821 Undefined name `Model`
5 | x: Literal["Model"]
- | ^^^^^ F821
+ | ^^^^^
6 |
7 | from typing_extensions import Literal
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_20.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_20.py.snap
index f791abbfcc..9cdeb20f40 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_20.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_20.py.snap
@@ -1,12 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_20.py:3:24: F821 Undefined name `Record`
+F821 Undefined name `Record`
+ --> F821_20.py:3:24
|
1 | """Test lazy evaluation of type alias values."""
2 |
3 | type RecordCallback[R: Record] = Callable[[R], None]
- | ^^^^^^ F821
+ | ^^^^^^
4 |
5 | from collections.abc import Callable
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap
index dd8c65c608..4e5196ca9d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_21.py:4:1: F821 Undefined name `display`
+F821 Undefined name `display`
+ --> F821_21.py:4:1
|
3 | x = 1
4 | display(x)
- | ^^^^^^^ F821
+ | ^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap
index 0fe9ae3d00..9bb838ffff 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_26.py.snap
@@ -1,84 +1,92 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_26.py:9:33: F821 Undefined name `CStr`
+F821 Undefined name `CStr`
+ --> F821_26.py:9:33
|
8 | # Forward references:
9 | MaybeCStr: TypeAlias = Optional[CStr] # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^^^^ F821
+ | ^^^^
10 | MaybeCStr2: TypeAlias = Optional["CStr"] # always okay
11 | CStr: TypeAlias = Union[C, str] # valid in a `.pyi` stub file, not in a `.py` runtime file
|
-F821_26.py:11:25: F821 Undefined name `C`
+F821 Undefined name `C`
+ --> F821_26.py:11:25
|
9 | MaybeCStr: TypeAlias = Optional[CStr] # valid in a `.pyi` stub file, not in a `.py` runtime file
10 | MaybeCStr2: TypeAlias = Optional["CStr"] # always okay
11 | CStr: TypeAlias = Union[C, str] # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^ F821
+ | ^
12 | CStr2: TypeAlias = Union["C", str] # always okay
|
-F821_26.py:16:12: F821 Undefined name `C`
+F821 Undefined name `C`
+ --> F821_26.py:16:12
|
14 | # References to a class from inside the class:
15 | class C:
16 | other: C = ... # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^ F821
+ | ^
17 | other2: "C" = ... # always okay
18 | def from_str(self, s: str) -> C: ... # valid in a `.pyi` stub file, not in a `.py` runtime file
|
-F821_26.py:18:35: F821 Undefined name `C`
+F821 Undefined name `C`
+ --> F821_26.py:18:35
|
16 | other: C = ... # valid in a `.pyi` stub file, not in a `.py` runtime file
17 | other2: "C" = ... # always okay
18 | def from_str(self, s: str) -> C: ... # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^ F821
+ | ^
19 | def from_str2(self, s: str) -> "C": ... # always okay
|
-F821_26.py:23:10: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_26.py:23:10
|
21 | # Circular references:
22 | class A:
23 | foo: B # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^ F821
+ | ^
24 | foo2: "B" # always okay
25 | bar: dict[str, B] # valid in a `.pyi` stub file, not in a `.py` runtime file
|
-F821_26.py:25:20: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_26.py:25:20
|
23 | foo: B # valid in a `.pyi` stub file, not in a `.py` runtime file
24 | foo2: "B" # always okay
25 | bar: dict[str, B] # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^ F821
+ | ^
26 | bar2: dict[str, "A"] # always okay
|
-F821_26.py:33:17: F821 Undefined name `Tree`
+F821 Undefined name `Tree`
+ --> F821_26.py:33:17
|
32 | class Leaf: ...
33 | class Tree(list[Tree | Leaf]): ... # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^^^^ F821
+ | ^^^^
34 | class Tree2(list["Tree | Leaf"]): ... # always okay
|
-F821_26.py:39:11: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> F821_26.py:39:11
|
37 | class MyClass:
38 | foo: int
39 | bar = foo # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^^^ F821
+ | ^^^
40 | bar = "foo" # always okay
|
-F821_26.py:43:8: F821 Undefined name `baz`
+F821 Undefined name `baz`
+ --> F821_26.py:43:8
|
42 | baz: MyClass
43 | eggs = baz # valid in a `.pyi` stub file, not in a `.py` runtime file
- | ^^^ F821
+ | ^^^
44 | eggs = "baz" # always okay
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_27.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_27.py.snap
index eb74e0d2aa..ba6f4776a6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_27.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_27.py.snap
@@ -1,47 +1,51 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_27.py:30:11: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> F821_27.py:30:11
|
28 | class MyClass:
29 | foo: int
30 | bar = foo # Still invalid even when `__future__.annotations` are enabled
- | ^^^ F821
+ | ^^^
31 | bar = "foo" # always okay
|
-F821_27.py:34:8: F821 Undefined name `baz`
+F821 Undefined name `baz`
+ --> F821_27.py:34:8
|
33 | baz: MyClass
34 | eggs = baz # Still invalid even when `__future__.annotations` are enabled
- | ^^^ F821
+ | ^^^
35 | eggs = "baz" # always okay
|
-F821_27.py:38:33: F821 Undefined name `DStr`
+F821 Undefined name `DStr`
+ --> F821_27.py:38:33
|
37 | # Forward references:
38 | MaybeDStr: TypeAlias = Optional[DStr] # Still invalid even when `__future__.annotations` are enabled
- | ^^^^ F821
+ | ^^^^
39 | MaybeDStr2: TypeAlias = Optional["DStr"] # always okay
40 | DStr: TypeAlias = Union[D, str] # Still invalid even when `__future__.annotations` are enabled
|
-F821_27.py:40:25: F821 Undefined name `D`
+F821 Undefined name `D`
+ --> F821_27.py:40:25
|
38 | MaybeDStr: TypeAlias = Optional[DStr] # Still invalid even when `__future__.annotations` are enabled
39 | MaybeDStr2: TypeAlias = Optional["DStr"] # always okay
40 | DStr: TypeAlias = Union[D, str] # Still invalid even when `__future__.annotations` are enabled
- | ^ F821
+ | ^
41 | DStr2: TypeAlias = Union["D", str] # always okay
|
-F821_27.py:47:17: F821 Undefined name `Tree`
+F821 Undefined name `Tree`
+ --> F821_27.py:47:17
|
45 | # More circular references
46 | class Leaf: ...
47 | class Tree(list[Tree | Leaf]): ... # Still invalid even when `__future__.annotations` are enabled
- | ^^^^ F821
+ | ^^^^
48 | class Tree2(list["Tree | Leaf"]): ... # always okay
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap
index 56103d85ad..348d12a438 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_28.py:9:7: F821 Undefined name `𝒟`
+F821 Undefined name `𝒟`
+ --> F821_28.py:9:7
|
7 | print(C == 𝑪 == 𝒞 == 𝓒 == 𝕮)
8 |
9 | print(𝒟) # F821
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_3.py.snap
index 2f06a91e4c..32833e46d4 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_3.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_3.py.snap
@@ -1,22 +1,24 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_3.py:11:10: F821 Undefined name `key`
+F821 Undefined name `key`
+ --> F821_3.py:11:10
|
9 | # F821 Undefined name `key`
10 | # F821 Undefined name `value`
11 | x: dict["key", "value"]
- | ^^^ F821
+ | ^^^
12 |
13 | # OK
|
-F821_3.py:11:17: F821 Undefined name `value`
+F821 Undefined name `value`
+ --> F821_3.py:11:17
|
9 | # F821 Undefined name `key`
10 | # F821 Undefined name `value`
11 | x: dict["key", "value"]
- | ^^^^^ F821
+ | ^^^^^
12 |
13 | # OK
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_30.py.snap
index d39ce19805..b7fa1df5bf 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_30.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_30.py.snap
@@ -1,50 +1,54 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_30.py:13:18: F821 Undefined name `qux`
+F821 Undefined name `qux`
+ --> F821_30.py:13:18
|
11 | multiple: TypedDict[{
12 | "bar": str,
13 | "baz": list["qux"],
- | ^^^ F821
+ | ^^^
14 | }]
|
-F821_30.py:19:19: F821 Undefined name `dolor`
+F821 Undefined name `dolor`
+ --> F821_30.py:19:19
|
17 | nested: TypedDict[
18 | "lorem": TypedDict[{
19 | "ipsum": "dolor"
- | ^^^^^ F821
+ | ^^^^^
20 | }],
21 | "sit": Literal["amet"]
|
-F821_30.py:26:31: F821 Undefined name `adipiscing`
+F821 Undefined name `adipiscing`
+ --> F821_30.py:26:31
|
24 | # Error at `adipiscing`, `eiusmod`, `tempor`
25 | unpack: TypedDict[{
26 | "consectetur": Annotated["adipiscing", "elit"]
- | ^^^^^^^^^^ F821
+ | ^^^^^^^^^^
27 | **{"sed do": str, int: "eiusmod", **tempor}
28 | }]
|
-F821_30.py:27:29: F821 Undefined name `eiusmod`
+F821 Undefined name `eiusmod`
+ --> F821_30.py:27:29
|
25 | unpack: TypedDict[{
26 | "consectetur": Annotated["adipiscing", "elit"]
27 | **{"sed do": str, int: "eiusmod", **tempor}
- | ^^^^^^^ F821
+ | ^^^^^^^
28 | }]
|
-F821_30.py:27:41: F821 Undefined name `tempor`
+F821 Undefined name `tempor`
+ --> F821_30.py:27:41
|
25 | unpack: TypedDict[{
26 | "consectetur": Annotated["adipiscing", "elit"]
27 | **{"sed do": str, int: "eiusmod", **tempor}
- | ^^^^^^ F821
+ | ^^^^^^
28 | }]
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap
index c2a8132015..c1a10a41ff 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap
@@ -1,53 +1,58 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_31.py:8:23: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_31.py:8:23
|
6 | @typing.no_type_check
7 | class C:
8 | def f(self, arg: "B") -> "S":
- | ^ F821
+ | ^
9 | x: "B" = 1
|
-F821_31.py:8:31: F821 Undefined name `S`
+F821 Undefined name `S`
+ --> F821_31.py:8:31
|
6 | @typing.no_type_check
7 | class C:
8 | def f(self, arg: "B") -> "S":
- | ^ F821
+ | ^
9 | x: "B" = 1
|
-F821_31.py:9:13: F821 Undefined name `B`
+F821 Undefined name `B`
+ --> F821_31.py:9:13
|
7 | class C:
8 | def f(self, arg: "B") -> "S":
9 | x: "B" = 1
- | ^ F821
+ | ^
|
-F821_31.py:15:13: F821 Undefined name `A`
+F821 Undefined name `A`
+ --> F821_31.py:15:13
|
14 | @typing.no_type_check
15 | def f(arg: "A") -> "R":
- | ^ F821
+ | ^
16 | x: "A" = 1
|
-F821_31.py:15:21: F821 Undefined name `R`
+F821 Undefined name `R`
+ --> F821_31.py:15:21
|
14 | @typing.no_type_check
15 | def f(arg: "A") -> "R":
- | ^ F821
+ | ^
16 | x: "A" = 1
|
-F821_31.py:16:9: F821 Undefined name `A`
+F821 Undefined name `A`
+ --> F821_31.py:16:9
|
14 | @typing.no_type_check
15 | def f(arg: "A") -> "R":
16 | x: "A" = 1
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap
index 9077bbc312..dc5ceec156 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap
@@ -1,42 +1,47 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F821_4.py:4:11: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_4.py:4:11
|
2 | from typing import List
3 |
4 | _ = List["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
-F821_4.py:9:12: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_4.py:9:12
|
7 | from typing import List as IList
8 |
9 | _ = IList["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
-F821_4.py:14:16: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_4.py:14:16
|
12 | from collections.abc import ItemsView
13 |
14 | _ = ItemsView["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
-F821_4.py:19:32: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_4.py:19:32
|
17 | import collections.abc
18 |
19 | _ = collections.abc.ItemsView["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
-F821_4.py:24:20: F821 Undefined name `Model`
+F821 Undefined name `Model`
+ --> F821_4.py:24:20
|
22 | from collections import abc
23 |
24 | _ = abc.ItemsView["Model"]
- | ^^^^^ F821
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.py.snap
index bbd0104185..bed48f547e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_5.py:5:31: F821 Undefined name `InnerClass`
+F821 Undefined name `InnerClass`
+ --> F821_5.py:5:31
|
4 | class RandomClass:
5 | def random_func(self) -> "InnerClass":
- | ^^^^^^^^^^ F821
+ | ^^^^^^^^^^
6 | pass
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.pyi.snap
index a7d8933102..b827875c1d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.pyi.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_5.pyi.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_5.pyi:4:27: F821 Undefined name `InnerClass`
+F821 Undefined name `InnerClass`
+ --> F821_5.pyi:4:27
|
3 | class RandomClass:
4 | def bad_func(self) -> InnerClass: ... # F821
- | ^^^^^^^^^^ F821
+ | ^^^^^^^^^^
5 | def good_func(self) -> OuterClass.InnerClass: ... # Okay
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap
index 727e8cd87a..a818f1c1f9 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap
@@ -1,29 +1,31 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_7.py:11:22: F821 Undefined name `Undefined`
+F821 Undefined name `Undefined`
+ --> F821_7.py:11:22
|
10 | # Not OK
11 | _ = DefaultNamedArg("Undefined", name="some_prop_name")
- | ^^^^^^^^^ F821
+ | ^^^^^^^^^
12 | _ = DefaultNamedArg(type="Undefined", name="some_prop_name")
13 | _ = DefaultNamedArg("Undefined", "some_prop_name")
|
-F821_7.py:12:27: F821 Undefined name `Undefined`
+F821 Undefined name `Undefined`
+ --> F821_7.py:12:27
|
10 | # Not OK
11 | _ = DefaultNamedArg("Undefined", name="some_prop_name")
12 | _ = DefaultNamedArg(type="Undefined", name="some_prop_name")
- | ^^^^^^^^^ F821
+ | ^^^^^^^^^
13 | _ = DefaultNamedArg("Undefined", "some_prop_name")
|
-F821_7.py:13:22: F821 Undefined name `Undefined`
+F821 Undefined name `Undefined`
+ --> F821_7.py:13:22
|
11 | _ = DefaultNamedArg("Undefined", name="some_prop_name")
12 | _ = DefaultNamedArg(type="Undefined", name="some_prop_name")
13 | _ = DefaultNamedArg("Undefined", "some_prop_name")
- | ^^^^^^^^^ F821
+ | ^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap
index 976d74866a..ce557ed224 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F821_9.py:22:20: F821 Undefined name `captured`
+F821 Undefined name `captured`
+ --> F821_9.py:22:20
|
20 | match provided:
21 | case True:
22 | return captured # F821
- | ^^^^^^^^ F821
+ | ^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap
index 10d1e6f4e0..f75fb59fdd 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F822_0.py:3:17: F822 Undefined name `b` in `__all__`
+F822 Undefined name `b` in `__all__`
+ --> F822_0.py:3:17
|
1 | a = 1
2 |
3 | __all__ = ["a", "b"]
- | ^^^ F822
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap
index 4810ad4608..761c68b678 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F822_0.pyi:4:22: F822 Undefined name `c` in `__all__`
+F822 Undefined name `c` in `__all__`
+ --> F822_0.pyi:4:22
|
2 | b: int # Considered a binding in a `.pyi` stub file, not in a `.py` runtime file
3 |
4 | __all__ = ["a", "b", "c"] # c is flagged as missing; b is not
- | ^^^ F822
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap
index 5486326ac9..ead94dbcaa 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F822_1.py:3:22: F822 Undefined name `b` in `__all__`
+F822 Undefined name `b` in `__all__`
+ --> F822_1.py:3:22
|
1 | a = 1
2 |
3 | __all__ = list(["a", "b"])
- | ^^^ F822
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap
index a52632a6a8..aa41c02a6f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap
@@ -1,10 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F822_1b.py:4:31: F822 Undefined name `b` in `__all__`
+F822 Undefined name `b` in `__all__`
+ --> F822_1b.py:4:31
|
2 | a = 1
3 |
4 | __all__ = builtins.list(["a", "b"])
- | ^^^ F822
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_3.py.snap
index ffc2b35cf8..83c20b0893 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_3.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_3.py.snap
@@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F822_3.py:12:5: F822 Undefined name `ExponentialFamily` in `__all__`
+F822 Undefined name `ExponentialFamily` in `__all__`
+ --> F822_3.py:12:5
|
10 | __all__ += [
11 | "ContinuousBernoulli", # noqa: F822
12 | "ExponentialFamily",
- | ^^^^^^^^^^^^^^^^^^^ F822
+ | ^^^^^^^^^^^^^^^^^^^
13 | ]
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap
index 75fd12222a..4fded2b2fb 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap
@@ -1,44 +1,49 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F823.py:6:5: F823 Local variable `my_var` referenced before assignment
+F823 Local variable `my_var` referenced before assignment
+ --> F823.py:6:5
|
5 | def foo():
6 | my_var += 1
- | ^^^^^^ F823
+ | ^^^^^^
|
-F823.py:32:15: F823 Local variable `my_var` referenced before assignment
+F823 Local variable `my_var` referenced before assignment
+ --> F823.py:32:15
|
30 | class Class:
31 | def f(self):
32 | print(my_var)
- | ^^^^^^ F823
+ | ^^^^^^
33 | my_var = 1
|
-F823.py:40:15: F823 Local variable `my_var` referenced before assignment
+F823 Local variable `my_var` referenced before assignment
+ --> F823.py:40:15
|
39 | def f(self):
40 | print(my_var)
- | ^^^^^^ F823
+ | ^^^^^^
41 | my_var = 1
|
-F823.py:48:11: F823 Local variable `sys` referenced before assignment
+F823 Local variable `sys` referenced before assignment
+ --> F823.py:48:11
|
47 | def main():
48 | print(sys.argv)
- | ^^^ F823
+ | ^^^
49 |
50 | try:
|
-F823.py:62:11: F823 Local variable `sys` referenced before assignment
+F823 Local variable `sys` referenced before assignment
+ --> F823.py:62:11
|
61 | def main():
62 | print(sys.argv)
- | ^^^ F823
+ | ^^^
63 |
64 | for sys in range(5):
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap
index a8a860e83c..2361f61f36 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used
+F841 [*] Local variable `e` is assigned to but never used
+ --> F841_0.py:3:22
|
1 | try:
2 | 1 / 0
3 | except ValueError as e:
- | ^ F841
+ | ^
4 | pass
|
- = help: Remove assignment to unused variable `e`
+help: Remove assignment to unused variable `e`
ℹ Safe fix
1 1 | try:
@@ -20,14 +21,15 @@ F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used
5 5 |
6 6 |
-F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used
+F841 [*] Local variable `z` is assigned to but never used
+ --> F841_0.py:16:5
|
14 | x = 1
15 | y = 2
16 | z = x + y
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `z`
+help: Remove assignment to unused variable `z`
ℹ Unsafe fix
13 13 | def f():
@@ -39,14 +41,15 @@ F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used
18 18 |
19 19 | def f():
-F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used
+F841 [*] Local variable `foo` is assigned to but never used
+ --> F841_0.py:20:5
|
19 | def f():
20 | foo = (1, 2)
- | ^^^ F841
+ | ^^^
21 | (a, b) = (1, 2)
|
- = help: Remove assignment to unused variable `foo`
+help: Remove assignment to unused variable `foo`
ℹ Unsafe fix
17 17 |
@@ -57,16 +60,17 @@ F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used
22 21 |
23 22 | bar = (1, 2)
-F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used
+F841 [*] Local variable `a` is assigned to but never used
+ --> F841_0.py:21:6
|
19 | def f():
20 | foo = (1, 2)
21 | (a, b) = (1, 2)
- | ^ F841
+ | ^
22 |
23 | bar = (1, 2)
|
- = help: Remove assignment to unused variable `a`
+help: Remove assignment to unused variable `a`
ℹ Unsafe fix
18 18 |
@@ -78,16 +82,17 @@ F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used
23 23 | bar = (1, 2)
24 24 | (c, d) = bar
-F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used
+F841 [*] Local variable `b` is assigned to but never used
+ --> F841_0.py:21:9
|
19 | def f():
20 | foo = (1, 2)
21 | (a, b) = (1, 2)
- | ^ F841
+ | ^
22 |
23 | bar = (1, 2)
|
- = help: Remove assignment to unused variable `b`
+help: Remove assignment to unused variable `b`
ℹ Unsafe fix
18 18 |
@@ -99,14 +104,15 @@ F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used
23 23 | bar = (1, 2)
24 24 | (c, d) = bar
-F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used
+F841 [*] Local variable `baz` is assigned to but never used
+ --> F841_0.py:26:14
|
24 | (c, d) = bar
25 |
26 | (x, y) = baz = bar
- | ^^^ F841
+ | ^^^
|
- = help: Remove assignment to unused variable `baz`
+help: Remove assignment to unused variable `baz`
ℹ Unsafe fix
23 23 | bar = (1, 2)
@@ -118,16 +124,17 @@ F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used
28 28 |
29 29 | def f():
-F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used
+F841 [*] Local variable `b` is assigned to but never used
+ --> F841_0.py:51:9
|
49 | def c():
50 | # F841
51 | b = 1
- | ^ F841
+ | ^
52 |
53 | def d():
|
- = help: Remove assignment to unused variable `b`
+help: Remove assignment to unused variable `b`
ℹ Unsafe fix
48 48 |
@@ -139,14 +146,15 @@ F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used
53 53 | def d():
54 54 | nonlocal b
-F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used
+F841 [*] Local variable `my_file` is assigned to but never used
+ --> F841_0.py:79:26
|
78 | def f():
79 | with open("file") as my_file, open("") as ((this, that)):
- | ^^^^^^^ F841
+ | ^^^^^^^
80 | print("hello")
|
- = help: Remove assignment to unused variable `my_file`
+help: Remove assignment to unused variable `my_file`
ℹ Unsafe fix
76 76 |
@@ -158,16 +166,17 @@ F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used
81 81 |
82 82 |
-F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used
+F841 [*] Local variable `my_file` is assigned to but never used
+ --> F841_0.py:85:25
|
83 | def f():
84 | with (
85 | open("file") as my_file,
- | ^^^^^^^ F841
+ | ^^^^^^^
86 | open("") as ((this, that)),
87 | ):
|
- = help: Remove assignment to unused variable `my_file`
+help: Remove assignment to unused variable `my_file`
ℹ Unsafe fix
82 82 |
@@ -179,16 +188,17 @@ F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used
87 87 | ):
88 88 | print("hello")
-F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used
+F841 [*] Local variable `msg3` is assigned to but never used
+ --> F841_0.py:102:5
|
100 | msg1 = "Hello, world!"
101 | msg2 = "Hello, world!"
102 | msg3 = "Hello, world!"
- | ^^^^ F841
+ | ^^^^
103 | match x:
104 | case 1:
|
- = help: Remove assignment to unused variable `msg3`
+help: Remove assignment to unused variable `msg3`
ℹ Unsafe fix
99 99 | def f(x: int):
@@ -199,16 +209,17 @@ F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used
104 103 | case 1:
105 104 | print(msg1)
-F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used
+F841 [*] Local variable `Baz` is assigned to but never used
+ --> F841_0.py:115:5
|
113 | Foo = enum.Enum("Foo", "A B")
114 | Bar = enum.Enum("Bar", "A B")
115 | Baz = enum.Enum("Baz", "A B")
- | ^^^ F841
+ | ^^^
116 |
117 | match x:
|
- = help: Remove assignment to unused variable `Baz`
+help: Remove assignment to unused variable `Baz`
ℹ Unsafe fix
112 112 |
@@ -220,21 +231,23 @@ F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used
117 117 | match x:
118 118 | case (Foo.A):
-F841_0.py:122:14: F841 Local variable `y` is assigned to but never used
+F841 Local variable `y` is assigned to but never used
+ --> F841_0.py:122:14
|
120 | case [Bar.A, *_]:
121 | print("A")
122 | case y:
- | ^ F841
+ | ^
123 | pass
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
-F841_0.py:127:21: F841 Local variable `value` is assigned to but never used
+F841 Local variable `value` is assigned to but never used
+ --> F841_0.py:127:21
|
126 | def f():
127 | if any((key := (value := x)) for x in ["ok"]):
- | ^^^^^ F841
+ | ^^^^^
128 | print(key)
|
- = help: Remove assignment to unused variable `value`
+help: Remove assignment to unused variable `value`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap
index e82e2bb4e0..f1b8ea02c3 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F841_1.py:6:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_1.py:6:5
|
5 | def f():
6 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
3 3 |
@@ -20,13 +20,14 @@ F841_1.py:6:5: F841 [*] Local variable `x` is assigned to but never used
8 8 |
9 9 | def f():
-F841_1.py:6:8: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_1.py:6:8
|
5 | def f():
6 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
3 3 |
@@ -38,13 +39,14 @@ F841_1.py:6:8: F841 [*] Local variable `y` is assigned to but never used
8 8 |
9 9 | def f():
-F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used
+F841 [*] Local variable `coords` is assigned to but never used
+ --> F841_1.py:16:14
|
15 | def f():
16 | (x, y) = coords = 1, 2
- | ^^^^^^ F841
+ | ^^^^^^
|
- = help: Remove assignment to unused variable `coords`
+help: Remove assignment to unused variable `coords`
ℹ Unsafe fix
13 13 |
@@ -56,13 +58,14 @@ F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used
18 18 |
19 19 | def f():
-F841_1.py:20:5: F841 [*] Local variable `coords` is assigned to but never used
+F841 [*] Local variable `coords` is assigned to but never used
+ --> F841_1.py:20:5
|
19 | def f():
20 | coords = (x, y) = 1, 2
- | ^^^^^^ F841
+ | ^^^^^^
|
- = help: Remove assignment to unused variable `coords`
+help: Remove assignment to unused variable `coords`
ℹ Unsafe fix
17 17 |
@@ -74,13 +77,14 @@ F841_1.py:20:5: F841 [*] Local variable `coords` is assigned to but never used
22 22 |
23 23 | def f():
-F841_1.py:24:6: F841 [*] Local variable `a` is assigned to but never used
+F841 [*] Local variable `a` is assigned to but never used
+ --> F841_1.py:24:6
|
23 | def f():
24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `a`
+help: Remove assignment to unused variable `a`
ℹ Unsafe fix
21 21 |
@@ -89,13 +93,14 @@ F841_1.py:24:6: F841 [*] Local variable `a` is assigned to but never used
24 |- (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
24 |+ (_a, b) = (x, y) = 1, 2 # this triggers F841 on everything
-F841_1.py:24:9: F841 [*] Local variable `b` is assigned to but never used
+F841 [*] Local variable `b` is assigned to but never used
+ --> F841_1.py:24:9
|
23 | def f():
24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `b`
+help: Remove assignment to unused variable `b`
ℹ Unsafe fix
21 21 |
@@ -104,13 +109,14 @@ F841_1.py:24:9: F841 [*] Local variable `b` is assigned to but never used
24 |- (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
24 |+ (a, _b) = (x, y) = 1, 2 # this triggers F841 on everything
-F841_1.py:24:15: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_1.py:24:15
|
23 | def f():
24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
21 21 |
@@ -119,13 +125,14 @@ F841_1.py:24:15: F841 [*] Local variable `x` is assigned to but never used
24 |- (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
24 |+ (a, b) = (_x, y) = 1, 2 # this triggers F841 on everything
-F841_1.py:24:18: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_1.py:24:18
|
23 | def f():
24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
21 21 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap
index c3250b8451..9ddc03a282 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:5:5
|
4 | def f():
5 | x = 1
- | ^ F841
+ | ^
6 | y = 2
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
2 2 |
@@ -19,16 +20,17 @@ F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used
7 6 |
8 7 | z = 3
-F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:6:5
|
4 | def f():
5 | x = 1
6 | y = 2
- | ^ F841
+ | ^
7 |
8 | z = 3
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
3 3 |
@@ -39,14 +41,15 @@ F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used
8 7 | z = 3
9 8 | print(z)
-F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:13:5
|
12 | def f():
13 | x: int = 1
- | ^ F841
+ | ^
14 | y: int = 2
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
10 10 |
@@ -57,16 +60,17 @@ F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used
15 14 |
16 15 | z: int = 3
-F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:14:5
|
12 | def f():
13 | x: int = 1
14 | y: int = 2
- | ^ F841
+ | ^
15 |
16 | z: int = 3
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
11 11 |
@@ -77,14 +81,15 @@ F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used
16 15 | z: int = 3
17 16 | print(z)
-F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used
+F841 [*] Local variable `x1` is assigned to but never used
+ --> F841_3.py:21:19
|
20 | def f():
21 | with foo() as x1:
- | ^^ F841
+ | ^^
22 | pass
|
- = help: Remove assignment to unused variable `x1`
+help: Remove assignment to unused variable `x1`
ℹ Unsafe fix
18 18 |
@@ -96,15 +101,16 @@ F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used
23 23 |
24 24 | with foo() as (x2, y2):
-F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used
+F841 [*] Local variable `x3` is assigned to but never used
+ --> F841_3.py:27:20
|
25 | pass
26 |
27 | with (foo() as x3, foo() as y3, foo() as z3):
- | ^^ F841
+ | ^^
28 | pass
|
- = help: Remove assignment to unused variable `x3`
+help: Remove assignment to unused variable `x3`
ℹ Unsafe fix
24 24 | with foo() as (x2, y2):
@@ -116,15 +122,16 @@ F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used
29 29 |
30 30 |
-F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used
+F841 [*] Local variable `y3` is assigned to but never used
+ --> F841_3.py:27:33
|
25 | pass
26 |
27 | with (foo() as x3, foo() as y3, foo() as z3):
- | ^^ F841
+ | ^^
28 | pass
|
- = help: Remove assignment to unused variable `y3`
+help: Remove assignment to unused variable `y3`
ℹ Unsafe fix
24 24 | with foo() as (x2, y2):
@@ -136,15 +143,16 @@ F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used
29 29 |
30 30 |
-F841_3.py:27:46: F841 [*] Local variable `z3` is assigned to but never used
+F841 [*] Local variable `z3` is assigned to but never used
+ --> F841_3.py:27:46
|
25 | pass
26 |
27 | with (foo() as x3, foo() as y3, foo() as z3):
- | ^^ F841
+ | ^^
28 | pass
|
- = help: Remove assignment to unused variable `z3`
+help: Remove assignment to unused variable `z3`
ℹ Unsafe fix
24 24 | with foo() as (x2, y2):
@@ -156,15 +164,16 @@ F841_3.py:27:46: F841 [*] Local variable `z3` is assigned to but never used
29 29 |
30 30 |
-F841_3.py:32:6: F841 [*] Local variable `x1` is assigned to but never used
+F841 [*] Local variable `x1` is assigned to but never used
+ --> F841_3.py:32:6
|
31 | def f():
32 | (x1, y1) = (1, 2)
- | ^^ F841
+ | ^^
33 | (x2, y2) = coords2 = (1, 2)
34 | coords3 = (x3, y3) = (1, 2)
|
- = help: Remove assignment to unused variable `x1`
+help: Remove assignment to unused variable `x1`
ℹ Unsafe fix
29 29 |
@@ -176,15 +185,16 @@ F841_3.py:32:6: F841 [*] Local variable `x1` is assigned to but never used
34 34 | coords3 = (x3, y3) = (1, 2)
35 35 |
-F841_3.py:32:10: F841 [*] Local variable `y1` is assigned to but never used
+F841 [*] Local variable `y1` is assigned to but never used
+ --> F841_3.py:32:10
|
31 | def f():
32 | (x1, y1) = (1, 2)
- | ^^ F841
+ | ^^
33 | (x2, y2) = coords2 = (1, 2)
34 | coords3 = (x3, y3) = (1, 2)
|
- = help: Remove assignment to unused variable `y1`
+help: Remove assignment to unused variable `y1`
ℹ Unsafe fix
29 29 |
@@ -196,15 +206,16 @@ F841_3.py:32:10: F841 [*] Local variable `y1` is assigned to but never used
34 34 | coords3 = (x3, y3) = (1, 2)
35 35 |
-F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used
+F841 [*] Local variable `coords2` is assigned to but never used
+ --> F841_3.py:33:16
|
31 | def f():
32 | (x1, y1) = (1, 2)
33 | (x2, y2) = coords2 = (1, 2)
- | ^^^^^^^ F841
+ | ^^^^^^^
34 | coords3 = (x3, y3) = (1, 2)
|
- = help: Remove assignment to unused variable `coords2`
+help: Remove assignment to unused variable `coords2`
ℹ Unsafe fix
30 30 |
@@ -216,14 +227,15 @@ F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used
35 35 |
36 36 |
-F841_3.py:34:5: F841 [*] Local variable `coords3` is assigned to but never used
+F841 [*] Local variable `coords3` is assigned to but never used
+ --> F841_3.py:34:5
|
32 | (x1, y1) = (1, 2)
33 | (x2, y2) = coords2 = (1, 2)
34 | coords3 = (x3, y3) = (1, 2)
- | ^^^^^^^ F841
+ | ^^^^^^^
|
- = help: Remove assignment to unused variable `coords3`
+help: Remove assignment to unused variable `coords3`
ℹ Unsafe fix
31 31 | def f():
@@ -235,15 +247,16 @@ F841_3.py:34:5: F841 [*] Local variable `coords3` is assigned to but never used
36 36 |
37 37 | def f():
-F841_3.py:40:26: F841 [*] Local variable `x1` is assigned to but never used
+F841 [*] Local variable `x1` is assigned to but never used
+ --> F841_3.py:40:26
|
38 | try:
39 | 1 / 0
40 | except ValueError as x1:
- | ^^ F841
+ | ^^
41 | pass
|
- = help: Remove assignment to unused variable `x1`
+help: Remove assignment to unused variable `x1`
ℹ Safe fix
37 37 | def f():
@@ -255,15 +268,16 @@ F841_3.py:40:26: F841 [*] Local variable `x1` is assigned to but never used
42 42 |
43 43 | try:
-F841_3.py:45:47: F841 [*] Local variable `x2` is assigned to but never used
+F841 [*] Local variable `x2` is assigned to but never used
+ --> F841_3.py:45:47
|
43 | try:
44 | 1 / 0
45 | except (ValueError, ZeroDivisionError) as x2:
- | ^^ F841
+ | ^^
46 | pass
|
- = help: Remove assignment to unused variable `x2`
+help: Remove assignment to unused variable `x2`
ℹ Safe fix
42 42 |
@@ -275,15 +289,16 @@ F841_3.py:45:47: F841 [*] Local variable `x2` is assigned to but never used
47 47 |
48 48 |
-F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:50:5
|
49 | def f(a, b):
50 | x = (
- | ^ F841
+ | ^
51 | a()
52 | if a is not None
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
47 47 |
@@ -295,15 +310,16 @@ F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used
52 52 | if a is not None
53 53 | else b
-F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:56:5
|
54 | )
55 |
56 | y = \
- | ^ F841
+ | ^
57 | a() if a is not None else b
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
53 53 | else b
@@ -316,15 +332,16 @@ F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used
59 58 |
60 59 | def f(a, b):
-F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:61:5
|
60 | def f(a, b):
61 | x = (
- | ^ F841
+ | ^
62 | a
63 | if a is not None
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
58 58 |
@@ -339,15 +356,16 @@ F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used
67 62 | y = \
68 63 | a if a is not None else b
-F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:67:5
|
65 | )
66 |
67 | y = \
- | ^ F841
+ | ^
68 | a if a is not None else b
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
64 64 | else b
@@ -359,14 +377,15 @@ F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used
70 68 |
71 69 | def f():
-F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used
+F841 [*] Local variable `cm` is assigned to but never used
+ --> F841_3.py:72:24
|
71 | def f():
72 | with Nested(m) as (cm):
- | ^^ F841
+ | ^^
73 | pass
|
- = help: Remove assignment to unused variable `cm`
+help: Remove assignment to unused variable `cm`
ℹ Unsafe fix
69 69 |
@@ -378,14 +397,15 @@ F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used
74 74 |
75 75 |
-F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used
+F841 [*] Local variable `cm` is assigned to but never used
+ --> F841_3.py:77:25
|
76 | def f():
77 | with (Nested(m) as (cm),):
- | ^^ F841
+ | ^^
78 | pass
|
- = help: Remove assignment to unused variable `cm`
+help: Remove assignment to unused variable `cm`
ℹ Unsafe fix
74 74 |
@@ -397,14 +417,15 @@ F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used
79 79 |
80 80 |
-F841_3.py:87:26: F841 [*] Local variable `cm` is assigned to but never used
+F841 [*] Local variable `cm` is assigned to but never used
+ --> F841_3.py:87:26
|
86 | def f():
87 | with (Nested(m)) as (cm):
- | ^^ F841
+ | ^^
88 | pass
|
- = help: Remove assignment to unused variable `cm`
+help: Remove assignment to unused variable `cm`
ℹ Unsafe fix
84 84 |
@@ -416,15 +437,16 @@ F841_3.py:87:26: F841 [*] Local variable `cm` is assigned to but never used
89 89 |
90 90 |
-F841_3.py:92:5: F841 [*] Local variable `toplevel` is assigned to but never used
+F841 [*] Local variable `toplevel` is assigned to but never used
+ --> F841_3.py:92:5
|
91 | def f():
92 | toplevel = tt = lexer.get_token()
- | ^^^^^^^^ F841
+ | ^^^^^^^^
93 | if not tt:
94 | break
|
- = help: Remove assignment to unused variable `toplevel`
+help: Remove assignment to unused variable `toplevel`
ℹ Unsafe fix
89 89 |
@@ -436,13 +458,14 @@ F841_3.py:92:5: F841 [*] Local variable `toplevel` is assigned to but never used
94 94 | break
95 95 |
-F841_3.py:98:5: F841 [*] Local variable `toplevel` is assigned to but never used
+F841 [*] Local variable `toplevel` is assigned to but never used
+ --> F841_3.py:98:5
|
97 | def f():
98 | toplevel = tt = lexer.get_token()
- | ^^^^^^^^ F841
+ | ^^^^^^^^
|
- = help: Remove assignment to unused variable `toplevel`
+help: Remove assignment to unused variable `toplevel`
ℹ Unsafe fix
95 95 |
@@ -454,13 +477,14 @@ F841_3.py:98:5: F841 [*] Local variable `toplevel` is assigned to but never used
100 100 |
101 101 | def f():
-F841_3.py:98:16: F841 [*] Local variable `tt` is assigned to but never used
+F841 [*] Local variable `tt` is assigned to but never used
+ --> F841_3.py:98:16
|
97 | def f():
98 | toplevel = tt = lexer.get_token()
- | ^^ F841
+ | ^^
|
- = help: Remove assignment to unused variable `tt`
+help: Remove assignment to unused variable `tt`
ℹ Unsafe fix
95 95 |
@@ -472,13 +496,14 @@ F841_3.py:98:16: F841 [*] Local variable `tt` is assigned to but never used
100 100 |
101 101 | def f():
-F841_3.py:102:5: F841 [*] Local variable `toplevel` is assigned to but never used
+F841 [*] Local variable `toplevel` is assigned to but never used
+ --> F841_3.py:102:5
|
101 | def f():
102 | toplevel = (a, b) = lexer.get_token()
- | ^^^^^^^^ F841
+ | ^^^^^^^^
|
- = help: Remove assignment to unused variable `toplevel`
+help: Remove assignment to unused variable `toplevel`
ℹ Unsafe fix
99 99 |
@@ -490,13 +515,14 @@ F841_3.py:102:5: F841 [*] Local variable `toplevel` is assigned to but never use
104 104 |
105 105 | def f():
-F841_3.py:106:14: F841 [*] Local variable `toplevel` is assigned to but never used
+F841 [*] Local variable `toplevel` is assigned to but never used
+ --> F841_3.py:106:14
|
105 | def f():
106 | (a, b) = toplevel = lexer.get_token()
- | ^^^^^^^^ F841
+ | ^^^^^^^^
|
- = help: Remove assignment to unused variable `toplevel`
+help: Remove assignment to unused variable `toplevel`
ℹ Unsafe fix
103 103 |
@@ -508,13 +534,14 @@ F841_3.py:106:14: F841 [*] Local variable `toplevel` is assigned to but never us
108 108 |
109 109 | def f():
-F841_3.py:110:5: F841 [*] Local variable `toplevel` is assigned to but never used
+F841 [*] Local variable `toplevel` is assigned to but never used
+ --> F841_3.py:110:5
|
109 | def f():
110 | toplevel = tt = 1
- | ^^^^^^^^ F841
+ | ^^^^^^^^
|
- = help: Remove assignment to unused variable `toplevel`
+help: Remove assignment to unused variable `toplevel`
ℹ Unsafe fix
107 107 |
@@ -526,13 +553,14 @@ F841_3.py:110:5: F841 [*] Local variable `toplevel` is assigned to but never use
112 112 |
113 113 | def f(provided: int) -> int:
-F841_3.py:110:16: F841 [*] Local variable `tt` is assigned to but never used
+F841 [*] Local variable `tt` is assigned to but never used
+ --> F841_3.py:110:16
|
109 | def f():
110 | toplevel = tt = 1
- | ^^ F841
+ | ^^
|
- = help: Remove assignment to unused variable `tt`
+help: Remove assignment to unused variable `tt`
ℹ Unsafe fix
107 107 |
@@ -544,75 +572,82 @@ F841_3.py:110:16: F841 [*] Local variable `tt` is assigned to but never used
112 112 |
113 113 | def f(provided: int) -> int:
-F841_3.py:115:19: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> F841_3.py:115:19
|
113 | def f(provided: int) -> int:
114 | match provided:
115 | case [_, *x]:
- | ^ F841
+ | ^
116 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
-F841_3.py:121:14: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> F841_3.py:121:14
|
119 | def f(provided: int) -> int:
120 | match provided:
121 | case x:
- | ^ F841
+ | ^
122 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
-F841_3.py:127:18: F841 Local variable `bar` is assigned to but never used
+F841 Local variable `bar` is assigned to but never used
+ --> F841_3.py:127:18
|
125 | def f(provided: int) -> int:
126 | match provided:
127 | case Foo(bar) as x:
- | ^^^ F841
+ | ^^^
128 | pass
|
- = help: Remove assignment to unused variable `bar`
+help: Remove assignment to unused variable `bar`
-F841_3.py:127:26: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> F841_3.py:127:26
|
125 | def f(provided: int) -> int:
126 | match provided:
127 | case Foo(bar) as x:
- | ^ F841
+ | ^
128 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
-F841_3.py:133:27: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> F841_3.py:133:27
|
131 | def f(provided: int) -> int:
132 | match provided:
133 | case {"foo": 0, **x}:
- | ^ F841
+ | ^
134 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
-F841_3.py:139:17: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> F841_3.py:139:17
|
137 | def f(provided: int) -> int:
138 | match provided:
139 | case {**x}:
- | ^ F841
+ | ^
140 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
-F841_3.py:155:17: F841 [*] Local variable `e` is assigned to but never used
+F841 [*] Local variable `e` is assigned to but never used
+ --> F841_3.py:155:17
|
153 | try:
154 | print("hello")
155 | except A as e :
- | ^ F841
+ | ^
156 | print("oh no!")
|
- = help: Remove assignment to unused variable `e`
+help: Remove assignment to unused variable `e`
ℹ Safe fix
152 152 | def f() -> None:
@@ -624,14 +659,15 @@ F841_3.py:155:17: F841 [*] Local variable `e` is assigned to but never used
157 157 |
158 158 |
-F841_3.py:160:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:160:5
|
159 | def f():
160 | x = 1
- | ^ F841
+ | ^
161 | y = 2
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
157 157 |
@@ -642,14 +678,15 @@ F841_3.py:160:5: F841 [*] Local variable `x` is assigned to but never used
162 161 |
163 162 |
-F841_3.py:161:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:161:5
|
159 | def f():
160 | x = 1
161 | y = 2
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
158 158 |
@@ -660,15 +697,16 @@ F841_3.py:161:5: F841 [*] Local variable `y` is assigned to but never used
163 162 |
164 163 | def f():
-F841_3.py:165:5: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:165:5
|
164 | def f():
165 | x = 1
- | ^ F841
+ | ^
166 |
167 | y = 2
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
162 162 |
@@ -679,14 +717,15 @@ F841_3.py:165:5: F841 [*] Local variable `x` is assigned to but never used
167 166 | y = 2
168 167 |
-F841_3.py:167:5: F841 [*] Local variable `y` is assigned to but never used
+F841 [*] Local variable `y` is assigned to but never used
+ --> F841_3.py:167:5
|
165 | x = 1
166 |
167 | y = 2
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
ℹ Unsafe fix
164 164 | def f():
@@ -697,14 +736,15 @@ F841_3.py:167:5: F841 [*] Local variable `y` is assigned to but never used
169 168 |
170 169 | def f():
-F841_3.py:173:6: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> F841_3.py:173:6
|
171 | (x) = foo()
172 | ((x)) = foo()
173 | (x) = (y.z) = foo()
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Unsafe fix
170 170 | def f():
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap
index 5f6e6dbd9d..49b28284d8 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap
@@ -1,19 +1,20 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F842.py:2:5: F842 Local variable `name` is annotated but never used
+F842 Local variable `name` is annotated but never used
+ --> F842.py:2:5
|
1 | def f():
2 | name: str
- | ^^^^ F842
+ | ^^^^
3 | age: int
|
-F842.py:3:5: F842 Local variable `age` is annotated but never used
+F842 Local variable `age` is annotated but never used
+ --> F842.py:3:5
|
1 | def f():
2 | name: str
3 | age: int
- | ^^^ F842
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap
index 3e25ce03fa..689aab5390 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F901.py:2:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+ --> F901.py:2:11
|
1 | def f() -> None:
2 | raise NotImplemented()
- | ^^^^^^^^^^^^^^ F901
+ | ^^^^^^^^^^^^^^
|
- = help: Use `raise NotImplementedError`
+help: Use `raise NotImplementedError`
ℹ Safe fix
1 1 | def f() -> None:
@@ -18,13 +18,14 @@ F901.py:2:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedErr
4 4 |
5 5 | def g() -> None:
-F901.py:6:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+ --> F901.py:6:11
|
5 | def g() -> None:
6 | raise NotImplemented
- | ^^^^^^^^^^^^^^ F901
+ | ^^^^^^^^^^^^^^
|
- = help: Use `raise NotImplementedError`
+help: Use `raise NotImplementedError`
ℹ Safe fix
3 3 |
@@ -36,14 +37,15 @@ F901.py:6:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedErr
8 8 |
9 9 | def h() -> None:
-F901.py:11:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+F901 [*] `raise NotImplemented` should be `raise NotImplementedError`
+ --> F901.py:11:11
|
9 | def h() -> None:
10 | NotImplementedError = "foo"
11 | raise NotImplemented
- | ^^^^^^^^^^^^^^ F901
+ | ^^^^^^^^^^^^^^
|
- = help: Use `raise NotImplementedError`
+help: Use `raise NotImplementedError`
ℹ Safe fix
1 |+import builtins
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap
index 18501498a2..bebb611006 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap
@@ -1,20 +1,21 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:10:5: F821 Undefined name `x`
+F821 Undefined name `x`
+ --> :10:5
|
8 | # entirely after the `del` statement. However, it should be an F821
9 | # error, because the name is defined in the scope, but unbound.
10 | x += 1
- | ^ F821
+ | ^
|
-:10:5: F841 Local variable `x` is assigned to but never used
+F841 Local variable `x` is assigned to but never used
+ --> :10:5
|
8 | # entirely after the `del` statement. However, it should be an F821
9 | # error, because the name is defined in the scope, but unbound.
10 | x += 1
- | ^ F841
+ | ^
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap
index cf1be266bc..3f863c9e60 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap
@@ -1,9 +1,9 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-builtins.py:1:1: F821 Undefined name `_`
+F821 Undefined name `_`
+ --> builtins.py:1:1
|
1 | _("Translations")
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_typing_modules.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_typing_modules.snap
index ff0ffaecb3..e4c3561b87 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_typing_modules.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_typing_modules.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-typing_modules.py:6:36: F821 Undefined name `db`
+F821 Undefined name `db`
+ --> typing_modules.py:6:36
|
6 | X = Union[Literal[False], Literal["db"]]
- | ^^ F821
+ | ^^
7 | y = Optional["Class"]
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_global_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_global_scope.snap
index 9d08e6b818..772f183bbe 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_global_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_global_scope.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-:5:12: F401 [*] `os` imported but unused
+F401 [*] `os` imported but unused
+ --> :5:12
|
4 | def f():
5 | import os
- | ^^ F401
+ | ^^
6 |
7 | # Despite this `del`, `import os` in `f` should still be flagged as shadowing an unused
|
- = help: Remove unused import: `os`
+help: Remove unused import: `os`
ℹ Safe fix
2 2 | import os
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap
index f2a3fb29b2..e7ed86bd46 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-:2:8: F401 [*] `os` imported but unused
+F401 [*] `os` imported but unused
+ --> :2:8
|
2 | import os
- | ^^ F401
+ | ^^
3 |
4 | def f():
|
- = help: Remove unused import: `os`
+help: Remove unused import: `os`
ℹ Safe fix
1 1 |
@@ -17,15 +18,16 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs
4 3 | def f():
5 4 | import os
-:5:12: F811 [*] Redefinition of unused `os` from line 2
+F811 [*] Redefinition of unused `os` from line 2
+ --> :5:12
|
4 | def f():
5 | import os
- | ^^ F811
+ | ^^
6 |
7 | # Despite this `del`, `import os` in `f` should still be flagged as shadowing an unused
|
- = help: Remove definition: `os`
+help: Remove definition: `os`
ℹ Safe fix
2 2 | import os
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap
index 38f194e157..7076d53708 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-:2:8: F401 [*] `os` imported but unused
+F401 [*] `os` imported but unused
+ --> :2:8
|
2 | import os
- | ^^ F401
+ | ^^
3 |
4 | def f():
|
- = help: Remove unused import: `os`
+help: Remove unused import: `os`
ℹ Safe fix
1 1 |
@@ -17,11 +18,12 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs
4 3 | def f():
5 4 | os = 1
-:5:5: F811 Redefinition of unused `os` from line 2
+F811 Redefinition of unused `os` from line 2
+ --> :5:5
|
4 | def f():
5 | os = 1
- | ^^ F811
+ | ^^
6 | print(os)
|
- = help: Remove definition: `os`
+help: Remove definition: `os`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap
index 2177b874a1..e96cdc07f7 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-:4:12: F811 [*] Redefinition of unused `os` from line 3
+F811 [*] Redefinition of unused `os` from line 3
+ --> :4:12
|
2 | def f():
3 | import os
4 | import os
- | ^^ F811
+ | ^^
5 |
6 | # Despite this `del`, `import os` should still be flagged as shadowing an unused
|
- = help: Remove definition: `os`
+help: Remove definition: `os`
ℹ Safe fix
1 1 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap
index 4f3cf22aa7..51dc063477 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:5:9: F821 Undefined name `x`
+F821 Undefined name `x`
+ --> :5:9
|
3 | x = 1
4 | del x
5 | del x
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap
index 585455e718..3fcb7752c8 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-typing_modules.py:7:15: F821 Undefined name `Class`
+F821 Undefined name `Class`
+ --> typing_modules.py:7:15
|
6 | X = Union[Literal[False], Literal["db"]]
7 | y = Optional["Class"]
- | ^^^^^ F821
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap
index 3d331d7884..8a0e8d0ebb 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-F401_31.py:12:33: F401 [*] `hvplot.pandas_alias.scatter_matrix` imported but unused
+F401 [*] `hvplot.pandas_alias.scatter_matrix` imported but unused
+ --> F401_31.py:12:33
|
11 | # Errors
12 | from hvplot.pandas_alias import scatter_matrix
- | ^^^^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^^^^
|
- = help: Remove unused import: `hvplot.pandas_alias.scatter_matrix`
+help: Remove unused import: `hvplot.pandas_alias.scatter_matrix`
ℹ Safe fix
9 9 | from hvplot.pandas.plots import scatter_matrix
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_dunder_all.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_dunder_all.snap
index b20246f56c..a51f6d418d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_dunder_all.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_dunder_all.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:2:8: F401 [*] `submodule.a` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `submodule.a` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:2:8
|
2 | import submodule.a
- | ^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^
3 | __all__ = ['FOO']
4 | FOO = 42
|
- = help: Add `submodule` to __all__
+help: Add `submodule` to __all__
ℹ Safe fix
1 1 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap
index 55922fe49d..1c463aa7e2 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:1:8: F401 `submodule.a` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `submodule.a` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:1:8
|
1 | import submodule.a
- | ^^^^^^^^^^^ F401
+ | ^^^^^^^^^^^
|
- = help: Use an explicit re-export: `import submodule as submodule; import submodule.a`
+help: Use an explicit re-export: `import submodule as submodule; import submodule.a`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap
index 3fce3fa99e..072e06e5ef 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap
@@ -1,9 +1,9 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:1:1: F821 Undefined name `PythonFinalizationError`. Consider specifying `requires-python = ">= 3.13"` or `tool.ruff.target-version = "py313"` in your `pyproject.toml` file.
+F821 Undefined name `PythonFinalizationError`. Consider specifying `requires-python = ">= 3.13"` or `tool.ruff.target-version = "py313"` in your `pyproject.toml` file.
+ --> :1:1
|
1 | PythonFinalizationError
- | ^^^^^^^^^^^^^^^^^^^^^^^ F821
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap
index c87dbb04b6..747f7ba421 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used
+F841 [*] Local variable `e` is assigned to but never used
+ --> F841_0.py:3:22
|
1 | try:
2 | 1 / 0
3 | except ValueError as e:
- | ^ F841
+ | ^
4 | pass
|
- = help: Remove assignment to unused variable `e`
+help: Remove assignment to unused variable `e`
ℹ Safe fix
1 1 | try:
@@ -20,14 +21,15 @@ F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used
5 5 |
6 6 |
-F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used
+F841 [*] Local variable `foo` is assigned to but never used
+ --> F841_0.py:20:5
|
19 | def f():
20 | foo = (1, 2)
- | ^^^ F841
+ | ^^^
21 | (a, b) = (1, 2)
|
- = help: Remove assignment to unused variable `foo`
+help: Remove assignment to unused variable `foo`
ℹ Unsafe fix
17 17 |
@@ -38,36 +40,39 @@ F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used
22 21 |
23 22 | bar = (1, 2)
-F841_0.py:21:6: F841 Local variable `a` is assigned to but never used
+F841 Local variable `a` is assigned to but never used
+ --> F841_0.py:21:6
|
19 | def f():
20 | foo = (1, 2)
21 | (a, b) = (1, 2)
- | ^ F841
+ | ^
22 |
23 | bar = (1, 2)
|
- = help: Remove assignment to unused variable `a`
+help: Remove assignment to unused variable `a`
-F841_0.py:21:9: F841 Local variable `b` is assigned to but never used
+F841 Local variable `b` is assigned to but never used
+ --> F841_0.py:21:9
|
19 | def f():
20 | foo = (1, 2)
21 | (a, b) = (1, 2)
- | ^ F841
+ | ^
22 |
23 | bar = (1, 2)
|
- = help: Remove assignment to unused variable `b`
+help: Remove assignment to unused variable `b`
-F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used
+F841 [*] Local variable `baz` is assigned to but never used
+ --> F841_0.py:26:14
|
24 | (c, d) = bar
25 |
26 | (x, y) = baz = bar
- | ^^^ F841
+ | ^^^
|
- = help: Remove assignment to unused variable `baz`
+help: Remove assignment to unused variable `baz`
ℹ Unsafe fix
23 23 | bar = (1, 2)
@@ -79,15 +84,16 @@ F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used
28 28 |
29 29 | def f():
-F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used
+F841 [*] Local variable `_` is assigned to but never used
+ --> F841_0.py:35:5
|
34 | def f():
35 | _ = 1
- | ^ F841
+ | ^
36 | __ = 1
37 | _discarded = 1
|
- = help: Remove assignment to unused variable `_`
+help: Remove assignment to unused variable `_`
ℹ Unsafe fix
32 32 |
@@ -98,15 +104,16 @@ F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used
37 36 | _discarded = 1
38 37 |
-F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used
+F841 [*] Local variable `__` is assigned to but never used
+ --> F841_0.py:36:5
|
34 | def f():
35 | _ = 1
36 | __ = 1
- | ^^ F841
+ | ^^
37 | _discarded = 1
|
- = help: Remove assignment to unused variable `__`
+help: Remove assignment to unused variable `__`
ℹ Unsafe fix
33 33 |
@@ -117,14 +124,15 @@ F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used
38 37 |
39 38 |
-F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never used
+F841 [*] Local variable `_discarded` is assigned to but never used
+ --> F841_0.py:37:5
|
35 | _ = 1
36 | __ = 1
37 | _discarded = 1
- | ^^^^^^^^^^ F841
+ | ^^^^^^^^^^
|
- = help: Remove assignment to unused variable `_discarded`
+help: Remove assignment to unused variable `_discarded`
ℹ Unsafe fix
34 34 | def f():
@@ -135,16 +143,17 @@ F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never us
39 38 |
40 39 | a = 1
-F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used
+F841 [*] Local variable `b` is assigned to but never used
+ --> F841_0.py:51:9
|
49 | def c():
50 | # F841
51 | b = 1
- | ^ F841
+ | ^
52 |
53 | def d():
|
- = help: Remove assignment to unused variable `b`
+help: Remove assignment to unused variable `b`
ℹ Unsafe fix
48 48 |
@@ -156,14 +165,15 @@ F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used
53 53 | def d():
54 54 | nonlocal b
-F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used
+F841 [*] Local variable `my_file` is assigned to but never used
+ --> F841_0.py:79:26
|
78 | def f():
79 | with open("file") as my_file, open("") as ((this, that)):
- | ^^^^^^^ F841
+ | ^^^^^^^
80 | print("hello")
|
- = help: Remove assignment to unused variable `my_file`
+help: Remove assignment to unused variable `my_file`
ℹ Unsafe fix
76 76 |
@@ -175,16 +185,17 @@ F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used
81 81 |
82 82 |
-F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used
+F841 [*] Local variable `my_file` is assigned to but never used
+ --> F841_0.py:85:25
|
83 | def f():
84 | with (
85 | open("file") as my_file,
- | ^^^^^^^ F841
+ | ^^^^^^^
86 | open("") as ((this, that)),
87 | ):
|
- = help: Remove assignment to unused variable `my_file`
+help: Remove assignment to unused variable `my_file`
ℹ Unsafe fix
82 82 |
@@ -196,16 +207,17 @@ F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used
87 87 | ):
88 88 | print("hello")
-F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used
+F841 [*] Local variable `msg3` is assigned to but never used
+ --> F841_0.py:102:5
|
100 | msg1 = "Hello, world!"
101 | msg2 = "Hello, world!"
102 | msg3 = "Hello, world!"
- | ^^^^ F841
+ | ^^^^
103 | match x:
104 | case 1:
|
- = help: Remove assignment to unused variable `msg3`
+help: Remove assignment to unused variable `msg3`
ℹ Unsafe fix
99 99 | def f(x: int):
@@ -216,16 +228,17 @@ F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used
104 103 | case 1:
105 104 | print(msg1)
-F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used
+F841 [*] Local variable `Baz` is assigned to but never used
+ --> F841_0.py:115:5
|
113 | Foo = enum.Enum("Foo", "A B")
114 | Bar = enum.Enum("Bar", "A B")
115 | Baz = enum.Enum("Baz", "A B")
- | ^^^ F841
+ | ^^^
116 |
117 | match x:
|
- = help: Remove assignment to unused variable `Baz`
+help: Remove assignment to unused variable `Baz`
ℹ Unsafe fix
112 112 |
@@ -237,34 +250,37 @@ F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used
117 117 | match x:
118 118 | case (Foo.A):
-F841_0.py:122:14: F841 Local variable `y` is assigned to but never used
+F841 Local variable `y` is assigned to but never used
+ --> F841_0.py:122:14
|
120 | case [Bar.A, *_]:
121 | print("A")
122 | case y:
- | ^ F841
+ | ^
123 | pass
|
- = help: Remove assignment to unused variable `y`
+help: Remove assignment to unused variable `y`
-F841_0.py:127:21: F841 Local variable `value` is assigned to but never used
+F841 Local variable `value` is assigned to but never used
+ --> F841_0.py:127:21
|
126 | def f():
127 | if any((key := (value := x)) for x in ["ok"]):
- | ^^^^^ F841
+ | ^^^^^
128 | print(key)
|
- = help: Remove assignment to unused variable `value`
+help: Remove assignment to unused variable `value`
-F841_0.py:152:25: F841 [*] Local variable `_` is assigned to but never used
+F841 [*] Local variable `_` is assigned to but never used
+ --> F841_0.py:152:25
|
150 | try:
151 | pass
152 | except Exception as _:
- | ^ F841
+ | ^
153 | pass
|
- = help: Remove assignment to unused variable `_`
+help: Remove assignment to unused variable `_`
ℹ Safe fix
149 149 | def f():
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__future_annotations.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__future_annotations.snap
index 8b35fbaf54..82363cecfc 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__future_annotations.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__future_annotations.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-future_annotations.py:8:5: F401 [*] `models.Nut` imported but unused
+F401 [*] `models.Nut` imported but unused
+ --> future_annotations.py:8:5
|
6 | from models import (
7 | Fruit,
8 | Nut,
- | ^^^ F401
+ | ^^^
9 | )
|
- = help: Remove unused import: `models.Nut`
+help: Remove unused import: `models.Nut`
ℹ Safe fix
5 5 |
@@ -21,10 +21,11 @@ future_annotations.py:8:5: F401 [*] `models.Nut` imported but unused
10 9 |
11 10 |
-future_annotations.py:26:19: F821 Undefined name `Bar`
+F821 Undefined name `Bar`
+ --> future_annotations.py:26:19
|
25 | @classmethod
26 | def c(cls) -> Bar:
- | ^^^ F821
+ | ^^^
27 | return cls(x=0, y=0)
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__init.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__init.snap
index 4153aa879f..1da16d9100 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__init.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__init.snap
@@ -1,11 +1,12 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:1:8: F401 `os` imported but unused
+F401 `os` imported but unused
+ --> __init__.py:1:8
|
1 | import os
- | ^^ F401
+ | ^^
2 |
3 | print(__path__)
|
- = help: Remove unused import: `os`
+help: Remove unused import: `os`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_multiple_unbinds_from_module_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_multiple_unbinds_from_module_scope.snap
index 96e7e24ad0..2972d12298 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_multiple_unbinds_from_module_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_multiple_unbinds_from_module_scope.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:7:26: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :7:26
|
5 | try:
6 | pass
7 | except ValueError as x:
- | ^ F841
+ | ^
8 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
4 4 | def f():
@@ -22,15 +22,16 @@ snapshot_kind: text
9 9 |
10 10 | try:
-:12:26: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :12:26
|
10 | try:
11 | pass
12 | except ValueError as x:
- | ^ F841
+ | ^
13 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
9 9 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap
index a138818982..377df1d4a9 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:8:30: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :8:30
|
6 | try:
7 | pass
8 | except ValueError as x:
- | ^ F841
+ | ^
9 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
5 5 | def f():
@@ -22,10 +22,11 @@ snapshot_kind: text
10 10 |
11 11 | # This should raise an F821 error, rather than resolving to the
-:13:15: F821 Undefined name `x`
+F821 Undefined name `x`
+ --> :13:15
|
11 | # This should raise an F821 error, rather than resolving to the
12 | # `x` in `x = 1`.
13 | print(x)
- | ^ F821
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_module_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_module_scope.snap
index cc283ed4cf..fc2a79d306 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_module_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_module_scope.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:7:26: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :7:26
|
5 | try:
6 | pass
7 | except ValueError as x:
- | ^ F841
+ | ^
8 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
4 4 | def f():
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_nested_module_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_nested_module_scope.snap
index 759d5b3574..ab3f650e89 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_nested_module_scope.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_nested_module_scope.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:7:26: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :7:26
|
5 | try:
6 | pass
7 | except ValueError as x:
- | ^ F841
+ | ^
8 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
4 4 | def f():
@@ -22,15 +22,16 @@ snapshot_kind: text
9 9 |
10 10 | def g():
-:13:30: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :13:30
|
11 | try:
12 | pass
13 | except ValueError as x:
- | ^ F841
+ | ^
14 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
10 10 | def g():
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap
index 2a79871a80..a19d8ab553 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-multi_statement_lines.py:2:12: F401 [*] `foo1` imported but unused
+F401 [*] `foo1` imported but unused
+ --> multi_statement_lines.py:2:12
|
1 | if True:
2 | import foo1; x = 1
- | ^^^^ F401
+ | ^^^^
3 | import foo2; x = 1
|
- = help: Remove unused import: `foo1`
+help: Remove unused import: `foo1`
ℹ Safe fix
1 1 | if True:
@@ -18,16 +19,17 @@ multi_statement_lines.py:2:12: F401 [*] `foo1` imported but unused
4 4 |
5 5 | if True:
-multi_statement_lines.py:3:12: F401 [*] `foo2` imported but unused
+F401 [*] `foo2` imported but unused
+ --> multi_statement_lines.py:3:12
|
1 | if True:
2 | import foo1; x = 1
3 | import foo2; x = 1
- | ^^^^ F401
+ | ^^^^
4 |
5 | if True:
|
- = help: Remove unused import: `foo2`
+help: Remove unused import: `foo2`
ℹ Safe fix
1 1 | if True:
@@ -38,14 +40,15 @@ multi_statement_lines.py:3:12: F401 [*] `foo2` imported but unused
5 5 | if True:
6 6 | import foo3; \
-multi_statement_lines.py:6:12: F401 [*] `foo3` imported but unused
+F401 [*] `foo3` imported but unused
+ --> multi_statement_lines.py:6:12
|
5 | if True:
6 | import foo3; \
- | ^^^^ F401
+ | ^^^^
7 | x = 1
|
- = help: Remove unused import: `foo3`
+help: Remove unused import: `foo3`
ℹ Safe fix
3 3 | import foo2; x = 1
@@ -58,14 +61,15 @@ multi_statement_lines.py:6:12: F401 [*] `foo3` imported but unused
9 8 | if True:
10 9 | import foo4 \
-multi_statement_lines.py:10:12: F401 [*] `foo4` imported but unused
+F401 [*] `foo4` imported but unused
+ --> multi_statement_lines.py:10:12
|
9 | if True:
10 | import foo4 \
- | ^^^^ F401
+ | ^^^^
11 | ; x = 1
|
- = help: Remove unused import: `foo4`
+help: Remove unused import: `foo4`
ℹ Safe fix
7 7 | x = 1
@@ -78,13 +82,14 @@ multi_statement_lines.py:10:12: F401 [*] `foo4` imported but unused
13 12 | if True:
14 13 | x = 1; import foo5
-multi_statement_lines.py:14:19: F401 [*] `foo5` imported but unused
+F401 [*] `foo5` imported but unused
+ --> multi_statement_lines.py:14:19
|
13 | if True:
14 | x = 1; import foo5
- | ^^^^ F401
+ | ^^^^
|
- = help: Remove unused import: `foo5`
+help: Remove unused import: `foo5`
ℹ Safe fix
11 11 | ; x = 1
@@ -96,16 +101,17 @@ multi_statement_lines.py:14:19: F401 [*] `foo5` imported but unused
16 16 |
17 17 | if True:
-multi_statement_lines.py:19:17: F401 [*] `foo6` imported but unused
+F401 [*] `foo6` imported but unused
+ --> multi_statement_lines.py:19:17
|
17 | if True:
18 | x = 1; \
19 | import foo6
- | ^^^^ F401
+ | ^^^^
20 |
21 | if True:
|
- = help: Remove unused import: `foo6`
+help: Remove unused import: `foo6`
ℹ Safe fix
15 15 |
@@ -118,16 +124,17 @@ multi_statement_lines.py:19:17: F401 [*] `foo6` imported but unused
21 20 | if True:
22 21 | x = 1 \
-multi_statement_lines.py:23:18: F401 [*] `foo7` imported but unused
+F401 [*] `foo7` imported but unused
+ --> multi_statement_lines.py:23:18
|
21 | if True:
22 | x = 1 \
23 | ; import foo7
- | ^^^^ F401
+ | ^^^^
24 |
25 | if True:
|
- = help: Remove unused import: `foo7`
+help: Remove unused import: `foo7`
ℹ Safe fix
20 20 |
@@ -139,14 +146,15 @@ multi_statement_lines.py:23:18: F401 [*] `foo7` imported but unused
25 25 | if True:
26 26 | x = 1; import foo8; x = 1
-multi_statement_lines.py:26:19: F401 [*] `foo8` imported but unused
+F401 [*] `foo8` imported but unused
+ --> multi_statement_lines.py:26:19
|
25 | if True:
26 | x = 1; import foo8; x = 1
- | ^^^^ F401
+ | ^^^^
27 | x = 1; import foo9; x = 1
|
- = help: Remove unused import: `foo8`
+help: Remove unused import: `foo8`
ℹ Safe fix
23 23 | ; import foo7
@@ -158,16 +166,17 @@ multi_statement_lines.py:26:19: F401 [*] `foo8` imported but unused
28 28 |
29 29 | if True:
-multi_statement_lines.py:27:23: F401 [*] `foo9` imported but unused
+F401 [*] `foo9` imported but unused
+ --> multi_statement_lines.py:27:23
|
25 | if True:
26 | x = 1; import foo8; x = 1
27 | x = 1; import foo9; x = 1
- | ^^^^ F401
+ | ^^^^
28 |
29 | if True:
|
- = help: Remove unused import: `foo9`
+help: Remove unused import: `foo9`
ℹ Safe fix
24 24 |
@@ -179,15 +188,16 @@ multi_statement_lines.py:27:23: F401 [*] `foo9` imported but unused
29 29 | if True:
30 30 | x = 1; \
-multi_statement_lines.py:31:16: F401 [*] `foo10` imported but unused
+F401 [*] `foo10` imported but unused
+ --> multi_statement_lines.py:31:16
|
29 | if True:
30 | x = 1; \
31 | import foo10; \
- | ^^^^^ F401
+ | ^^^^^
32 | x = 1
|
- = help: Remove unused import: `foo10`
+help: Remove unused import: `foo10`
ℹ Safe fix
28 28 |
@@ -200,15 +210,16 @@ multi_statement_lines.py:31:16: F401 [*] `foo10` imported but unused
34 33 | if True:
35 34 | x = 1 \
-multi_statement_lines.py:36:17: F401 [*] `foo11` imported but unused
+F401 [*] `foo11` imported but unused
+ --> multi_statement_lines.py:36:17
|
34 | if True:
35 | x = 1 \
36 | ;import foo11 \
- | ^^^^^ F401
+ | ^^^^^
37 | ;x = 1
|
- = help: Remove unused import: `foo11`
+help: Remove unused import: `foo11`
ℹ Safe fix
33 33 |
@@ -219,16 +230,17 @@ multi_statement_lines.py:36:17: F401 [*] `foo11` imported but unused
38 37 |
39 38 | if True:
-multi_statement_lines.py:42:16: F401 [*] `foo12` imported but unused
+F401 [*] `foo12` imported but unused
+ --> multi_statement_lines.py:42:16
|
40 | x = 1; \
41 | \
42 | import foo12
- | ^^^^^ F401
+ | ^^^^^
43 |
44 | if True:
|
- = help: Remove unused import: `foo12`
+help: Remove unused import: `foo12`
ℹ Safe fix
37 37 | ;x = 1
@@ -242,14 +254,15 @@ multi_statement_lines.py:42:16: F401 [*] `foo12` imported but unused
44 42 | if True:
45 43 | x = 1; \
-multi_statement_lines.py:47:12: F401 [*] `foo13` imported but unused
+F401 [*] `foo13` imported but unused
+ --> multi_statement_lines.py:47:12
|
45 | x = 1; \
46 | \
47 | import foo13
- | ^^^^^ F401
+ | ^^^^^
|
- = help: Remove unused import: `foo13`
+help: Remove unused import: `foo13`
ℹ Safe fix
42 42 | import foo12
@@ -263,16 +276,17 @@ multi_statement_lines.py:47:12: F401 [*] `foo13` imported but unused
49 47 |
50 48 | if True:
-multi_statement_lines.py:53:12: F401 [*] `foo14` imported but unused
+F401 [*] `foo14` imported but unused
+ --> multi_statement_lines.py:53:12
|
51 | x = 1; \
52 | # \
53 | import foo14
- | ^^^^^ F401
+ | ^^^^^
54 |
55 | # Continuation, but not as the last content in the file.
|
- = help: Remove unused import: `foo14`
+help: Remove unused import: `foo14`
ℹ Safe fix
50 50 | if True:
@@ -283,16 +297,17 @@ multi_statement_lines.py:53:12: F401 [*] `foo14` imported but unused
55 54 | # Continuation, but not as the last content in the file.
56 55 | x = 1; \
-multi_statement_lines.py:57:8: F401 [*] `foo15` imported but unused
+F401 [*] `foo15` imported but unused
+ --> multi_statement_lines.py:57:8
|
55 | # Continuation, but not as the last content in the file.
56 | x = 1; \
57 | import foo15
- | ^^^^^ F401
+ | ^^^^^
58 |
59 | # Continuation, followed by end-of-file. (Removing `import foo` would cause a syntax
|
- = help: Remove unused import: `foo15`
+help: Remove unused import: `foo15`
ℹ Safe fix
53 53 | import foo14
@@ -305,14 +320,15 @@ multi_statement_lines.py:57:8: F401 [*] `foo15` imported but unused
59 58 | # Continuation, followed by end-of-file. (Removing `import foo` would cause a syntax
60 59 | # error.)
-multi_statement_lines.py:62:8: F401 [*] `foo16` imported but unused
+F401 [*] `foo16` imported but unused
+ --> multi_statement_lines.py:62:8
|
60 | # error.)
61 | x = 1; \
62 | import foo16
- | ^^^^^ F401
+ | ^^^^^
|
- = help: Remove unused import: `foo16`
+help: Remove unused import: `foo16`
ℹ Safe fix
58 58 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap
index b6285d774f..d9bbd4c321 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-baz.py:26:17: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> baz.py:26:17
|
25 | # F821
26 | x: Literal["foo"]
- | ^^^ F821
+ | ^^^
|
-baz.py:33:17: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> baz.py:33:17
|
32 | # F821
33 | x: Literal["foo"]
- | ^^^ F821
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap
index ebd332ca01..dc63a9b851 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 [*] `sys` imported but unused
+F401 [*] `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
ℹ Unsafe fix
16 16 | import argparse as argparse # Ok: is redundant alias
@@ -18,12 +18,13 @@ __init__.py:19:8: F401 [*] `sys` imported but unused
21 20 |
22 21 | # first-party
-__init__.py:33:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:33:15
|
33 | from . import unused # F401: change to redundant alias
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Use an explicit re-export: `unused as unused`
+help: Use an explicit re-export: `unused as unused`
ℹ Safe fix
30 30 | from . import aliased as aliased # Ok: is redundant alias
@@ -35,9 +36,10 @@ __init__.py:33:15: F401 [*] `.unused` imported but unused; consider removing, ad
35 35 |
36 36 | from . import renamed as bees # F401: no fix
-__init__.py:36:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:26
|
36 | from . import renamed as bees # F401: no fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Use an explicit re-export: `renamed as renamed`
+help: Use an explicit re-export: `renamed as renamed`
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap
index 6b4906ee54..ca0228f64f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:19:8: F401 [*] `sys` imported but unused
+F401 [*] `sys` imported but unused
+ --> __init__.py:19:8
|
19 | import sys # F401: remove unused
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `sys`
+help: Remove unused import: `sys`
ℹ Unsafe fix
16 16 | import argparse # Ok: is exported in __all__
@@ -18,12 +18,13 @@ __init__.py:19:8: F401 [*] `sys` imported but unused
21 20 |
22 21 | # first-party
-__init__.py:36:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:36:15
|
36 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
ℹ Safe fix
39 39 | from . import renamed as bees # F401: add to __all__
@@ -32,12 +33,13 @@ __init__.py:36:15: F401 [*] `.unused` imported but unused; consider removing, ad
42 |-__all__ = ["argparse", "exported"]
42 |+__all__ = ["argparse", "exported", "unused"]
-__init__.py:39:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:39:26
|
39 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
ℹ Safe fix
39 39 | from . import renamed as bees # F401: add to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap
index 60d58e3597..9cdd127afb 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
ℹ Safe fix
8 8 | from . import renamed as bees # F401: add to __all__
@@ -16,12 +16,13 @@ __init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, add
11 |-__all__ = []
11 |+__all__ = ["unused"]
-__init__.py:8:26: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
ℹ Safe fix
8 8 | from . import renamed as bees # F401: add to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap
index 17856067e6..f74e91a35b 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap
@@ -1,17 +1,18 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused # F401: recommend add to all w/o fix
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
-__init__.py:8:26: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:26
|
8 | from . import renamed as bees # F401: recommend add to all w/o fix
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap
index 0a5fcedf8c..b85570c0c7 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap
@@ -1,13 +1,13 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:15
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^^^ F401
+ | ^^^^^^
|
- = help: Add unused import `unused` to __all__
+help: Add unused import `unused` to __all__
ℹ Safe fix
5 5 | from . import unused, renamed as bees # F401: add to __all__
@@ -16,12 +16,13 @@ __init__.py:5:15: F401 [*] `.unused` imported but unused; consider removing, add
8 |-__all__ = [];
8 |+__all__ = ["bees", "unused"];
-__init__.py:5:34: F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:5:34
|
5 | from . import unused, renamed as bees # F401: add to __all__
- | ^^^^ F401
+ | ^^^^
|
- = help: Add unused import `bees` to __all__
+help: Add unused import `bees` to __all__
ℹ Safe fix
5 5 | from . import unused, renamed as bees # F401: add to __all__
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_29__all_conditional____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_29__all_conditional____init__.py.snap
index 57c17bb0c5..3cc9d9eac6 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_29__all_conditional____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_29__all_conditional____init__.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:8:15: F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:15
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^^^ F401
+ | ^^^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
-__init__.py:8:44: F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
+ --> __init__.py:8:44
|
6 | import sys
7 |
8 | from . import unused, exported, renamed as bees
- | ^^^^ F401
+ | ^^^^
9 |
10 | if sys.version_info > (3, 9):
|
- = help: Remove unused import
+help: Remove unused import
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap
index d17deaa838..1f40e7cb69 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-__init__.py:8:35: F401 [*] `F401_33.other.Ham` imported but unused
+F401 [*] `F401_33.other.Ham` imported but unused
+ --> __init__.py:8:35
|
6 | class Spam:
7 | def __init__(self) -> None:
8 | from F401_33.other import Ham
- | ^^^ F401
+ | ^^^
|
- = help: Remove unused import: `F401_33.other.Ham`
+help: Remove unused import: `F401_33.other.Ham`
ℹ Unsafe fix
5 5 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401___init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401___init__.py.snap
index a6ec69a4a5..89b804e26f 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401___init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401___init__.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:1:8: F401 [*] `os` imported but unused
+F401 [*] `os` imported but unused
+ --> __init__.py:1:8
|
1 | import os
- | ^^ F401
+ | ^^
2 |
3 | print(__path__)
|
- = help: Remove unused import: `os`
+help: Remove unused import: `os`
ℹ Unsafe fix
1 |-import os
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap
index 40b04dfafd..fc93eac03e 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap
@@ -1,26 +1,29 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
-__init__.py:5:12: F822 Undefined name `a` in `__all__`
+F822 Undefined name `a` in `__all__`
+ --> __init__.py:5:12
|
3 | print(__path__)
4 |
5 | __all__ = ["a", "b", "c"]
- | ^^^ F822
+ | ^^^
|
-__init__.py:5:17: F822 Undefined name `b` in `__all__`
+F822 Undefined name `b` in `__all__`
+ --> __init__.py:5:17
|
3 | print(__path__)
4 |
5 | __all__ = ["a", "b", "c"]
- | ^^^ F822
+ | ^^^
|
-__init__.py:5:22: F822 Undefined name `c` in `__all__`
+F822 Undefined name `c` in `__all__`
+ --> __init__.py:5:22
|
3 | print(__path__)
4 |
5 | __all__ = ["a", "b", "c"]
- | ^^^ F822
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_double_shadowing_except.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_double_shadowing_except.snap
index 6e9134a854..30100ddb2d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_double_shadowing_except.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_double_shadowing_except.snap
@@ -1,17 +1,17 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:7:26: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :7:26
|
5 | try:
6 | 1 / 0
7 | except ValueError as x:
- | ^ F841
+ | ^
8 | pass
9 | except ImportError as x:
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
4 4 |
@@ -23,15 +23,16 @@ snapshot_kind: text
9 9 | except ImportError as x:
10 10 | pass
-:9:27: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :9:27
|
7 | except ValueError as x:
8 | pass
9 | except ImportError as x:
- | ^ F841
+ | ^
10 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
6 6 | 1 / 0
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_shadowing_except.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_shadowing_except.snap
index 1a04064c1b..2c495fdf7d 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_shadowing_except.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__print_in_body_after_shadowing_except.snap
@@ -1,16 +1,16 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-:7:25: F841 [*] Local variable `x` is assigned to but never used
+F841 [*] Local variable `x` is assigned to but never used
+ --> :7:25
|
5 | try:
6 | 1 / 0
7 | except Exception as x:
- | ^ F841
+ | ^
8 | pass
|
- = help: Remove assignment to unused variable `x`
+help: Remove assignment to unused variable `x`
ℹ Safe fix
4 4 |
diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap
index 0b9f6a7672..bb3c7028ef 100644
--- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap
+++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
-snapshot_kind: text
---
-bar.py:26:17: F821 Undefined name `foo`
+F821 Undefined name `foo`
+ --> bar.py:26:17
|
25 | # F821
26 | x: Literal["foo"]
- | ^^^ F821
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap
index 20b023cd3d..165f6598b8 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap
@@ -1,38 +1,42 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH003_0.py:1:8: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_0.py:1:8
|
1 | x = 1 # type: ignore
- | ^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^
2 | x = 1 # type:ignore
3 | x = 1 # type: ignore[attr-defined] # type: ignore
|
-PGH003_0.py:2:8: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_0.py:2:8
|
1 | x = 1 # type: ignore
2 | x = 1 # type:ignore
- | ^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^
3 | x = 1 # type: ignore[attr-defined] # type: ignore
4 | x = 1 # type: ignoreme # type: ignore
|
-PGH003_0.py:3:38: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_0.py:3:38
|
1 | x = 1 # type: ignore
2 | x = 1 # type:ignore
3 | x = 1 # type: ignore[attr-defined] # type: ignore
- | ^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^
4 | x = 1 # type: ignoreme # type: ignore
|
-PGH003_0.py:4:25: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_0.py:4:25
|
2 | x = 1 # type:ignore
3 | x = 1 # type: ignore[attr-defined] # type: ignore
4 | x = 1 # type: ignoreme # type: ignore
- | ^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^
5 |
6 | x = 1
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_1.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_1.py.snap
index 3050506086..d5efb8bd01 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_1.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH003_PGH003_1.py.snap
@@ -1,28 +1,31 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH003_1.py:1:8: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_1.py:1:8
|
1 | x = 1 # pyright: ignore
- | ^^^^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^^^^
2 | x = 1 # pyright:ignore
3 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore
|
-PGH003_1.py:2:8: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_1.py:2:8
|
1 | x = 1 # pyright: ignore
2 | x = 1 # pyright:ignore
- | ^^^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^^^
3 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore
|
-PGH003_1.py:3:41: PGH003 Use specific rule codes when ignoring type issues
+PGH003 Use specific rule codes when ignoring type issues
+ --> PGH003_1.py:3:41
|
1 | x = 1 # pyright: ignore
2 | x = 1 # pyright:ignore
3 | x = 1 # pyright: ignore[attr-defined] # pyright: ignore
- | ^^^^^^^^^^^^^^^^^ PGH003
+ | ^^^^^^^^^^^^^^^^^
4 |
5 | x = 1
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap
index 1b812d166f..86fd2f43f6 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap
@@ -1,43 +1,47 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH004_0.py:1:8: PGH004 Use specific rule codes when using `noqa`
+PGH004 Use specific rule codes when using `noqa`
+ --> PGH004_0.py:1:8
|
1 | x = 1 # noqa
- | ^^^^^^ PGH004
+ | ^^^^^^
2 | x = 1 # NOQA:F401,W203
3 | # noqa
|
-PGH004_0.py:3:1: PGH004 Use specific rule codes when using `noqa`
+PGH004 Use specific rule codes when using `noqa`
+ --> PGH004_0.py:3:1
|
1 | x = 1 # noqa
2 | x = 1 # NOQA:F401,W203
3 | # noqa
- | ^^^^^^ PGH004
+ | ^^^^^^
4 | # NOQA
5 | # noqa:F401
|
-PGH004_0.py:4:1: PGH004 Use specific rule codes when using `noqa`
+PGH004 Use specific rule codes when using `noqa`
+ --> PGH004_0.py:4:1
|
2 | x = 1 # NOQA:F401,W203
3 | # noqa
4 | # NOQA
- | ^^^^^^ PGH004
+ | ^^^^^^
5 | # noqa:F401
6 | # noqa:F401,W203
|
-PGH004_0.py:18:8: PGH004 [*] Use a colon when specifying `noqa` rule codes
+PGH004 [*] Use a colon when specifying `noqa` rule codes
+ --> PGH004_0.py:18:8
|
17 | # PGH004
18 | x = 2 # noqa X100
- | ^^^^^^^ PGH004
+ | ^^^^^^^
19 |
20 | # PGH004
|
- = help: Add missing colon
+help: Add missing colon
ℹ Unsafe fix
15 15 | x = 2 # noqa:X100
@@ -49,15 +53,16 @@ PGH004_0.py:18:8: PGH004 [*] Use a colon when specifying `noqa` rule codes
20 20 | # PGH004
21 21 | x = 2 # noqa X100, X200
-PGH004_0.py:21:8: PGH004 [*] Use a colon when specifying `noqa` rule codes
+PGH004 [*] Use a colon when specifying `noqa` rule codes
+ --> PGH004_0.py:21:8
|
20 | # PGH004
21 | x = 2 # noqa X100, X200
- | ^^^^^^^ PGH004
+ | ^^^^^^^
22 |
23 | # PGH004
|
- = help: Add missing colon
+help: Add missing colon
ℹ Unsafe fix
18 18 | x = 2 # noqa X100
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap
index a4aee355b8..5edca0674a 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap
@@ -1,9 +1,9 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
-snapshot_kind: text
---
-PGH004_1.py:1:1: PGH004 Use specific rule codes when using `noqa`
+PGH004 Use specific rule codes when using `noqa`
+ --> PGH004_1.py:1:1
|
1 | #noqa
- | ^^^^^ PGH004
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_2.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_2.py.snap
index 6c93b8a108..b7105655a9 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_2.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_2.py.snap
@@ -1,25 +1,28 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH004_2.py:1:1: PGH004 Use specific rule codes when using `noqa`
+PGH004 Use specific rule codes when using `noqa`
+ --> PGH004_2.py:1:1
|
1 | # noqa
- | ^^^^^^ PGH004
+ | ^^^^^^
2 | # ruff : noqa
3 | # ruff: noqa: F401
|
-PGH004_2.py:2:1: PGH004 Use specific rule codes when using `ruff: noqa`
+PGH004 Use specific rule codes when using `ruff: noqa`
+ --> PGH004_2.py:2:1
|
1 | # noqa
2 | # ruff : noqa
- | ^^^^^^^^^^^^^ PGH004
+ | ^^^^^^^^^^^^^
3 | # ruff: noqa: F401
|
-PGH004_2.py:6:1: PGH004 Use specific rule codes when using `ruff: noqa`
+PGH004 Use specific rule codes when using `ruff: noqa`
+ --> PGH004_2.py:6:1
|
6 | # flake8: noqa
- | ^^^^^^^^^^^^^^ PGH004
+ | ^^^^^^^^^^^^^^
7 | import math as m
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH005_PGH005_0.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH005_PGH005_0.py.snap
index f95f64df91..651f26d344 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH005_PGH005_0.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH005_PGH005_0.py.snap
@@ -1,91 +1,100 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH005_0.py:4:8: PGH005 Non-existent mock method: `not_called`
+PGH005 Non-existent mock method: `not_called`
+ --> PGH005_0.py:4:8
|
2 | # ============
3 | # Errors
4 | assert my_mock.not_called()
- | ^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
|
-PGH005_0.py:5:8: PGH005 Non-existent mock method: `called_once_with`
+PGH005 Non-existent mock method: `called_once_with`
+ --> PGH005_0.py:5:8
|
3 | # Errors
4 | assert my_mock.not_called()
5 | assert my_mock.called_once_with()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
|
-PGH005_0.py:6:8: PGH005 Non-existent mock method: `not_called`
+PGH005 Non-existent mock method: `not_called`
+ --> PGH005_0.py:6:8
|
4 | assert my_mock.not_called()
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
- | ^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
|
-PGH005_0.py:7:8: PGH005 Non-existent mock method: `called_once_with`
+PGH005 Non-existent mock method: `called_once_with`
+ --> PGH005_0.py:7:8
|
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
8 | my_mock.assert_not_called
9 | my_mock.assert_called
|
-PGH005_0.py:8:1: PGH005 Mock method should be called: `assert_not_called`
+PGH005 Mock method should be called: `assert_not_called`
+ --> PGH005_0.py:8:1
|
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
|
-PGH005_0.py:9:1: PGH005 Mock method should be called: `assert_called`
+PGH005 Mock method should be called: `assert_called`
+ --> PGH005_0.py:9:1
|
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
9 | my_mock.assert_called
- | ^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
|
-PGH005_0.py:10:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:10:1
|
8 | my_mock.assert_not_called
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | my_mock.assert_called_once_with
12 | MyMock.assert_called_once_with
|
-PGH005_0.py:11:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:11:1
|
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | MyMock.assert_called_once_with
|
-PGH005_0.py:12:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:12:1
|
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
12 | MyMock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
14 | # OK
|
diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__preview__PGH005_PGH005_0.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__preview__PGH005_PGH005_0.py.snap
index e61728110c..664573f70b 100644
--- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__preview__PGH005_PGH005_0.py.snap
+++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__preview__PGH005_PGH005_0.py.snap
@@ -1,190 +1,209 @@
---
source: crates/ruff_linter/src/rules/pygrep_hooks/mod.rs
---
-PGH005_0.py:4:8: PGH005 Non-existent mock method: `not_called`
+PGH005 Non-existent mock method: `not_called`
+ --> PGH005_0.py:4:8
|
2 | # ============
3 | # Errors
4 | assert my_mock.not_called()
- | ^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
|
-PGH005_0.py:5:8: PGH005 Non-existent mock method: `called_once_with`
+PGH005 Non-existent mock method: `called_once_with`
+ --> PGH005_0.py:5:8
|
3 | # Errors
4 | assert my_mock.not_called()
5 | assert my_mock.called_once_with()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
|
-PGH005_0.py:6:8: PGH005 Non-existent mock method: `not_called`
+PGH005 Non-existent mock method: `not_called`
+ --> PGH005_0.py:6:8
|
4 | assert my_mock.not_called()
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
- | ^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
|
-PGH005_0.py:7:8: PGH005 Non-existent mock method: `called_once_with`
+PGH005 Non-existent mock method: `called_once_with`
+ --> PGH005_0.py:7:8
|
5 | assert my_mock.called_once_with()
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
8 | my_mock.assert_not_called
9 | my_mock.assert_called
|
-PGH005_0.py:8:1: PGH005 Mock method should be called: `assert_not_called`
+PGH005 Mock method should be called: `assert_not_called`
+ --> PGH005_0.py:8:1
|
6 | assert my_mock.not_called
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
|
-PGH005_0.py:9:1: PGH005 Mock method should be called: `assert_called`
+PGH005 Mock method should be called: `assert_called`
+ --> PGH005_0.py:9:1
|
7 | assert my_mock.called_once_with
8 | my_mock.assert_not_called
9 | my_mock.assert_called
- | ^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
|
-PGH005_0.py:10:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:10:1
|
8 | my_mock.assert_not_called
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | my_mock.assert_called_once_with
12 | MyMock.assert_called_once_with
|
-PGH005_0.py:11:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:11:1
|
9 | my_mock.assert_called
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | MyMock.assert_called_once_with
|
-PGH005_0.py:12:1: PGH005 Mock method should be called: `assert_called_once_with`
+PGH005 Mock method should be called: `assert_called_once_with`
+ --> PGH005_0.py:12:1
|
10 | my_mock.assert_called_once_with
11 | my_mock.assert_called_once_with
12 | MyMock.assert_called_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
14 | # OK
|
-PGH005_0.py:26:8: PGH005 Non-existent mock method: `not_awaited`
+PGH005 Non-existent mock method: `not_awaited`
+ --> PGH005_0.py:26:8
|
24 | # =================
25 | # Errors
26 | assert my_mock.not_awaited()
- | ^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^
27 | assert my_mock.awaited_once_with()
28 | assert my_mock.not_awaited
|
-PGH005_0.py:27:8: PGH005 Non-existent mock method: `awaited_once_with`
+PGH005 Non-existent mock method: `awaited_once_with`
+ --> PGH005_0.py:27:8
|
25 | # Errors
26 | assert my_mock.not_awaited()
27 | assert my_mock.awaited_once_with()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 | assert my_mock.not_awaited
29 | assert my_mock.awaited_once_with
|
-PGH005_0.py:28:8: PGH005 Non-existent mock method: `not_awaited`
+PGH005 Non-existent mock method: `not_awaited`
+ --> PGH005_0.py:28:8
|
26 | assert my_mock.not_awaited()
27 | assert my_mock.awaited_once_with()
28 | assert my_mock.not_awaited
- | ^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^
29 | assert my_mock.awaited_once_with
30 | my_mock.assert_not_awaited
|
-PGH005_0.py:29:8: PGH005 Non-existent mock method: `awaited_once_with`
+PGH005 Non-existent mock method: `awaited_once_with`
+ --> PGH005_0.py:29:8
|
27 | assert my_mock.awaited_once_with()
28 | assert my_mock.not_awaited
29 | assert my_mock.awaited_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
30 | my_mock.assert_not_awaited
31 | my_mock.assert_awaited
|
-PGH005_0.py:30:1: PGH005 Mock method should be called: `assert_not_awaited`
+PGH005 Mock method should be called: `assert_not_awaited`
+ --> PGH005_0.py:30:1
|
28 | assert my_mock.not_awaited
29 | assert my_mock.awaited_once_with
30 | my_mock.assert_not_awaited
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
31 | my_mock.assert_awaited
32 | my_mock.assert_awaited_once_with
|
-PGH005_0.py:31:1: PGH005 Mock method should be called: `assert_awaited`
+PGH005 Mock method should be called: `assert_awaited`
+ --> PGH005_0.py:31:1
|
29 | assert my_mock.awaited_once_with
30 | my_mock.assert_not_awaited
31 | my_mock.assert_awaited
- | ^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^
32 | my_mock.assert_awaited_once_with
33 | my_mock.assert_awaited_once_with
|
-PGH005_0.py:32:1: PGH005 Mock method should be called: `assert_awaited_once_with`
+PGH005 Mock method should be called: `assert_awaited_once_with`
+ --> PGH005_0.py:32:1
|
30 | my_mock.assert_not_awaited
31 | my_mock.assert_awaited
32 | my_mock.assert_awaited_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 | my_mock.assert_awaited_once_with
34 | MyMock.assert_awaited_once_with
|
-PGH005_0.py:33:1: PGH005 Mock method should be called: `assert_awaited_once_with`
+PGH005 Mock method should be called: `assert_awaited_once_with`
+ --> PGH005_0.py:33:1
|
31 | my_mock.assert_awaited
32 | my_mock.assert_awaited_once_with
33 | my_mock.assert_awaited_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 | MyMock.assert_awaited_once_with
35 | assert my_mock.awaited
|
-PGH005_0.py:34:1: PGH005 Mock method should be called: `assert_awaited_once_with`
+PGH005 Mock method should be called: `assert_awaited_once_with`
+ --> PGH005_0.py:34:1
|
32 | my_mock.assert_awaited_once_with
33 | my_mock.assert_awaited_once_with
34 | MyMock.assert_awaited_once_with
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 | assert my_mock.awaited
|
-PGH005_0.py:35:8: PGH005 Non-existent mock method: `awaited`
+PGH005 Non-existent mock method: `awaited`
+ --> PGH005_0.py:35:8
|
33 | my_mock.assert_awaited_once_with
34 | MyMock.assert_awaited_once_with
35 | assert my_mock.awaited
- | ^^^^^^^^^^^^^^^ PGH005
+ | ^^^^^^^^^^^^^^^
36 |
37 | # OK
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0105_type_name_incorrect_variance.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0105_type_name_incorrect_variance.py.snap
index c83f17fe22..a8416f2654 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0105_type_name_incorrect_variance.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0105_type_name_incorrect_variance.py.snap
@@ -1,316 +1,348 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-type_name_incorrect_variance.py:5:5: PLC0105 `TypeVar` name "T" does not reflect its covariance; consider renaming it to "T_co"
+PLC0105 `TypeVar` name "T" does not reflect its covariance; consider renaming it to "T_co"
+ --> type_name_incorrect_variance.py:5:5
|
3 | # Errors.
4 |
5 | T = TypeVar("T", covariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
6 | T = TypeVar("T", covariant=True, contravariant=False)
7 | T = TypeVar("T", contravariant=True)
|
-type_name_incorrect_variance.py:6:5: PLC0105 `TypeVar` name "T" does not reflect its covariance; consider renaming it to "T_co"
+PLC0105 `TypeVar` name "T" does not reflect its covariance; consider renaming it to "T_co"
+ --> type_name_incorrect_variance.py:6:5
|
5 | T = TypeVar("T", covariant=True)
6 | T = TypeVar("T", covariant=True, contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
7 | T = TypeVar("T", contravariant=True)
8 | T = TypeVar("T", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:7:5: PLC0105 `TypeVar` name "T" does not reflect its contravariance; consider renaming it to "T_contra"
+PLC0105 `TypeVar` name "T" does not reflect its contravariance; consider renaming it to "T_contra"
+ --> type_name_incorrect_variance.py:7:5
|
5 | T = TypeVar("T", covariant=True)
6 | T = TypeVar("T", covariant=True, contravariant=False)
7 | T = TypeVar("T", contravariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
8 | T = TypeVar("T", covariant=False, contravariant=True)
9 | P = ParamSpec("P", covariant=True)
|
-type_name_incorrect_variance.py:8:5: PLC0105 `TypeVar` name "T" does not reflect its contravariance; consider renaming it to "T_contra"
+PLC0105 `TypeVar` name "T" does not reflect its contravariance; consider renaming it to "T_contra"
+ --> type_name_incorrect_variance.py:8:5
|
6 | T = TypeVar("T", covariant=True, contravariant=False)
7 | T = TypeVar("T", contravariant=True)
8 | T = TypeVar("T", covariant=False, contravariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
9 | P = ParamSpec("P", covariant=True)
10 | P = ParamSpec("P", covariant=True, contravariant=False)
|
-type_name_incorrect_variance.py:9:5: PLC0105 `ParamSpec` name "P" does not reflect its covariance; consider renaming it to "P_co"
+PLC0105 `ParamSpec` name "P" does not reflect its covariance; consider renaming it to "P_co"
+ --> type_name_incorrect_variance.py:9:5
|
7 | T = TypeVar("T", contravariant=True)
8 | T = TypeVar("T", covariant=False, contravariant=True)
9 | P = ParamSpec("P", covariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
10 | P = ParamSpec("P", covariant=True, contravariant=False)
11 | P = ParamSpec("P", contravariant=True)
|
-type_name_incorrect_variance.py:10:5: PLC0105 `ParamSpec` name "P" does not reflect its covariance; consider renaming it to "P_co"
+PLC0105 `ParamSpec` name "P" does not reflect its covariance; consider renaming it to "P_co"
+ --> type_name_incorrect_variance.py:10:5
|
8 | T = TypeVar("T", covariant=False, contravariant=True)
9 | P = ParamSpec("P", covariant=True)
10 | P = ParamSpec("P", covariant=True, contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
11 | P = ParamSpec("P", contravariant=True)
12 | P = ParamSpec("P", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:11:5: PLC0105 `ParamSpec` name "P" does not reflect its contravariance; consider renaming it to "P_contra"
+PLC0105 `ParamSpec` name "P" does not reflect its contravariance; consider renaming it to "P_contra"
+ --> type_name_incorrect_variance.py:11:5
|
9 | P = ParamSpec("P", covariant=True)
10 | P = ParamSpec("P", covariant=True, contravariant=False)
11 | P = ParamSpec("P", contravariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
12 | P = ParamSpec("P", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:12:5: PLC0105 `ParamSpec` name "P" does not reflect its contravariance; consider renaming it to "P_contra"
+PLC0105 `ParamSpec` name "P" does not reflect its contravariance; consider renaming it to "P_contra"
+ --> type_name_incorrect_variance.py:12:5
|
10 | P = ParamSpec("P", covariant=True, contravariant=False)
11 | P = ParamSpec("P", contravariant=True)
12 | P = ParamSpec("P", covariant=False, contravariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
13 |
14 | T_co = TypeVar("T_co")
|
-type_name_incorrect_variance.py:14:8: PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:14:8
|
12 | P = ParamSpec("P", covariant=False, contravariant=True)
13 |
14 | T_co = TypeVar("T_co")
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
15 | T_co = TypeVar("T_co", covariant=False)
16 | T_co = TypeVar("T_co", contravariant=False)
|
-type_name_incorrect_variance.py:15:8: PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:15:8
|
14 | T_co = TypeVar("T_co")
15 | T_co = TypeVar("T_co", covariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
16 | T_co = TypeVar("T_co", contravariant=False)
17 | T_co = TypeVar("T_co", covariant=False, contravariant=False)
|
-type_name_incorrect_variance.py:16:8: PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:16:8
|
14 | T_co = TypeVar("T_co")
15 | T_co = TypeVar("T_co", covariant=False)
16 | T_co = TypeVar("T_co", contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
17 | T_co = TypeVar("T_co", covariant=False, contravariant=False)
18 | T_co = TypeVar("T_co", contravariant=True)
|
-type_name_incorrect_variance.py:17:8: PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_co" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:17:8
|
15 | T_co = TypeVar("T_co", covariant=False)
16 | T_co = TypeVar("T_co", contravariant=False)
17 | T_co = TypeVar("T_co", covariant=False, contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
18 | T_co = TypeVar("T_co", contravariant=True)
19 | T_co = TypeVar("T_co", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:18:8: PLC0105 `TypeVar` name "T_co" does not reflect its contravariance; consider renaming it to "T_contra"
+PLC0105 `TypeVar` name "T_co" does not reflect its contravariance; consider renaming it to "T_contra"
+ --> type_name_incorrect_variance.py:18:8
|
16 | T_co = TypeVar("T_co", contravariant=False)
17 | T_co = TypeVar("T_co", covariant=False, contravariant=False)
18 | T_co = TypeVar("T_co", contravariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
19 | T_co = TypeVar("T_co", covariant=False, contravariant=True)
20 | P_co = ParamSpec("P_co")
|
-type_name_incorrect_variance.py:19:8: PLC0105 `TypeVar` name "T_co" does not reflect its contravariance; consider renaming it to "T_contra"
+PLC0105 `TypeVar` name "T_co" does not reflect its contravariance; consider renaming it to "T_contra"
+ --> type_name_incorrect_variance.py:19:8
|
17 | T_co = TypeVar("T_co", covariant=False, contravariant=False)
18 | T_co = TypeVar("T_co", contravariant=True)
19 | T_co = TypeVar("T_co", covariant=False, contravariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
20 | P_co = ParamSpec("P_co")
21 | P_co = ParamSpec("P_co", covariant=False)
|
-type_name_incorrect_variance.py:20:8: PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:20:8
|
18 | T_co = TypeVar("T_co", contravariant=True)
19 | T_co = TypeVar("T_co", covariant=False, contravariant=True)
20 | P_co = ParamSpec("P_co")
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
21 | P_co = ParamSpec("P_co", covariant=False)
22 | P_co = ParamSpec("P_co", contravariant=False)
|
-type_name_incorrect_variance.py:21:8: PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:21:8
|
19 | T_co = TypeVar("T_co", covariant=False, contravariant=True)
20 | P_co = ParamSpec("P_co")
21 | P_co = ParamSpec("P_co", covariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
22 | P_co = ParamSpec("P_co", contravariant=False)
23 | P_co = ParamSpec("P_co", covariant=False, contravariant=False)
|
-type_name_incorrect_variance.py:22:8: PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:22:8
|
20 | P_co = ParamSpec("P_co")
21 | P_co = ParamSpec("P_co", covariant=False)
22 | P_co = ParamSpec("P_co", contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
23 | P_co = ParamSpec("P_co", covariant=False, contravariant=False)
24 | P_co = ParamSpec("P_co", contravariant=True)
|
-type_name_incorrect_variance.py:23:8: PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_co" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:23:8
|
21 | P_co = ParamSpec("P_co", covariant=False)
22 | P_co = ParamSpec("P_co", contravariant=False)
23 | P_co = ParamSpec("P_co", covariant=False, contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
24 | P_co = ParamSpec("P_co", contravariant=True)
25 | P_co = ParamSpec("P_co", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:24:8: PLC0105 `ParamSpec` name "P_co" does not reflect its contravariance; consider renaming it to "P_contra"
+PLC0105 `ParamSpec` name "P_co" does not reflect its contravariance; consider renaming it to "P_contra"
+ --> type_name_incorrect_variance.py:24:8
|
22 | P_co = ParamSpec("P_co", contravariant=False)
23 | P_co = ParamSpec("P_co", covariant=False, contravariant=False)
24 | P_co = ParamSpec("P_co", contravariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
25 | P_co = ParamSpec("P_co", covariant=False, contravariant=True)
|
-type_name_incorrect_variance.py:25:8: PLC0105 `ParamSpec` name "P_co" does not reflect its contravariance; consider renaming it to "P_contra"
+PLC0105 `ParamSpec` name "P_co" does not reflect its contravariance; consider renaming it to "P_contra"
+ --> type_name_incorrect_variance.py:25:8
|
23 | P_co = ParamSpec("P_co", covariant=False, contravariant=False)
24 | P_co = ParamSpec("P_co", contravariant=True)
25 | P_co = ParamSpec("P_co", covariant=False, contravariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
26 |
27 | T_contra = TypeVar("T_contra")
|
-type_name_incorrect_variance.py:27:12: PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:27:12
|
25 | P_co = ParamSpec("P_co", covariant=False, contravariant=True)
26 |
27 | T_contra = TypeVar("T_contra")
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
28 | T_contra = TypeVar("T_contra", covariant=False)
29 | T_contra = TypeVar("T_contra", contravariant=False)
|
-type_name_incorrect_variance.py:28:12: PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:28:12
|
27 | T_contra = TypeVar("T_contra")
28 | T_contra = TypeVar("T_contra", covariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
29 | T_contra = TypeVar("T_contra", contravariant=False)
30 | T_contra = TypeVar("T_contra", covariant=False, contravariant=False)
|
-type_name_incorrect_variance.py:29:12: PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:29:12
|
27 | T_contra = TypeVar("T_contra")
28 | T_contra = TypeVar("T_contra", covariant=False)
29 | T_contra = TypeVar("T_contra", contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
30 | T_contra = TypeVar("T_contra", covariant=False, contravariant=False)
31 | T_contra = TypeVar("T_contra", covariant=True)
|
-type_name_incorrect_variance.py:30:12: PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+PLC0105 `TypeVar` name "T_contra" does not reflect its invariance; consider renaming it to "T"
+ --> type_name_incorrect_variance.py:30:12
|
28 | T_contra = TypeVar("T_contra", covariant=False)
29 | T_contra = TypeVar("T_contra", contravariant=False)
30 | T_contra = TypeVar("T_contra", covariant=False, contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
31 | T_contra = TypeVar("T_contra", covariant=True)
32 | T_contra = TypeVar("T_contra", covariant=True, contravariant=False)
|
-type_name_incorrect_variance.py:31:12: PLC0105 `TypeVar` name "T_contra" does not reflect its covariance; consider renaming it to "T_co"
+PLC0105 `TypeVar` name "T_contra" does not reflect its covariance; consider renaming it to "T_co"
+ --> type_name_incorrect_variance.py:31:12
|
29 | T_contra = TypeVar("T_contra", contravariant=False)
30 | T_contra = TypeVar("T_contra", covariant=False, contravariant=False)
31 | T_contra = TypeVar("T_contra", covariant=True)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
32 | T_contra = TypeVar("T_contra", covariant=True, contravariant=False)
33 | P_contra = ParamSpec("P_contra")
|
-type_name_incorrect_variance.py:32:12: PLC0105 `TypeVar` name "T_contra" does not reflect its covariance; consider renaming it to "T_co"
+PLC0105 `TypeVar` name "T_contra" does not reflect its covariance; consider renaming it to "T_co"
+ --> type_name_incorrect_variance.py:32:12
|
30 | T_contra = TypeVar("T_contra", covariant=False, contravariant=False)
31 | T_contra = TypeVar("T_contra", covariant=True)
32 | T_contra = TypeVar("T_contra", covariant=True, contravariant=False)
- | ^^^^^^^ PLC0105
+ | ^^^^^^^
33 | P_contra = ParamSpec("P_contra")
34 | P_contra = ParamSpec("P_contra", covariant=False)
|
-type_name_incorrect_variance.py:33:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:33:12
|
31 | T_contra = TypeVar("T_contra", covariant=True)
32 | T_contra = TypeVar("T_contra", covariant=True, contravariant=False)
33 | P_contra = ParamSpec("P_contra")
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
34 | P_contra = ParamSpec("P_contra", covariant=False)
35 | P_contra = ParamSpec("P_contra", contravariant=False)
|
-type_name_incorrect_variance.py:34:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:34:12
|
32 | T_contra = TypeVar("T_contra", covariant=True, contravariant=False)
33 | P_contra = ParamSpec("P_contra")
34 | P_contra = ParamSpec("P_contra", covariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
35 | P_contra = ParamSpec("P_contra", contravariant=False)
36 | P_contra = ParamSpec("P_contra", covariant=False, contravariant=False)
|
-type_name_incorrect_variance.py:35:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:35:12
|
33 | P_contra = ParamSpec("P_contra")
34 | P_contra = ParamSpec("P_contra", covariant=False)
35 | P_contra = ParamSpec("P_contra", contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
36 | P_contra = ParamSpec("P_contra", covariant=False, contravariant=False)
37 | P_contra = ParamSpec("P_contra", covariant=True)
|
-type_name_incorrect_variance.py:36:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its invariance; consider renaming it to "P"
+ --> type_name_incorrect_variance.py:36:12
|
34 | P_contra = ParamSpec("P_contra", covariant=False)
35 | P_contra = ParamSpec("P_contra", contravariant=False)
36 | P_contra = ParamSpec("P_contra", covariant=False, contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
37 | P_contra = ParamSpec("P_contra", covariant=True)
38 | P_contra = ParamSpec("P_contra", covariant=True, contravariant=False)
|
-type_name_incorrect_variance.py:37:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its covariance; consider renaming it to "P_co"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its covariance; consider renaming it to "P_co"
+ --> type_name_incorrect_variance.py:37:12
|
35 | P_contra = ParamSpec("P_contra", contravariant=False)
36 | P_contra = ParamSpec("P_contra", covariant=False, contravariant=False)
37 | P_contra = ParamSpec("P_contra", covariant=True)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
38 | P_contra = ParamSpec("P_contra", covariant=True, contravariant=False)
|
-type_name_incorrect_variance.py:38:12: PLC0105 `ParamSpec` name "P_contra" does not reflect its covariance; consider renaming it to "P_co"
+PLC0105 `ParamSpec` name "P_contra" does not reflect its covariance; consider renaming it to "P_co"
+ --> type_name_incorrect_variance.py:38:12
|
36 | P_contra = ParamSpec("P_contra", covariant=False, contravariant=False)
37 | P_contra = ParamSpec("P_contra", covariant=True)
38 | P_contra = ParamSpec("P_contra", covariant=True, contravariant=False)
- | ^^^^^^^^^ PLC0105
+ | ^^^^^^^^^
39 |
40 | # Non-errors.
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0131_type_bivariance.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0131_type_bivariance.py.snap
index f639f50c42..9a51f94be2 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0131_type_bivariance.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0131_type_bivariance.py.snap
@@ -1,38 +1,42 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-type_bivariance.py:5:5: PLC0131 `TypeVar` "T" cannot be both covariant and contravariant
+PLC0131 `TypeVar` "T" cannot be both covariant and contravariant
+ --> type_bivariance.py:5:5
|
3 | # Errors.
4 |
5 | T = TypeVar("T", covariant=True, contravariant=True)
- | ^^^^^^^ PLC0131
+ | ^^^^^^^
6 | T = TypeVar(name="T", covariant=True, contravariant=True)
|
-type_bivariance.py:6:5: PLC0131 `TypeVar` "T" cannot be both covariant and contravariant
+PLC0131 `TypeVar` "T" cannot be both covariant and contravariant
+ --> type_bivariance.py:6:5
|
5 | T = TypeVar("T", covariant=True, contravariant=True)
6 | T = TypeVar(name="T", covariant=True, contravariant=True)
- | ^^^^^^^ PLC0131
+ | ^^^^^^^
7 |
8 | T = ParamSpec("T", covariant=True, contravariant=True)
|
-type_bivariance.py:8:5: PLC0131 `ParamSpec` "T" cannot be both covariant and contravariant
+PLC0131 `ParamSpec` "T" cannot be both covariant and contravariant
+ --> type_bivariance.py:8:5
|
6 | T = TypeVar(name="T", covariant=True, contravariant=True)
7 |
8 | T = ParamSpec("T", covariant=True, contravariant=True)
- | ^^^^^^^^^ PLC0131
+ | ^^^^^^^^^
9 | T = ParamSpec(name="T", covariant=True, contravariant=True)
|
-type_bivariance.py:9:5: PLC0131 `ParamSpec` "T" cannot be both covariant and contravariant
+PLC0131 `ParamSpec` "T" cannot be both covariant and contravariant
+ --> type_bivariance.py:9:5
|
8 | T = ParamSpec("T", covariant=True, contravariant=True)
9 | T = ParamSpec(name="T", covariant=True, contravariant=True)
- | ^^^^^^^^^ PLC0131
+ | ^^^^^^^^^
10 |
11 | # Non-errors.
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0132_type_param_name_mismatch.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0132_type_param_name_mismatch.py.snap
index f2d9025bfe..b16d5496b1 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0132_type_param_name_mismatch.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0132_type_param_name_mismatch.py.snap
@@ -1,74 +1,82 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-type_param_name_mismatch.py:5:5: PLC0132 `TypeVar` name `T` does not match assigned variable name `X`
+PLC0132 `TypeVar` name `T` does not match assigned variable name `X`
+ --> type_param_name_mismatch.py:5:5
|
3 | # Errors.
4 |
5 | X = TypeVar("T")
- | ^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^
6 | X = TypeVar(name="T")
|
-type_param_name_mismatch.py:6:5: PLC0132 `TypeVar` name `T` does not match assigned variable name `X`
+PLC0132 `TypeVar` name `T` does not match assigned variable name `X`
+ --> type_param_name_mismatch.py:6:5
|
5 | X = TypeVar("T")
6 | X = TypeVar(name="T")
- | ^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^
7 |
8 | Y = ParamSpec("T")
|
-type_param_name_mismatch.py:8:5: PLC0132 `ParamSpec` name `T` does not match assigned variable name `Y`
+PLC0132 `ParamSpec` name `T` does not match assigned variable name `Y`
+ --> type_param_name_mismatch.py:8:5
|
6 | X = TypeVar(name="T")
7 |
8 | Y = ParamSpec("T")
- | ^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^
9 | Y = ParamSpec(name="T")
|
-type_param_name_mismatch.py:9:5: PLC0132 `ParamSpec` name `T` does not match assigned variable name `Y`
+PLC0132 `ParamSpec` name `T` does not match assigned variable name `Y`
+ --> type_param_name_mismatch.py:9:5
|
8 | Y = ParamSpec("T")
9 | Y = ParamSpec(name="T")
- | ^^^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^^^
10 |
11 | Z = NewType("T", int)
|
-type_param_name_mismatch.py:11:5: PLC0132 `NewType` name `T` does not match assigned variable name `Z`
+PLC0132 `NewType` name `T` does not match assigned variable name `Z`
+ --> type_param_name_mismatch.py:11:5
|
9 | Y = ParamSpec(name="T")
10 |
11 | Z = NewType("T", int)
- | ^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^
12 | Z = NewType(name="T", tp=int)
|
-type_param_name_mismatch.py:12:5: PLC0132 `NewType` name `T` does not match assigned variable name `Z`
+PLC0132 `NewType` name `T` does not match assigned variable name `Z`
+ --> type_param_name_mismatch.py:12:5
|
11 | Z = NewType("T", int)
12 | Z = NewType(name="T", tp=int)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
14 | Ws = TypeVarTuple("Ts")
|
-type_param_name_mismatch.py:14:6: PLC0132 `TypeVarTuple` name `Ts` does not match assigned variable name `Ws`
+PLC0132 `TypeVarTuple` name `Ts` does not match assigned variable name `Ws`
+ --> type_param_name_mismatch.py:14:6
|
12 | Z = NewType(name="T", tp=int)
13 |
14 | Ws = TypeVarTuple("Ts")
- | ^^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^^
15 | Ws = TypeVarTuple(name="Ts")
|
-type_param_name_mismatch.py:15:6: PLC0132 `TypeVarTuple` name `Ts` does not match assigned variable name `Ws`
+PLC0132 `TypeVarTuple` name `Ts` does not match assigned variable name `Ws`
+ --> type_param_name_mismatch.py:15:6
|
14 | Ws = TypeVarTuple("Ts")
15 | Ws = TypeVarTuple(name="Ts")
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC0132
+ | ^^^^^^^^^^^^^^^^^^^^^^^
16 |
17 | # Non-errors.
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0205_single_string_slots.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0205_single_string_slots.py.snap
index eeb9f628e5..08d72fd335 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0205_single_string_slots.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0205_single_string_slots.py.snap
@@ -1,30 +1,33 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-single_string_slots.py:3:5: PLC0205 Class `__slots__` should be a non-string iterable
+PLC0205 Class `__slots__` should be a non-string iterable
+ --> single_string_slots.py:3:5
|
1 | # Errors.
2 | class Foo:
3 | __slots__ = "bar"
- | ^^^^^^^^^^^^^^^^^ PLC0205
+ | ^^^^^^^^^^^^^^^^^
4 |
5 | def __init__(self, bar):
|
-single_string_slots.py:10:5: PLC0205 Class `__slots__` should be a non-string iterable
+PLC0205 Class `__slots__` should be a non-string iterable
+ --> single_string_slots.py:10:5
|
9 | class Foo:
10 | __slots__: str = "bar"
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC0205
+ | ^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | def __init__(self, bar):
|
-single_string_slots.py:17:5: PLC0205 Class `__slots__` should be a non-string iterable
+PLC0205 Class `__slots__` should be a non-string iterable
+ --> single_string_slots.py:17:5
|
16 | class Foo:
17 | __slots__: str = f"bar"
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC0205
+ | ^^^^^^^^^^^^^^^^^^^^^^^
18 |
19 | def __init__(self, bar):
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0206_dict_index_missing_items.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0206_dict_index_missing_items.py.snap
index a2f87d2e5d..0979b05ae8 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0206_dict_index_missing_items.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0206_dict_index_missing_items.py.snap
@@ -1,67 +1,73 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-dict_index_missing_items.py:9:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:9:1
|
8 | # Errors
9 | / for instrument in ORCHESTRA:
10 | | print(f"{instrument}: {ORCHESTRA[instrument]}")
- | |___________________________________________________^ PLC0206
+ | |___________________________________________________^
11 |
12 | for instrument in ORCHESTRA:
|
-dict_index_missing_items.py:12:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:12:1
|
10 | print(f"{instrument}: {ORCHESTRA[instrument]}")
11 |
12 | / for instrument in ORCHESTRA:
13 | | ORCHESTRA[instrument]
- | |_________________________^ PLC0206
+ | |_________________________^
14 |
15 | for instrument in ORCHESTRA.keys():
|
-dict_index_missing_items.py:15:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:15:1
|
13 | ORCHESTRA[instrument]
14 |
15 | / for instrument in ORCHESTRA.keys():
16 | | print(f"{instrument}: {ORCHESTRA[instrument]}")
- | |___________________________________________________^ PLC0206
+ | |___________________________________________________^
17 |
18 | for instrument in ORCHESTRA.keys():
|
-dict_index_missing_items.py:18:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:18:1
|
16 | print(f"{instrument}: {ORCHESTRA[instrument]}")
17 |
18 | / for instrument in ORCHESTRA.keys():
19 | | ORCHESTRA[instrument]
- | |_________________________^ PLC0206
+ | |_________________________^
20 |
21 | for instrument in (temp_orchestra := {"violin": "strings", "oboe": "woodwind"}):
|
-dict_index_missing_items.py:21:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:21:1
|
19 | ORCHESTRA[instrument]
20 |
21 | / for instrument in (temp_orchestra := {"violin": "strings", "oboe": "woodwind"}):
22 | | print(f"{instrument}: {temp_orchestra[instrument]}")
- | |________________________________________________________^ PLC0206
+ | |________________________________________________________^
23 |
24 | for instrument in (temp_orchestra := {"violin": "strings", "oboe": "woodwind"}):
|
-dict_index_missing_items.py:24:1: PLC0206 Extracting value from dictionary without calling `.items()`
+PLC0206 Extracting value from dictionary without calling `.items()`
+ --> dict_index_missing_items.py:24:1
|
22 | print(f"{instrument}: {temp_orchestra[instrument]}")
23 |
24 | / for instrument in (temp_orchestra := {"violin": "strings", "oboe": "woodwind"}):
25 | | temp_orchestra[instrument]
- | |______________________________^ PLC0206
+ | |______________________________^
26 |
27 | # # OK
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap
index aed7f02a57..9e974b0905 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-missing_maxsplit_arg.py:14:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:14:1
|
12 | # Errors
13 | ## Test split called directly on string literal
14 | "1,2,3".split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^
15 | "1,2,3".split(",")[-1] # [missing-maxsplit-arg]
16 | "1,2,3".rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
11 11 |
@@ -22,16 +23,17 @@ missing_maxsplit_arg.py:14:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
16 16 | "1,2,3".rsplit(",")[0] # [missing-maxsplit-arg]
17 17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:15:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:15:1
|
13 | ## Test split called directly on string literal
14 | "1,2,3".split(",")[0] # [missing-maxsplit-arg]
15 | "1,2,3".split(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^
16 | "1,2,3".rsplit(",")[0] # [missing-maxsplit-arg]
17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
12 12 | # Errors
@@ -43,15 +45,16 @@ missing_maxsplit_arg.py:15:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
17 17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
18 18 |
-missing_maxsplit_arg.py:16:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:16:1
|
14 | "1,2,3".split(",")[0] # [missing-maxsplit-arg]
15 | "1,2,3".split(",")[-1] # [missing-maxsplit-arg]
16 | "1,2,3".rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^
17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
13 13 | ## Test split called directly on string literal
@@ -63,16 +66,17 @@ missing_maxsplit_arg.py:16:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
18 18 |
19 19 | ## Test split called on string variable
-missing_maxsplit_arg.py:17:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:17:1
|
15 | "1,2,3".split(",")[-1] # [missing-maxsplit-arg]
16 | "1,2,3".rsplit(",")[0] # [missing-maxsplit-arg]
17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^
18 |
19 | ## Test split called on string variable
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
14 14 | "1,2,3".split(",")[0] # [missing-maxsplit-arg]
@@ -84,15 +88,16 @@ missing_maxsplit_arg.py:17:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
19 19 | ## Test split called on string variable
20 20 | SEQ.split(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:20:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:20:1
|
19 | ## Test split called on string variable
20 | SEQ.split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^
21 | SEQ.split(",")[-1] # [missing-maxsplit-arg]
22 | SEQ.rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
17 17 | "1,2,3".rsplit(",")[-1] # [missing-maxsplit-arg]
@@ -104,16 +109,17 @@ missing_maxsplit_arg.py:20:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
22 22 | SEQ.rsplit(",")[0] # [missing-maxsplit-arg]
23 23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:21:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:21:1
|
19 | ## Test split called on string variable
20 | SEQ.split(",")[0] # [missing-maxsplit-arg]
21 | SEQ.split(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^
22 | SEQ.rsplit(",")[0] # [missing-maxsplit-arg]
23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
18 18 |
@@ -125,15 +131,16 @@ missing_maxsplit_arg.py:21:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
23 23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
24 24 |
-missing_maxsplit_arg.py:22:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:22:1
|
20 | SEQ.split(",")[0] # [missing-maxsplit-arg]
21 | SEQ.split(",")[-1] # [missing-maxsplit-arg]
22 | SEQ.rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^
23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
19 19 | ## Test split called on string variable
@@ -145,16 +152,17 @@ missing_maxsplit_arg.py:22:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
24 24 |
25 25 | ## Test split called on class attribute
-missing_maxsplit_arg.py:23:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:23:1
|
21 | SEQ.split(",")[-1] # [missing-maxsplit-arg]
22 | SEQ.rsplit(",")[0] # [missing-maxsplit-arg]
23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^
24 |
25 | ## Test split called on class attribute
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
20 20 | SEQ.split(",")[0] # [missing-maxsplit-arg]
@@ -166,15 +174,16 @@ missing_maxsplit_arg.py:23:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
25 25 | ## Test split called on class attribute
26 26 | Foo.class_str.split(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:26:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:26:1
|
25 | ## Test split called on class attribute
26 | Foo.class_str.split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 | Foo.class_str.split(",")[-1] # [missing-maxsplit-arg]
28 | Foo.class_str.rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
23 23 | SEQ.rsplit(",")[-1] # [missing-maxsplit-arg]
@@ -186,16 +195,17 @@ missing_maxsplit_arg.py:26:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
28 28 | Foo.class_str.rsplit(",")[0] # [missing-maxsplit-arg]
29 29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:27:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:27:1
|
25 | ## Test split called on class attribute
26 | Foo.class_str.split(",")[0] # [missing-maxsplit-arg]
27 | Foo.class_str.split(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 | Foo.class_str.rsplit(",")[0] # [missing-maxsplit-arg]
29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
24 24 |
@@ -207,15 +217,16 @@ missing_maxsplit_arg.py:27:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
29 29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
30 30 |
-missing_maxsplit_arg.py:28:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:28:1
|
26 | Foo.class_str.split(",")[0] # [missing-maxsplit-arg]
27 | Foo.class_str.split(",")[-1] # [missing-maxsplit-arg]
28 | Foo.class_str.rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
25 25 | ## Test split called on class attribute
@@ -227,16 +238,17 @@ missing_maxsplit_arg.py:28:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
30 30 |
31 31 | ## Test split called on sliced string
-missing_maxsplit_arg.py:29:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:29:1
|
27 | Foo.class_str.split(",")[-1] # [missing-maxsplit-arg]
28 | Foo.class_str.rsplit(",")[0] # [missing-maxsplit-arg]
29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 |
31 | ## Test split called on sliced string
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
26 26 | Foo.class_str.split(",")[0] # [missing-maxsplit-arg]
@@ -248,15 +260,16 @@ missing_maxsplit_arg.py:29:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
31 31 | ## Test split called on sliced string
32 32 | "1,2,3"[::-1].split(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:32:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:32:1
|
31 | ## Test split called on sliced string
32 | "1,2,3"[::-1].split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 | "1,2,3"[::-1][::-1].split(",")[0] # [missing-maxsplit-arg]
34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
29 29 | Foo.class_str.rsplit(",")[-1] # [missing-maxsplit-arg]
@@ -268,16 +281,17 @@ missing_maxsplit_arg.py:32:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
34 34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
35 35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:33:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:33:1
|
31 | ## Test split called on sliced string
32 | "1,2,3"[::-1].split(",")[0] # [missing-maxsplit-arg]
33 | "1,2,3"[::-1][::-1].split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
30 30 |
@@ -289,16 +303,17 @@ missing_maxsplit_arg.py:33:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
35 35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
36 36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:34:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:34:1
|
32 | "1,2,3"[::-1].split(",")[0] # [missing-maxsplit-arg]
33 | "1,2,3"[::-1][::-1].split(",")[0] # [missing-maxsplit-arg]
34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^
35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
31 31 | ## Test split called on sliced string
@@ -310,16 +325,17 @@ missing_maxsplit_arg.py:34:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
36 36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
37 37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:35:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:35:1
|
33 | "1,2,3"[::-1][::-1].split(",")[0] # [missing-maxsplit-arg]
34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
32 32 | "1,2,3"[::-1].split(",")[0] # [missing-maxsplit-arg]
@@ -331,16 +347,17 @@ missing_maxsplit_arg.py:35:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
37 37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
38 38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:36:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:36:1
|
34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
33 33 | "1,2,3"[::-1][::-1].split(",")[0] # [missing-maxsplit-arg]
@@ -352,15 +369,16 @@ missing_maxsplit_arg.py:36:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
38 38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
39 39 |
-missing_maxsplit_arg.py:37:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:37:1
|
35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^
38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
34 34 | SEQ[:3].split(",")[0] # [missing-maxsplit-arg]
@@ -372,16 +390,17 @@ missing_maxsplit_arg.py:37:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
39 39 |
40 40 | ## Test sep given as named argument
-missing_maxsplit_arg.py:38:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:38:1
|
36 | "1,2,3"[::-1].rsplit(",")[0] # [missing-maxsplit-arg]
37 | SEQ[:3].rsplit(",")[0] # [missing-maxsplit-arg]
38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 |
40 | ## Test sep given as named argument
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
35 35 | Foo.class_str[1:3].split(",")[-1] # [missing-maxsplit-arg]
@@ -393,15 +412,16 @@ missing_maxsplit_arg.py:38:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
40 40 | ## Test sep given as named argument
41 41 | "1,2,3".split(sep=",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:41:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:41:1
|
40 | ## Test sep given as named argument
41 | "1,2,3".split(sep=",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
42 | "1,2,3".split(sep=",")[-1] # [missing-maxsplit-arg]
43 | "1,2,3".rsplit(sep=",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
38 38 | Foo.class_str[1:3].rsplit(",")[-1] # [missing-maxsplit-arg]
@@ -413,16 +433,17 @@ missing_maxsplit_arg.py:41:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
43 43 | "1,2,3".rsplit(sep=",")[0] # [missing-maxsplit-arg]
44 44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:42:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:42:1
|
40 | ## Test sep given as named argument
41 | "1,2,3".split(sep=",")[0] # [missing-maxsplit-arg]
42 | "1,2,3".split(sep=",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
43 | "1,2,3".rsplit(sep=",")[0] # [missing-maxsplit-arg]
44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
39 39 |
@@ -434,15 +455,16 @@ missing_maxsplit_arg.py:42:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
44 44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
45 45 |
-missing_maxsplit_arg.py:43:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:43:1
|
41 | "1,2,3".split(sep=",")[0] # [missing-maxsplit-arg]
42 | "1,2,3".split(sep=",")[-1] # [missing-maxsplit-arg]
43 | "1,2,3".rsplit(sep=",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
40 40 | ## Test sep given as named argument
@@ -454,16 +476,17 @@ missing_maxsplit_arg.py:43:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
45 45 |
46 46 | ## Special cases
-missing_maxsplit_arg.py:44:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:44:1
|
42 | "1,2,3".split(sep=",")[-1] # [missing-maxsplit-arg]
43 | "1,2,3".rsplit(sep=",")[0] # [missing-maxsplit-arg]
44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 |
46 | ## Special cases
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
41 41 | "1,2,3".split(sep=",")[0] # [missing-maxsplit-arg]
@@ -475,15 +498,16 @@ missing_maxsplit_arg.py:44:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
46 46 | ## Special cases
47 47 | "1,2,3".split("\n")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:47:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:47:1
|
46 | ## Special cases
47 | "1,2,3".split("\n")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^
48 | "1,2,3".split("split")[-1] # [missing-maxsplit-arg]
49 | "1,2,3".rsplit("rsplit")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
44 44 | "1,2,3".rsplit(sep=",")[-1] # [missing-maxsplit-arg]
@@ -495,15 +519,16 @@ missing_maxsplit_arg.py:47:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
49 49 | "1,2,3".rsplit("rsplit")[0] # [missing-maxsplit-arg]
50 50 |
-missing_maxsplit_arg.py:48:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:48:1
|
46 | ## Special cases
47 | "1,2,3".split("\n")[0] # [missing-maxsplit-arg]
48 | "1,2,3".split("split")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
49 | "1,2,3".rsplit("rsplit")[0] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
45 45 |
@@ -515,16 +540,17 @@ missing_maxsplit_arg.py:48:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
50 50 |
51 51 | ## Test class attribute named split
-missing_maxsplit_arg.py:49:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:49:1
|
47 | "1,2,3".split("\n")[0] # [missing-maxsplit-arg]
48 | "1,2,3".split("split")[-1] # [missing-maxsplit-arg]
49 | "1,2,3".rsplit("rsplit")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 |
51 | ## Test class attribute named split
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
46 46 | ## Special cases
@@ -536,15 +562,16 @@ missing_maxsplit_arg.py:49:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
51 51 | ## Test class attribute named split
52 52 | Bar.split.split(",")[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:52:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:52:1
|
51 | ## Test class attribute named split
52 | Bar.split.split(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^
53 | Bar.split.split(",")[-1] # [missing-maxsplit-arg]
54 | Bar.split.rsplit(",")[0] # [missing-maxsplit-arg]
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Safe fix
49 49 | "1,2,3".rsplit("rsplit")[0] # [missing-maxsplit-arg]
@@ -556,16 +583,17 @@ missing_maxsplit_arg.py:52:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
54 54 | Bar.split.rsplit(",")[0] # [missing-maxsplit-arg]
55 55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:53:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:53:1
|
51 | ## Test class attribute named split
52 | Bar.split.split(",")[0] # [missing-maxsplit-arg]
53 | Bar.split.split(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
54 | Bar.split.rsplit(",")[0] # [missing-maxsplit-arg]
55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.rsplit()` and pass `maxsplit=1`
+help: Use `str.rsplit()` and pass `maxsplit=1`
ℹ Safe fix
50 50 |
@@ -577,15 +605,16 @@ missing_maxsplit_arg.py:53:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
55 55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
56 56 |
-missing_maxsplit_arg.py:54:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:54:1
|
52 | Bar.split.split(",")[0] # [missing-maxsplit-arg]
53 | Bar.split.split(",")[-1] # [missing-maxsplit-arg]
54 | Bar.split.rsplit(",")[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
|
- = help: Use `str.split()` and pass `maxsplit=1`
+help: Use `str.split()` and pass `maxsplit=1`
ℹ Safe fix
51 51 | ## Test class attribute named split
@@ -597,16 +626,17 @@ missing_maxsplit_arg.py:54:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
56 56 |
57 57 | ## Test unpacked dict literal kwargs
-missing_maxsplit_arg.py:55:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:55:1
|
53 | Bar.split.split(",")[-1] # [missing-maxsplit-arg]
54 | Bar.split.rsplit(",")[0] # [missing-maxsplit-arg]
55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
56 |
57 | ## Test unpacked dict literal kwargs
|
- = help: Pass `maxsplit=1` into `str.rsplit()`
+help: Pass `maxsplit=1` into `str.rsplit()`
ℹ Safe fix
52 52 | Bar.split.split(",")[0] # [missing-maxsplit-arg]
@@ -618,13 +648,14 @@ missing_maxsplit_arg.py:55:1: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`
57 57 | ## Test unpacked dict literal kwargs
58 58 | "1,2,3".split(**{"sep": ","})[0] # [missing-maxsplit-arg]
-missing_maxsplit_arg.py:58:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:58:1
|
57 | ## Test unpacked dict literal kwargs
58 | "1,2,3".split(**{"sep": ","})[0] # [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
55 55 | Bar.split.rsplit(",")[-1] # [missing-maxsplit-arg]
@@ -636,16 +667,17 @@ missing_maxsplit_arg.py:58:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
60 60 |
61 61 | # OK
-missing_maxsplit_arg.py:179:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:179:1
|
177 | # Errors
178 | kwargs_without_maxsplit = {"seq": ","}
179 | "1,2,3".split(**kwargs_without_maxsplit)[0] # TODO: [missing-maxsplit-arg]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180 | # OK
181 | kwargs_with_maxsplit = {"maxsplit": 1}
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
176 176 | ## TODO: These require the ability to resolve a dict variable name to a value
@@ -657,16 +689,17 @@ missing_maxsplit_arg.py:179:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`
181 181 | kwargs_with_maxsplit = {"maxsplit": 1}
182 182 | "1,2,3".split(",", **kwargs_with_maxsplit)[0] # TODO: false positive
-missing_maxsplit_arg.py:182:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:182:1
|
180 | # OK
181 | kwargs_with_maxsplit = {"maxsplit": 1}
182 | "1,2,3".split(",", **kwargs_with_maxsplit)[0] # TODO: false positive
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 | kwargs_with_maxsplit = {"sep": ",", "maxsplit": 1}
184 | "1,2,3".split(**kwargs_with_maxsplit)[0] # TODO: false positive
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
179 179 | "1,2,3".split(**kwargs_without_maxsplit)[0] # TODO: [missing-maxsplit-arg]
@@ -678,14 +711,15 @@ missing_maxsplit_arg.py:182:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`
184 184 | "1,2,3".split(**kwargs_with_maxsplit)[0] # TODO: false positive
185 185 |
-missing_maxsplit_arg.py:184:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:184:1
|
182 | "1,2,3".split(",", **kwargs_with_maxsplit)[0] # TODO: false positive
183 | kwargs_with_maxsplit = {"sep": ",", "maxsplit": 1}
184 | "1,2,3".split(**kwargs_with_maxsplit)[0] # TODO: false positive
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
181 181 | kwargs_with_maxsplit = {"maxsplit": 1}
@@ -697,16 +731,17 @@ missing_maxsplit_arg.py:184:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`
186 186 |
187 187 | ## Test unpacked list literal args (starred expressions)
-missing_maxsplit_arg.py:189:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:189:1
|
187 | ## Test unpacked list literal args (starred expressions)
188 | # Errors
189 | "1,2,3".split(",", *[-1])[0]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
190 |
191 | ## Test unpacked list variable args
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
186 186 |
@@ -718,14 +753,15 @@ missing_maxsplit_arg.py:189:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`
191 191 | ## Test unpacked list variable args
192 192 | # Errors
-missing_maxsplit_arg.py:194:1: PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+PLC0207 [*] Replace with `split(..., maxsplit=1)`.
+ --> missing_maxsplit_arg.py:194:1
|
192 | # Errors
193 | args_list = [-1]
194 | "1,2,3".split(",", *args_list)[0]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Pass `maxsplit=1` into `str.split()`
+help: Pass `maxsplit=1` into `str.split()`
ℹ Unsafe fix
191 191 | ## Test unpacked list variable args
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0208_iteration_over_set.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0208_iteration_over_set.py.snap
index 952670e665..a8aa72f1c5 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0208_iteration_over_set.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0208_iteration_over_set.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-iteration_over_set.py:3:13: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:3:13
|
1 | # Errors
2 |
3 | for item in {1}:
- | ^^^ PLC0208
+ | ^^^
4 | print(f"I can count to {item}!")
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
1 1 | # Errors
@@ -20,15 +21,16 @@ iteration_over_set.py:3:13: PLC0208 [*] Use a sequence type instead of a `set` w
5 5 |
6 6 | for item in {"apples", "lemons", "water"}: # flags in-line set literals
-iteration_over_set.py:6:13: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:6:13
|
4 | print(f"I can count to {item}!")
5 |
6 | for item in {"apples", "lemons", "water"}: # flags in-line set literals
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0208
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | print(f"I like {item}.")
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
3 3 | for item in {1}:
@@ -40,15 +42,16 @@ iteration_over_set.py:6:13: PLC0208 [*] Use a sequence type instead of a `set` w
8 8 |
9 9 | for item in {1,}:
-iteration_over_set.py:9:13: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:9:13
|
7 | print(f"I like {item}.")
8 |
9 | for item in {1,}:
- | ^^^^ PLC0208
+ | ^^^^
10 | print(f"I can count to {item}!")
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
6 6 | for item in {"apples", "lemons", "water"}: # flags in-line set literals
@@ -60,7 +63,8 @@ iteration_over_set.py:9:13: PLC0208 [*] Use a sequence type instead of a `set` w
11 11 |
12 12 | for item in {
-iteration_over_set.py:12:13: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:12:13
|
10 | print(f"I can count to {item}!")
11 |
@@ -68,10 +72,10 @@ iteration_over_set.py:12:13: PLC0208 [*] Use a sequence type instead of a `set`
| _____________^
13 | | "apples", "lemons", "water"
14 | | }: # flags in-line set literals
- | |_^ PLC0208
+ | |_^
15 | print(f"I like {item}.")
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
9 9 | for item in {1,}:
@@ -86,16 +90,17 @@ iteration_over_set.py:12:13: PLC0208 [*] Use a sequence type instead of a `set`
16 16 |
17 17 | numbers_list = [i for i in {1, 2, 3}] # flags sets in list comprehensions
-iteration_over_set.py:17:28: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:17:28
|
15 | print(f"I like {item}.")
16 |
17 | numbers_list = [i for i in {1, 2, 3}] # flags sets in list comprehensions
- | ^^^^^^^^^ PLC0208
+ | ^^^^^^^^^
18 |
19 | numbers_set = {i for i in {1, 2, 3}} # flags sets in set comprehensions
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
14 14 | }: # flags in-line set literals
@@ -107,16 +112,17 @@ iteration_over_set.py:17:28: PLC0208 [*] Use a sequence type instead of a `set`
19 19 | numbers_set = {i for i in {1, 2, 3}} # flags sets in set comprehensions
20 20 |
-iteration_over_set.py:19:27: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:19:27
|
17 | numbers_list = [i for i in {1, 2, 3}] # flags sets in list comprehensions
18 |
19 | numbers_set = {i for i in {1, 2, 3}} # flags sets in set comprehensions
- | ^^^^^^^^^ PLC0208
+ | ^^^^^^^^^
20 |
21 | numbers_dict = {str(i): i for i in {1, 2, 3}} # flags sets in dict comprehensions
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
16 16 |
@@ -128,16 +134,17 @@ iteration_over_set.py:19:27: PLC0208 [*] Use a sequence type instead of a `set`
21 21 | numbers_dict = {str(i): i for i in {1, 2, 3}} # flags sets in dict comprehensions
22 22 |
-iteration_over_set.py:21:36: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:21:36
|
19 | numbers_set = {i for i in {1, 2, 3}} # flags sets in set comprehensions
20 |
21 | numbers_dict = {str(i): i for i in {1, 2, 3}} # flags sets in dict comprehensions
- | ^^^^^^^^^ PLC0208
+ | ^^^^^^^^^
22 |
23 | numbers_gen = (i for i in {1, 2, 3}) # flags sets in generator expressions
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
18 18 |
@@ -149,16 +156,17 @@ iteration_over_set.py:21:36: PLC0208 [*] Use a sequence type instead of a `set`
23 23 | numbers_gen = (i for i in {1, 2, 3}) # flags sets in generator expressions
24 24 |
-iteration_over_set.py:23:27: PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
+ --> iteration_over_set.py:23:27
|
21 | numbers_dict = {str(i): i for i in {1, 2, 3}} # flags sets in dict comprehensions
22 |
23 | numbers_gen = (i for i in {1, 2, 3}) # flags sets in generator expressions
- | ^^^^^^^^^ PLC0208
+ | ^^^^^^^^^
24 |
25 | # Non-errors
|
- = help: Convert to `tuple`
+help: Convert to `tuple`
ℹ Safe fix
20 20 |
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap
index 483c266aa6..df64c6bbfb 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap
@@ -1,16 +1,17 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:6:8
|
4 | # 2. consider-using-from-import
5 |
6 | import collections as collections # [useless-import-alias]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | from collections import OrderedDict as OrderedDict # [useless-import-alias]
8 | from collections import OrderedDict as o_dict
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
3 3 | # 1. useless-import-alias
@@ -22,15 +23,16 @@ import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original packag
8 8 | from collections import OrderedDict as o_dict
9 9 | import os.path as path # [consider-using-from-import]
-import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:7:25
|
6 | import collections as collections # [useless-import-alias]
7 | from collections import OrderedDict as OrderedDict # [useless-import-alias]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | from collections import OrderedDict as o_dict
9 | import os.path as path # [consider-using-from-import]
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
4 4 | # 2. consider-using-from-import
@@ -42,16 +44,17 @@ import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original packa
9 9 | import os.path as path # [consider-using-from-import]
10 10 | import os.path as p
-import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:16:15
|
14 | import os as OS
15 | from sys import version
16 | from . import bar as bar # [useless-import-alias]
- | ^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^
17 | from . import bar as Bar
18 | from . import bar
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
13 13 | import os
@@ -63,16 +66,17 @@ import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original pack
18 18 | from . import bar
19 19 | from ..foo import bar as bar # [useless-import-alias]
-import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:19:19
|
17 | from . import bar as Bar
18 | from . import bar
19 | from ..foo import bar as bar # [useless-import-alias]
- | ^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^
20 | from ..foo.bar import foobar as foobar # [useless-import-alias]
21 | from ..foo.bar import foobar as anotherfoobar
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
16 16 | from . import bar as bar # [useless-import-alias]
@@ -84,16 +88,17 @@ import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original pack
21 21 | from ..foo.bar import foobar as anotherfoobar
22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
-import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:20:23
|
18 | from . import bar
19 | from ..foo import bar as bar # [useless-import-alias]
20 | from ..foo.bar import foobar as foobar # [useless-import-alias]
- | ^^^^^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^^^^^
21 | from ..foo.bar import foobar as anotherfoobar
22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
17 17 | from . import bar as Bar
@@ -105,16 +110,17 @@ import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original pack
22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
23 23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias]
-import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:22:15
|
20 | from ..foo.bar import foobar as foobar # [useless-import-alias]
21 | from ..foo.bar import foobar as anotherfoobar
22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
- | ^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^
23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias]
24 | from . import foo as bar, foo2 as bar2
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
19 19 | from ..foo import bar as bar # [useless-import-alias]
@@ -126,16 +132,17 @@ import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original pack
24 24 | from . import foo as bar, foo2 as bar2
25 25 | from foo.bar import foobar as foobar # [useless-import-alias]
-import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:23:27
|
21 | from ..foo.bar import foobar as anotherfoobar
22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias]
- | ^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^
24 | from . import foo as bar, foo2 as bar2
25 | from foo.bar import foobar as foobar # [useless-import-alias]
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
20 20 | from ..foo.bar import foobar as foobar # [useless-import-alias]
@@ -147,16 +154,17 @@ import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original pack
25 25 | from foo.bar import foobar as foobar # [useless-import-alias]
26 26 | from foo.bar import foobar as foo
-import_aliasing.py:25:21: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> import_aliasing.py:25:21
|
23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias]
24 | from . import foo as bar, foo2 as bar2
25 | from foo.bar import foobar as foobar # [useless-import-alias]
- | ^^^^^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^^^^^
26 | from foo.bar import foobar as foo
27 | from .foo.bar import f as foobar
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias]
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing_2____init__.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing_2____init__.py.snap
index 101902f311..5ab1f223aa 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing_2____init__.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing_2____init__.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-__init__.py:1:8: PLC0414 [*] Import alias does not rename original package
+PLC0414 [*] Import alias does not rename original package
+ --> __init__.py:1:8
|
1 | import collections as collections
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0414
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | from collections import OrderedDict as OrderedDict
3 | from . import foo as foo
|
- = help: Remove import alias
+help: Remove import alias
ℹ Unsafe fix
1 |-import collections as collections
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap
index 36490ce904..7c8239ba65 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap
@@ -1,74 +1,82 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-import_outside_top_level.py:10:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:10:5
|
9 | def import_in_function():
10 | import symtable # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^
11 | import os, sys # [import-outside-toplevel]
12 | import time as thyme # [import-outside-toplevel]
|
-import_outside_top_level.py:11:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:11:5
|
9 | def import_in_function():
10 | import symtable # [import-outside-toplevel]
11 | import os, sys # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^
12 | import time as thyme # [import-outside-toplevel]
13 | import random as rand, socket as sock # [import-outside-toplevel]
|
-import_outside_top_level.py:12:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:12:5
|
10 | import symtable # [import-outside-toplevel]
11 | import os, sys # [import-outside-toplevel]
12 | import time as thyme # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^^^^^^
13 | import random as rand, socket as sock # [import-outside-toplevel]
14 | from collections import defaultdict # [import-outside-toplevel]
|
-import_outside_top_level.py:13:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:13:5
|
11 | import os, sys # [import-outside-toplevel]
12 | import time as thyme # [import-outside-toplevel]
13 | import random as rand, socket as sock # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 | from collections import defaultdict # [import-outside-toplevel]
15 | from math import sin as sign, cos as cosplay # [import-outside-toplevel]
|
-import_outside_top_level.py:14:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:14:5
|
12 | import time as thyme # [import-outside-toplevel]
13 | import random as rand, socket as sock # [import-outside-toplevel]
14 | from collections import defaultdict # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | from math import sin as sign, cos as cosplay # [import-outside-toplevel]
|
-import_outside_top_level.py:15:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:15:5
|
13 | import random as rand, socket as sock # [import-outside-toplevel]
14 | from collections import defaultdict # [import-outside-toplevel]
15 | from math import sin as sign, cos as cosplay # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-import_outside_top_level.py:19:5: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:19:5
|
18 | class ClassWithImports:
19 | import tokenize # [import-outside-toplevel]
- | ^^^^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^^^^
20 |
21 | def __init__(self):
|
-import_outside_top_level.py:22:9: PLC0415 `import` should be at the top-level of a file
+PLC0415 `import` should be at the top-level of a file
+ --> import_outside_top_level.py:22:9
|
21 | def __init__(self):
22 | import trace # [import-outside-toplevel]
- | ^^^^^^^^^^^^ PLC0415
+ | ^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap
index 93d27a1605..ad3929bb35 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap
@@ -1,13 +1,14 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-len_as_condition.py:1:4: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:1:4
|
1 | if len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
2 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
1 |-if len('TEST'): # [PLC1802]
@@ -16,15 +17,16 @@ len_as_condition.py:1:4: PLC1802 [*] `len('TEST')` used as condition without com
3 3 |
4 4 | if not len('TEST'): # [PLC1802]
-len_as_condition.py:4:8: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:4:8
|
2 | pass
3 |
4 | if not len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
5 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
1 1 | if len('TEST'): # [PLC1802]
@@ -36,14 +38,15 @@ len_as_condition.py:4:8: PLC1802 [*] `len('TEST')` used as condition without com
6 6 |
7 7 | z = []
-len_as_condition.py:8:10: PLC1802 [*] `len(['T', 'E', 'S', 'T'])` used as condition without comparison
+PLC1802 [*] `len(['T', 'E', 'S', 'T'])` used as condition without comparison
+ --> len_as_condition.py:8:10
|
7 | z = []
8 | if z and len(['T', 'E', 'S', 'T']): # [PLC1802]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
9 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
5 5 | pass
@@ -55,15 +58,16 @@ len_as_condition.py:8:10: PLC1802 [*] `len(['T', 'E', 'S', 'T'])` used as condit
10 10 |
11 11 | if True or len('TEST'): # [PLC1802]
-len_as_condition.py:11:12: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:11:12
|
9 | pass
10 |
11 | if True or len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
12 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
8 8 | if z and len(['T', 'E', 'S', 'T']): # [PLC1802]
@@ -75,15 +79,16 @@ len_as_condition.py:11:12: PLC1802 [*] `len('TEST')` used as condition without c
13 13 |
14 14 | if len('TEST') == 0: # Should be fine
-len_as_condition.py:53:6: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:53:6
|
51 | if z:
52 | pass
53 | elif len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
54 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
50 50 |
@@ -95,15 +100,16 @@ len_as_condition.py:53:6: PLC1802 [*] `len('TEST')` used as condition without co
55 55 |
56 56 | if z:
-len_as_condition.py:58:10: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:58:10
|
56 | if z:
57 | pass
58 | elif not len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
59 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
55 55 |
@@ -115,15 +121,16 @@ len_as_condition.py:58:10: PLC1802 [*] `len('TEST')` used as condition without c
60 60 |
61 61 | while len('TEST'): # [PLC1802]
-len_as_condition.py:61:7: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:61:7
|
59 | pass
60 |
61 | while len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
62 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
58 58 | elif not len('TEST'): # [PLC1802]
@@ -135,15 +142,16 @@ len_as_condition.py:61:7: PLC1802 [*] `len('TEST')` used as condition without co
63 63 |
64 64 | while not len('TEST'): # [PLC1802]
-len_as_condition.py:64:11: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:64:11
|
62 | pass
63 |
64 | while not len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
65 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
61 61 | while len('TEST'): # [PLC1802]
@@ -155,15 +163,16 @@ len_as_condition.py:64:11: PLC1802 [*] `len('TEST')` used as condition without c
66 66 |
67 67 | while z and len('TEST'): # [PLC1802]
-len_as_condition.py:67:13: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:67:13
|
65 | pass
66 |
67 | while z and len('TEST'): # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
68 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
64 64 | while not len('TEST'): # [PLC1802]
@@ -175,15 +184,16 @@ len_as_condition.py:67:13: PLC1802 [*] `len('TEST')` used as condition without c
69 69 |
70 70 | while not len('TEST') and z: # [PLC1802]
-len_as_condition.py:70:11: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:70:11
|
68 | pass
69 |
70 | while not len('TEST') and z: # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
71 | pass
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
67 67 | while z and len('TEST'): # [PLC1802]
@@ -195,15 +205,16 @@ len_as_condition.py:70:11: PLC1802 [*] `len('TEST')` used as condition without c
72 72 |
73 73 | assert len('TEST') > 0 # Should be fine
-len_as_condition.py:93:12: PLC1802 [*] `len(args)` used as condition without comparison
+PLC1802 [*] `len(args)` used as condition without comparison
+ --> len_as_condition.py:93:12
|
92 | def github_issue_1331_v2(*args):
93 | assert len(args), args # [PLC1802]
- | ^^^^^^^^^ PLC1802
+ | ^^^^^^^^^
94 |
95 | def github_issue_1331_v3(*args):
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
90 90 | assert False, len(args) # Should be fine
@@ -215,15 +226,16 @@ len_as_condition.py:93:12: PLC1802 [*] `len(args)` used as condition without com
95 95 | def github_issue_1331_v3(*args):
96 96 | assert len(args) or z, args # [PLC1802]
-len_as_condition.py:96:12: PLC1802 [*] `len(args)` used as condition without comparison
+PLC1802 [*] `len(args)` used as condition without comparison
+ --> len_as_condition.py:96:12
|
95 | def github_issue_1331_v3(*args):
96 | assert len(args) or z, args # [PLC1802]
- | ^^^^^^^^^ PLC1802
+ | ^^^^^^^^^
97 |
98 | def github_issue_1331_v4(*args):
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
93 93 | assert len(args), args # [PLC1802]
@@ -235,15 +247,16 @@ len_as_condition.py:96:12: PLC1802 [*] `len(args)` used as condition without com
98 98 | def github_issue_1331_v4(*args):
99 99 | assert z and len(args), args # [PLC1802]
-len_as_condition.py:99:18: PLC1802 [*] `len(args)` used as condition without comparison
+PLC1802 [*] `len(args)` used as condition without comparison
+ --> len_as_condition.py:99:18
|
98 | def github_issue_1331_v4(*args):
99 | assert z and len(args), args # [PLC1802]
- | ^^^^^^^^^ PLC1802
+ | ^^^^^^^^^
100 |
101 | def github_issue_1331_v5(**args):
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
96 96 | assert len(args) or z, args # [PLC1802]
@@ -255,15 +268,16 @@ len_as_condition.py:99:18: PLC1802 [*] `len(args)` used as condition without com
101 101 | def github_issue_1331_v5(**args):
102 102 | assert z and len(args), args # [PLC1802]
-len_as_condition.py:102:18: PLC1802 [*] `len(args)` used as condition without comparison
+PLC1802 [*] `len(args)` used as condition without comparison
+ --> len_as_condition.py:102:18
|
101 | def github_issue_1331_v5(**args):
102 | assert z and len(args), args # [PLC1802]
- | ^^^^^^^^^ PLC1802
+ | ^^^^^^^^^
103 |
104 | b = bool(len(z)) # [PLC1802]
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
99 99 | assert z and len(args), args # [PLC1802]
@@ -275,15 +289,16 @@ len_as_condition.py:102:18: PLC1802 [*] `len(args)` used as condition without co
104 104 | b = bool(len(z)) # [PLC1802]
105 105 | c = bool(len('TEST') or 42) # [PLC1802]
-len_as_condition.py:104:10: PLC1802 [*] `len(z)` used as condition without comparison
+PLC1802 [*] `len(z)` used as condition without comparison
+ --> len_as_condition.py:104:10
|
102 | assert z and len(args), args # [PLC1802]
103 |
104 | b = bool(len(z)) # [PLC1802]
- | ^^^^^^ PLC1802
+ | ^^^^^^
105 | c = bool(len('TEST') or 42) # [PLC1802]
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
101 101 | def github_issue_1331_v5(**args):
@@ -295,15 +310,16 @@ len_as_condition.py:104:10: PLC1802 [*] `len(z)` used as condition without compa
106 106 |
107 107 | def github_issue_1879():
-len_as_condition.py:105:10: PLC1802 [*] `len('TEST')` used as condition without comparison
+PLC1802 [*] `len('TEST')` used as condition without comparison
+ --> len_as_condition.py:105:10
|
104 | b = bool(len(z)) # [PLC1802]
105 | c = bool(len('TEST') or 42) # [PLC1802]
- | ^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^
106 |
107 | def github_issue_1879():
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
102 102 | assert z and len(args), args # [PLC1802]
@@ -315,16 +331,17 @@ len_as_condition.py:105:10: PLC1802 [*] `len('TEST')` used as condition without
107 107 | def github_issue_1879():
108 108 |
-len_as_condition.py:126:12: PLC1802 [*] `len(range(0))` used as condition without comparison
+PLC1802 [*] `len(range(0))` used as condition without comparison
+ --> len_as_condition.py:126:12
|
124 | assert len(ClassWithoutBool()) # unintuitive?, in pylint: [PLC1802]
125 | assert len(ChildClassWithoutBool()) # unintuitive?, in pylint: [PLC1802]
126 | assert len(range(0)) # [PLC1802]
- | ^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^
127 | assert len([t + 1 for t in []]) # [PLC1802]
128 | # assert len(u + 1 for u in []) generator has no len
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
123 123 | assert len(ChildClassWithBool())
@@ -336,16 +353,17 @@ len_as_condition.py:126:12: PLC1802 [*] `len(range(0))` used as condition withou
128 128 | # assert len(u + 1 for u in []) generator has no len
129 129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802]
-len_as_condition.py:127:12: PLC1802 [*] `len([t + 1 for t in []])` used as condition without comparison
+PLC1802 [*] `len([t + 1 for t in []])` used as condition without comparison
+ --> len_as_condition.py:127:12
|
125 | assert len(ChildClassWithoutBool()) # unintuitive?, in pylint: [PLC1802]
126 | assert len(range(0)) # [PLC1802]
127 | assert len([t + 1 for t in []]) # [PLC1802]
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
128 | # assert len(u + 1 for u in []) generator has no len
129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802]
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
124 124 | assert len(ClassWithoutBool()) # unintuitive?, in pylint: [PLC1802]
@@ -357,15 +375,16 @@ len_as_condition.py:127:12: PLC1802 [*] `len([t + 1 for t in []])` used as condi
129 129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802]
130 130 | assert len(set((w + 1) for w in set())) # [PLC1802]
-len_as_condition.py:129:12: PLC1802 [*] `len({"1":(v + 1) for v in {}})` used as condition without comparison
+PLC1802 [*] `len({"1":(v + 1) for v in {}})` used as condition without comparison
+ --> len_as_condition.py:129:12
|
127 | assert len([t + 1 for t in []]) # [PLC1802]
128 | # assert len(u + 1 for u in []) generator has no len
129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130 | assert len(set((w + 1) for w in set())) # [PLC1802]
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
126 126 | assert len(range(0)) # [PLC1802]
@@ -377,14 +396,15 @@ len_as_condition.py:129:12: PLC1802 [*] `len({"1":(v + 1) for v in {}})` used as
131 131 |
132 132 |
-len_as_condition.py:130:12: PLC1802 [*] `len(set((w + 1) for w in set()))` used as condition without comparison
+PLC1802 [*] `len(set((w + 1) for w in set()))` used as condition without comparison
+ --> len_as_condition.py:130:12
|
128 | # assert len(u + 1 for u in []) generator has no len
129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802]
130 | assert len(set((w + 1) for w in set())) # [PLC1802]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
127 127 | assert len([t + 1 for t in []]) # [PLC1802]
@@ -396,15 +416,16 @@ len_as_condition.py:130:12: PLC1802 [*] `len(set((w + 1) for w in set()))` used
132 132 |
133 133 | import numpy
-len_as_condition.py:193:8: PLC1802 [*] `len(x)` used as condition without comparison
+PLC1802 [*] `len(x)` used as condition without comparison
+ --> len_as_condition.py:193:8
|
191 | if cond:
192 | x = [4,5,6]
193 | if len(x): # this should be addressed
- | ^^^^^^ PLC1802
+ | ^^^^^^
194 | print(x)
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
190 190 | x = [1,2,3]
@@ -416,16 +437,17 @@ len_as_condition.py:193:8: PLC1802 [*] `len(x)` used as condition without compar
195 195 |
196 196 | def g(cond:bool):
-len_as_condition.py:200:8: PLC1802 [*] `len(x)` used as condition without comparison
+PLC1802 [*] `len(x)` used as condition without comparison
+ --> len_as_condition.py:200:8
|
198 | if cond:
199 | x = [4,5,6]
200 | if len(x): # this should be addressed
- | ^^^^^^ PLC1802
+ | ^^^^^^
201 | print(x)
202 | del x
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
197 197 | x = [1,2,3]
@@ -437,15 +459,16 @@ len_as_condition.py:200:8: PLC1802 [*] `len(x)` used as condition without compar
202 202 | del x
203 203 |
-len_as_condition.py:214:8: PLC1802 [*] `len(x)` used as condition without comparison
+PLC1802 [*] `len(x)` used as condition without comparison
+ --> len_as_condition.py:214:8
|
212 | def inner(x:int):
213 | return x+1
214 | if len(x): # [PLC1802]
- | ^^^^^^ PLC1802
+ | ^^^^^^
215 | print(x)
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
211 211 | x = [1,2,3]
@@ -457,15 +480,16 @@ len_as_condition.py:214:8: PLC1802 [*] `len(x)` used as condition without compar
216 216 |
217 217 | def redefined():
-len_as_condition.py:220:8: PLC1802 [*] `len(x)` used as condition without comparison
+PLC1802 [*] `len(x)` used as condition without comparison
+ --> len_as_condition.py:220:8
|
218 | x = 123
219 | x = [1, 2, 3]
220 | if len(x): # this should be addressed
- | ^^^^^^ PLC1802
+ | ^^^^^^
221 | print(x)
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
217 217 | def redefined():
@@ -477,15 +501,16 @@ len_as_condition.py:220:8: PLC1802 [*] `len(x)` used as condition without compar
222 222 |
223 223 | global_seq = [1, 2, 3]
-len_as_condition.py:233:8: PLC1802 [*] `len(x)` used as condition without comparison
+PLC1802 [*] `len(x)` used as condition without comparison
+ --> len_as_condition.py:233:8
|
231 | if False:
232 | x = [1, 2, 3]
233 | if len(x): # [PLC1802] should be fine
- | ^^^^^^ PLC1802
+ | ^^^^^^
234 | print(x)
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
230 230 | def j():
@@ -497,14 +522,15 @@ len_as_condition.py:233:8: PLC1802 [*] `len(x)` used as condition without compar
235 235 |
236 236 | # regression tests for https://github.com/astral-sh/ruff/issues/14690
-len_as_condition.py:237:6: PLC1802 [*] `len(ascii(1))` used as condition without comparison
+PLC1802 [*] `len(ascii(1))` used as condition without comparison
+ --> len_as_condition.py:237:6
|
236 | # regression tests for https://github.com/astral-sh/ruff/issues/14690
237 | bool(len(ascii(1)))
- | ^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^
238 | bool(len(sorted("")))
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
234 234 | print(x)
@@ -516,16 +542,17 @@ len_as_condition.py:237:6: PLC1802 [*] `len(ascii(1))` used as condition without
239 239 |
240 240 | # regression tests for https://github.com/astral-sh/ruff/issues/18811
-len_as_condition.py:238:6: PLC1802 [*] `len(sorted(""))` used as condition without comparison
+PLC1802 [*] `len(sorted(""))` used as condition without comparison
+ --> len_as_condition.py:238:6
|
236 | # regression tests for https://github.com/astral-sh/ruff/issues/14690
237 | bool(len(ascii(1)))
238 | bool(len(sorted("")))
- | ^^^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^^^
239 |
240 | # regression tests for https://github.com/astral-sh/ruff/issues/18811
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
235 235 |
@@ -537,15 +564,16 @@ len_as_condition.py:238:6: PLC1802 [*] `len(sorted(""))` used as condition witho
240 240 | # regression tests for https://github.com/astral-sh/ruff/issues/18811
241 241 | fruits = []
-len_as_condition.py:242:3: PLC1802 [*] `len(fruits)` used as condition without comparison
+PLC1802 [*] `len(fruits)` used as condition without comparison
+ --> len_as_condition.py:242:3
|
240 | # regression tests for https://github.com/astral-sh/ruff/issues/18811
241 | fruits = []
242 | if(len)(fruits):
- | ^^^^^^^^^^^^^ PLC1802
+ | ^^^^^^^^^^^^^
243 | ...
|
- = help: Remove `len`
+help: Remove `len`
ℹ Safe fix
239 239 |
@@ -557,7 +585,8 @@ len_as_condition.py:242:3: PLC1802 [*] `len(fruits)` used as condition without c
244 244 |
245 245 | # regression tests for https://github.com/astral-sh/ruff/issues/18812
-len_as_condition.py:247:4: PLC1802 [*] `len(fruits)` used as condition without comparison
+PLC1802 [*] `len(fruits)` used as condition without comparison
+ --> len_as_condition.py:247:4
|
245 | # regression tests for https://github.com/astral-sh/ruff/issues/18812
246 | fruits = []
@@ -565,10 +594,10 @@ len_as_condition.py:247:4: PLC1802 [*] `len(fruits)` used as condition without c
| ____^
248 | | fruits # comment
249 | | ):
- | |_^ PLC1802
+ | |_^
250 | ...
|
- = help: Remove `len`
+help: Remove `len`
ℹ Unsafe fix
244 244 |
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap
index fefbd85ebc..7b8ee2f564 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap
@@ -1,45 +1,50 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-compare_to_empty_string.py:7:13: PLC1901 `x is ""` can be simplified to `not x` as an empty string is falsey
+PLC1901 `x is ""` can be simplified to `not x` as an empty string is falsey
+ --> compare_to_empty_string.py:7:13
|
6 | def errors():
7 | if x is "" or x == "":
- | ^^ PLC1901
+ | ^^
8 | print("x is an empty string")
|
-compare_to_empty_string.py:7:24: PLC1901 `x == ""` can be simplified to `not x` as an empty string is falsey
+PLC1901 `x == ""` can be simplified to `not x` as an empty string is falsey
+ --> compare_to_empty_string.py:7:24
|
6 | def errors():
7 | if x is "" or x == "":
- | ^^ PLC1901
+ | ^^
8 | print("x is an empty string")
|
-compare_to_empty_string.py:10:17: PLC1901 `y is not ""` can be simplified to `y` as an empty string is falsey
+PLC1901 `y is not ""` can be simplified to `y` as an empty string is falsey
+ --> compare_to_empty_string.py:10:17
|
8 | print("x is an empty string")
9 |
10 | if y is not "" or y != "":
- | ^^ PLC1901
+ | ^^
11 | print("y is not an empty string")
|
-compare_to_empty_string.py:10:28: PLC1901 `y != ""` can be simplified to `y` as an empty string is falsey
+PLC1901 `y != ""` can be simplified to `y` as an empty string is falsey
+ --> compare_to_empty_string.py:10:28
|
8 | print("x is an empty string")
9 |
10 | if y is not "" or y != "":
- | ^^ PLC1901
+ | ^^
11 | print("y is not an empty string")
|
-compare_to_empty_string.py:13:8: PLC1901 `"" != z` can be simplified to `z` as an empty string is falsey
+PLC1901 `"" != z` can be simplified to `z` as an empty string is falsey
+ --> compare_to_empty_string.py:13:8
|
11 | print("y is not an empty string")
12 |
13 | if "" != z:
- | ^^ PLC1901
+ | ^^
14 | print("z is an empty string")
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap
index 7cae6936b6..e5e08000a6 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap
@@ -1,86 +1,95 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-non_ascii_name.py:1:1: PLC2401 Variable name `ápple_count` contains a non-ASCII character
+PLC2401 Variable name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:1:1
|
1 | ápple_count: int = 1 # C2401
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
2 | ápple_count += 2 # C2401
3 | ápple_count = 3 # C2401
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:2:1: PLC2401 Variable name `ápple_count` contains a non-ASCII character
+PLC2401 Variable name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:2:1
|
1 | ápple_count: int = 1 # C2401
2 | ápple_count += 2 # C2401
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
3 | ápple_count = 3 # C2401
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:3:1: PLC2401 Variable name `ápple_count` contains a non-ASCII character
+PLC2401 Variable name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:3:1
|
1 | ápple_count: int = 1 # C2401
2 | ápple_count += 2 # C2401
3 | ápple_count = 3 # C2401
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
4 |
5 | (ápple_count for ápple_count in y)
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:5:18: PLC2401 Variable name `ápple_count` contains a non-ASCII character
+PLC2401 Variable name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:5:18
|
3 | ápple_count = 3 # C2401
4 |
5 | (ápple_count for ápple_count in y)
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:8:10: PLC2401 Argument name `ápple_count` contains a non-ASCII character
+PLC2401 Argument name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:8:10
|
8 | def func(ápple_count):
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
9 | global ápple_count
10 | nonlocal ápple_count
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:9:12: PLC2401 Global name `ápple_count` contains a non-ASCII character
+PLC2401 Global name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:9:12
|
8 | def func(ápple_count):
9 | global ápple_count
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
10 | nonlocal ápple_count
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:13:5: PLC2401 Function name `ápple_count` contains a non-ASCII character
+PLC2401 Function name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:13:5
|
13 | def ápple_count():
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
14 | pass
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:18:10: PLC2401 Variable name `ápple_count` contains a non-ASCII character
+PLC2401 Variable name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:18:10
|
17 | match ápple_count:
18 | case ápple_count:
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
19 | pass
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
-non_ascii_name.py:21:1: PLC2401 Annotation name `ápple_count` contains a non-ASCII character
+PLC2401 Annotation name `ápple_count` contains a non-ASCII character
+ --> non_ascii_name.py:21:1
|
19 | pass
20 |
21 | ápple_count: int
- | ^^^^^^^^^^^ PLC2401
+ | ^^^^^^^^^^^
22 |
23 | try:
|
- = help: Rename the variable using ASCII characters
+help: Rename the variable using ASCII characters
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2403_non_ascii_module_import.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2403_non_ascii_module_import.py.snap
index c6f20b25ba..69ebf0df80 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2403_non_ascii_module_import.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2403_non_ascii_module_import.py.snap
@@ -1,40 +1,44 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-non_ascii_module_import.py:1:29: PLC2403 Module alias `łos` contains a non-ASCII character
+PLC2403 Module alias `łos` contains a non-ASCII character
+ --> non_ascii_module_import.py:1:29
|
1 | from os.path import join as łos # Error
- | ^^^ PLC2403
+ | ^^^
2 | from os.path import join as los # OK
|
- = help: Use an ASCII-only alias
+help: Use an ASCII-only alias
-non_ascii_module_import.py:4:24: PLC2403 Module alias `łos` contains a non-ASCII character
+PLC2403 Module alias `łos` contains a non-ASCII character
+ --> non_ascii_module_import.py:4:24
|
2 | from os.path import join as los # OK
3 |
4 | import os.path.join as łos # Error
- | ^^^ PLC2403
+ | ^^^
5 | import os.path.join as los # OK
|
- = help: Use an ASCII-only alias
+help: Use an ASCII-only alias
-non_ascii_module_import.py:7:8: PLC2403 Module name `os.path.łos` contains a non-ASCII character
+PLC2403 Module name `os.path.łos` contains a non-ASCII character
+ --> non_ascii_module_import.py:7:8
|
5 | import os.path.join as los # OK
6 |
7 | import os.path.łos # Error (recommend an ASCII alias)
- | ^^^^^^^^^^^ PLC2403
+ | ^^^^^^^^^^^
8 | import os.path.los # OK
|
- = help: Use an ASCII-only alias
+help: Use an ASCII-only alias
-non_ascii_module_import.py:10:21: PLC2403 Module name `łos` contains a non-ASCII character
+PLC2403 Module name `łos` contains a non-ASCII character
+ --> non_ascii_module_import.py:10:21
|
8 | import os.path.los # OK
9 |
10 | from os.path import łos # Error (recommend an ASCII alias)
- | ^^^ PLC2403
+ | ^^^
11 | from os.path import los # OK
|
- = help: Use an ASCII-only alias
+help: Use an ASCII-only alias
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap
index 2946c74128..4176de7454 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap
@@ -1,70 +1,77 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-__main__.py:2:16: PLC2701 Private name import `_a`
+PLC2701 Private name import `_a`
+ --> __main__.py:2:16
|
1 | # Errors.
2 | from _a import b
- | ^ PLC2701
+ | ^
3 | from c._d import e
4 | from _f.g import h
|
-__main__.py:3:18: PLC2701 Private name import `_d` from external module `c`
+PLC2701 Private name import `_d` from external module `c`
+ --> __main__.py:3:18
|
1 | # Errors.
2 | from _a import b
3 | from c._d import e
- | ^ PLC2701
+ | ^
4 | from _f.g import h
5 | from i import _j
|
-__main__.py:4:18: PLC2701 Private name import `_f`
+PLC2701 Private name import `_f`
+ --> __main__.py:4:18
|
2 | from _a import b
3 | from c._d import e
4 | from _f.g import h
- | ^ PLC2701
+ | ^
5 | from i import _j
6 | from k import _l as m
|
-__main__.py:5:15: PLC2701 Private name import `_j` from external module `i`
+PLC2701 Private name import `_j` from external module `i`
+ --> __main__.py:5:15
|
3 | from c._d import e
4 | from _f.g import h
5 | from i import _j
- | ^^ PLC2701
+ | ^^
6 | from k import _l as m
7 | import _aaa
|
-__main__.py:6:21: PLC2701 Private name import `_l` from external module `k`
+PLC2701 Private name import `_l` from external module `k`
+ --> __main__.py:6:21
|
4 | from _f.g import h
5 | from i import _j
6 | from k import _l as m
- | ^ PLC2701
+ | ^
7 | import _aaa
8 | import bbb.ccc._ddd as eee # Panicked in https://github.com/astral-sh/ruff/pull/5920
|
-__main__.py:7:8: PLC2701 Private name import `_aaa`
+PLC2701 Private name import `_aaa`
+ --> __main__.py:7:8
|
5 | from i import _j
6 | from k import _l as m
7 | import _aaa
- | ^^^^ PLC2701
+ | ^^^^
8 | import bbb.ccc._ddd as eee # Panicked in https://github.com/astral-sh/ruff/pull/5920
|
-__main__.py:8:24: PLC2701 Private name import `_ddd` from external module `bbb.ccc`
+PLC2701 Private name import `_ddd` from external module `bbb.ccc`
+ --> __main__.py:8:24
|
6 | from k import _l as m
7 | import _aaa
8 | import bbb.ccc._ddd as eee # Panicked in https://github.com/astral-sh/ruff/pull/5920
- | ^^^ PLC2701
+ | ^^^
9 |
10 | # Non-errors.
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap
index 971cc51c39..d91c5b99fc 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-unnecessary_dunder_call.py:4:7: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:4:7
|
3 | a = 2
4 | print((3.0).__add__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
5 | print((3.0).__sub__(4.0)) # PLC2801
6 | print((3.0).__mul__(4.0)) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
1 1 | from typing import Any
@@ -21,16 +22,17 @@ unnecessary_dunder_call.py:4:7: PLC2801 [*] Unnecessary dunder call to `__add__`
6 6 | print((3.0).__mul__(4.0)) # PLC2801
7 7 | print((3.0).__truediv__(4.0)) # PLC2801
-unnecessary_dunder_call.py:5:7: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:5:7
|
3 | a = 2
4 | print((3.0).__add__(4.0)) # PLC2801
5 | print((3.0).__sub__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
6 | print((3.0).__mul__(4.0)) # PLC2801
7 | print((3.0).__truediv__(4.0)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
2 2 |
@@ -42,16 +44,17 @@ unnecessary_dunder_call.py:5:7: PLC2801 [*] Unnecessary dunder call to `__sub__`
7 7 | print((3.0).__truediv__(4.0)) # PLC2801
8 8 | print((3.0).__floordiv__(4.0)) # PLC2801
-unnecessary_dunder_call.py:6:7: PLC2801 [*] Unnecessary dunder call to `__mul__`. Use `*` operator.
+PLC2801 [*] Unnecessary dunder call to `__mul__`. Use `*` operator.
+ --> unnecessary_dunder_call.py:6:7
|
4 | print((3.0).__add__(4.0)) # PLC2801
5 | print((3.0).__sub__(4.0)) # PLC2801
6 | print((3.0).__mul__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
7 | print((3.0).__truediv__(4.0)) # PLC2801
8 | print((3.0).__floordiv__(4.0)) # PLC2801
|
- = help: Use `*` operator
+help: Use `*` operator
ℹ Unsafe fix
3 3 | a = 2
@@ -63,16 +66,17 @@ unnecessary_dunder_call.py:6:7: PLC2801 [*] Unnecessary dunder call to `__mul__`
8 8 | print((3.0).__floordiv__(4.0)) # PLC2801
9 9 | print((3.0).__mod__(4.0)) # PLC2801
-unnecessary_dunder_call.py:7:7: PLC2801 [*] Unnecessary dunder call to `__truediv__`. Use `/` operator.
+PLC2801 [*] Unnecessary dunder call to `__truediv__`. Use `/` operator.
+ --> unnecessary_dunder_call.py:7:7
|
5 | print((3.0).__sub__(4.0)) # PLC2801
6 | print((3.0).__mul__(4.0)) # PLC2801
7 | print((3.0).__truediv__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^^^
8 | print((3.0).__floordiv__(4.0)) # PLC2801
9 | print((3.0).__mod__(4.0)) # PLC2801
|
- = help: Use `/` operator
+help: Use `/` operator
ℹ Unsafe fix
4 4 | print((3.0).__add__(4.0)) # PLC2801
@@ -84,16 +88,17 @@ unnecessary_dunder_call.py:7:7: PLC2801 [*] Unnecessary dunder call to `__truedi
9 9 | print((3.0).__mod__(4.0)) # PLC2801
10 10 | print((3.0).__eq__(4.0)) # PLC2801
-unnecessary_dunder_call.py:8:7: PLC2801 [*] Unnecessary dunder call to `__floordiv__`. Use `//` operator.
+PLC2801 [*] Unnecessary dunder call to `__floordiv__`. Use `//` operator.
+ --> unnecessary_dunder_call.py:8:7
|
6 | print((3.0).__mul__(4.0)) # PLC2801
7 | print((3.0).__truediv__(4.0)) # PLC2801
8 | print((3.0).__floordiv__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^^^^
9 | print((3.0).__mod__(4.0)) # PLC2801
10 | print((3.0).__eq__(4.0)) # PLC2801
|
- = help: Use `//` operator
+help: Use `//` operator
ℹ Unsafe fix
5 5 | print((3.0).__sub__(4.0)) # PLC2801
@@ -105,16 +110,17 @@ unnecessary_dunder_call.py:8:7: PLC2801 [*] Unnecessary dunder call to `__floord
10 10 | print((3.0).__eq__(4.0)) # PLC2801
11 11 | print((3.0).__ne__(4.0)) # PLC2801
-unnecessary_dunder_call.py:9:7: PLC2801 [*] Unnecessary dunder call to `__mod__`. Use `%` operator.
+PLC2801 [*] Unnecessary dunder call to `__mod__`. Use `%` operator.
+ --> unnecessary_dunder_call.py:9:7
|
7 | print((3.0).__truediv__(4.0)) # PLC2801
8 | print((3.0).__floordiv__(4.0)) # PLC2801
9 | print((3.0).__mod__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
10 | print((3.0).__eq__(4.0)) # PLC2801
11 | print((3.0).__ne__(4.0)) # PLC2801
|
- = help: Use `%` operator
+help: Use `%` operator
ℹ Unsafe fix
6 6 | print((3.0).__mul__(4.0)) # PLC2801
@@ -126,16 +132,17 @@ unnecessary_dunder_call.py:9:7: PLC2801 [*] Unnecessary dunder call to `__mod__`
11 11 | print((3.0).__ne__(4.0)) # PLC2801
12 12 | print((3.0).__lt__(4.0)) # PLC2801
-unnecessary_dunder_call.py:10:7: PLC2801 [*] Unnecessary dunder call to `__eq__`. Use `==` operator.
+PLC2801 [*] Unnecessary dunder call to `__eq__`. Use `==` operator.
+ --> unnecessary_dunder_call.py:10:7
|
8 | print((3.0).__floordiv__(4.0)) # PLC2801
9 | print((3.0).__mod__(4.0)) # PLC2801
10 | print((3.0).__eq__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
11 | print((3.0).__ne__(4.0)) # PLC2801
12 | print((3.0).__lt__(4.0)) # PLC2801
|
- = help: Use `==` operator
+help: Use `==` operator
ℹ Unsafe fix
7 7 | print((3.0).__truediv__(4.0)) # PLC2801
@@ -147,16 +154,17 @@ unnecessary_dunder_call.py:10:7: PLC2801 [*] Unnecessary dunder call to `__eq__`
12 12 | print((3.0).__lt__(4.0)) # PLC2801
13 13 | print((3.0).__le__(4.0)) # PLC2801
-unnecessary_dunder_call.py:11:7: PLC2801 [*] Unnecessary dunder call to `__ne__`. Use `!=` operator.
+PLC2801 [*] Unnecessary dunder call to `__ne__`. Use `!=` operator.
+ --> unnecessary_dunder_call.py:11:7
|
9 | print((3.0).__mod__(4.0)) # PLC2801
10 | print((3.0).__eq__(4.0)) # PLC2801
11 | print((3.0).__ne__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
12 | print((3.0).__lt__(4.0)) # PLC2801
13 | print((3.0).__le__(4.0)) # PLC2801
|
- = help: Use `!=` operator
+help: Use `!=` operator
ℹ Unsafe fix
8 8 | print((3.0).__floordiv__(4.0)) # PLC2801
@@ -168,16 +176,17 @@ unnecessary_dunder_call.py:11:7: PLC2801 [*] Unnecessary dunder call to `__ne__`
13 13 | print((3.0).__le__(4.0)) # PLC2801
14 14 | print((3.0).__gt__(4.0)) # PLC2801
-unnecessary_dunder_call.py:12:7: PLC2801 [*] Unnecessary dunder call to `__lt__`. Use `<` operator.
+PLC2801 [*] Unnecessary dunder call to `__lt__`. Use `<` operator.
+ --> unnecessary_dunder_call.py:12:7
|
10 | print((3.0).__eq__(4.0)) # PLC2801
11 | print((3.0).__ne__(4.0)) # PLC2801
12 | print((3.0).__lt__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
13 | print((3.0).__le__(4.0)) # PLC2801
14 | print((3.0).__gt__(4.0)) # PLC2801
|
- = help: Use `<` operator
+help: Use `<` operator
ℹ Unsafe fix
9 9 | print((3.0).__mod__(4.0)) # PLC2801
@@ -189,16 +198,17 @@ unnecessary_dunder_call.py:12:7: PLC2801 [*] Unnecessary dunder call to `__lt__`
14 14 | print((3.0).__gt__(4.0)) # PLC2801
15 15 | print((3.0).__ge__(4.0)) # PLC2801
-unnecessary_dunder_call.py:13:7: PLC2801 [*] Unnecessary dunder call to `__le__`. Use `<=` operator.
+PLC2801 [*] Unnecessary dunder call to `__le__`. Use `<=` operator.
+ --> unnecessary_dunder_call.py:13:7
|
11 | print((3.0).__ne__(4.0)) # PLC2801
12 | print((3.0).__lt__(4.0)) # PLC2801
13 | print((3.0).__le__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
14 | print((3.0).__gt__(4.0)) # PLC2801
15 | print((3.0).__ge__(4.0)) # PLC2801
|
- = help: Use `<=` operator
+help: Use `<=` operator
ℹ Unsafe fix
10 10 | print((3.0).__eq__(4.0)) # PLC2801
@@ -210,16 +220,17 @@ unnecessary_dunder_call.py:13:7: PLC2801 [*] Unnecessary dunder call to `__le__`
15 15 | print((3.0).__ge__(4.0)) # PLC2801
16 16 | print((3.0).__str__()) # PLC2801
-unnecessary_dunder_call.py:14:7: PLC2801 [*] Unnecessary dunder call to `__gt__`. Use `>` operator.
+PLC2801 [*] Unnecessary dunder call to `__gt__`. Use `>` operator.
+ --> unnecessary_dunder_call.py:14:7
|
12 | print((3.0).__lt__(4.0)) # PLC2801
13 | print((3.0).__le__(4.0)) # PLC2801
14 | print((3.0).__gt__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
15 | print((3.0).__ge__(4.0)) # PLC2801
16 | print((3.0).__str__()) # PLC2801
|
- = help: Use `>` operator
+help: Use `>` operator
ℹ Unsafe fix
11 11 | print((3.0).__ne__(4.0)) # PLC2801
@@ -231,16 +242,17 @@ unnecessary_dunder_call.py:14:7: PLC2801 [*] Unnecessary dunder call to `__gt__`
16 16 | print((3.0).__str__()) # PLC2801
17 17 | print((3.0).__repr__()) # PLC2801
-unnecessary_dunder_call.py:15:7: PLC2801 [*] Unnecessary dunder call to `__ge__`. Use `>=` operator.
+PLC2801 [*] Unnecessary dunder call to `__ge__`. Use `>=` operator.
+ --> unnecessary_dunder_call.py:15:7
|
13 | print((3.0).__le__(4.0)) # PLC2801
14 | print((3.0).__gt__(4.0)) # PLC2801
15 | print((3.0).__ge__(4.0)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
16 | print((3.0).__str__()) # PLC2801
17 | print((3.0).__repr__()) # PLC2801
|
- = help: Use `>=` operator
+help: Use `>=` operator
ℹ Unsafe fix
12 12 | print((3.0).__lt__(4.0)) # PLC2801
@@ -252,16 +264,17 @@ unnecessary_dunder_call.py:15:7: PLC2801 [*] Unnecessary dunder call to `__ge__`
17 17 | print((3.0).__repr__()) # PLC2801
18 18 | print([1, 2, 3].__len__()) # PLC2801
-unnecessary_dunder_call.py:16:7: PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+ --> unnecessary_dunder_call.py:16:7
|
14 | print((3.0).__gt__(4.0)) # PLC2801
15 | print((3.0).__ge__(4.0)) # PLC2801
16 | print((3.0).__str__()) # PLC2801
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
17 | print((3.0).__repr__()) # PLC2801
18 | print([1, 2, 3].__len__()) # PLC2801
|
- = help: Use `str()` builtin
+help: Use `str()` builtin
ℹ Unsafe fix
13 13 | print((3.0).__le__(4.0)) # PLC2801
@@ -273,16 +286,17 @@ unnecessary_dunder_call.py:16:7: PLC2801 [*] Unnecessary dunder call to `__str__
18 18 | print([1, 2, 3].__len__()) # PLC2801
19 19 | print((1).__neg__()) # PLC2801
-unnecessary_dunder_call.py:17:7: PLC2801 [*] Unnecessary dunder call to `__repr__`. Use `repr()` builtin.
+PLC2801 [*] Unnecessary dunder call to `__repr__`. Use `repr()` builtin.
+ --> unnecessary_dunder_call.py:17:7
|
15 | print((3.0).__ge__(4.0)) # PLC2801
16 | print((3.0).__str__()) # PLC2801
17 | print((3.0).__repr__()) # PLC2801
- | ^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^
18 | print([1, 2, 3].__len__()) # PLC2801
19 | print((1).__neg__()) # PLC2801
|
- = help: Use `repr()` builtin
+help: Use `repr()` builtin
ℹ Unsafe fix
14 14 | print((3.0).__gt__(4.0)) # PLC2801
@@ -294,16 +308,17 @@ unnecessary_dunder_call.py:17:7: PLC2801 [*] Unnecessary dunder call to `__repr_
19 19 | print((1).__neg__()) # PLC2801
20 20 | print(-a.__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:18:7: PLC2801 [*] Unnecessary dunder call to `__len__`. Use `len()` builtin.
+PLC2801 [*] Unnecessary dunder call to `__len__`. Use `len()` builtin.
+ --> unnecessary_dunder_call.py:18:7
|
16 | print((3.0).__str__()) # PLC2801
17 | print((3.0).__repr__()) # PLC2801
18 | print([1, 2, 3].__len__()) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^
19 | print((1).__neg__()) # PLC2801
20 | print(-a.__sub__(1)) # PLC2801
|
- = help: Use `len()` builtin
+help: Use `len()` builtin
ℹ Unsafe fix
15 15 | print((3.0).__ge__(4.0)) # PLC2801
@@ -315,27 +330,29 @@ unnecessary_dunder_call.py:18:7: PLC2801 [*] Unnecessary dunder call to `__len__
20 20 | print(-a.__sub__(1)) # PLC2801
21 21 | print(-(a).__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:19:7: PLC2801 Unnecessary dunder call to `__neg__`. Multiply by -1 instead.
+PLC2801 Unnecessary dunder call to `__neg__`. Multiply by -1 instead.
+ --> unnecessary_dunder_call.py:19:7
|
17 | print((3.0).__repr__()) # PLC2801
18 | print([1, 2, 3].__len__()) # PLC2801
19 | print((1).__neg__()) # PLC2801
- | ^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^
20 | print(-a.__sub__(1)) # PLC2801
21 | print(-(a).__sub__(1)) # PLC2801
|
- = help: Multiply by -1 instead
+help: Multiply by -1 instead
-unnecessary_dunder_call.py:20:8: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:20:8
|
18 | print([1, 2, 3].__len__()) # PLC2801
19 | print((1).__neg__()) # PLC2801
20 | print(-a.__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
21 | print(-(a).__sub__(1)) # PLC2801
22 | print(-(-a.__sub__(1))) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
17 17 | print((3.0).__repr__()) # PLC2801
@@ -347,16 +364,17 @@ unnecessary_dunder_call.py:20:8: PLC2801 [*] Unnecessary dunder call to `__sub__
22 22 | print(-(-a.__sub__(1))) # PLC2801
23 23 | print((5 - a).__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:21:8: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:21:8
|
19 | print((1).__neg__()) # PLC2801
20 | print(-a.__sub__(1)) # PLC2801
21 | print(-(a).__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^
22 | print(-(-a.__sub__(1))) # PLC2801
23 | print((5 - a).__sub__(1)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
18 18 | print([1, 2, 3].__len__()) # PLC2801
@@ -368,16 +386,17 @@ unnecessary_dunder_call.py:21:8: PLC2801 [*] Unnecessary dunder call to `__sub__
23 23 | print((5 - a).__sub__(1)) # PLC2801
24 24 | print(-(5 - a).__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:22:10: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:22:10
|
20 | print(-a.__sub__(1)) # PLC2801
21 | print(-(a).__sub__(1)) # PLC2801
22 | print(-(-a.__sub__(1))) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
23 | print((5 - a).__sub__(1)) # PLC2801
24 | print(-(5 - a).__sub__(1)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
19 19 | print((1).__neg__()) # PLC2801
@@ -389,16 +408,17 @@ unnecessary_dunder_call.py:22:10: PLC2801 [*] Unnecessary dunder call to `__sub_
24 24 | print(-(5 - a).__sub__(1)) # PLC2801
25 25 | print(-(-5 - a).__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:23:7: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:23:7
|
21 | print(-(a).__sub__(1)) # PLC2801
22 | print(-(-a.__sub__(1))) # PLC2801
23 | print((5 - a).__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
24 | print(-(5 - a).__sub__(1)) # PLC2801
25 | print(-(-5 - a).__sub__(1)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
20 20 | print(-a.__sub__(1)) # PLC2801
@@ -410,16 +430,17 @@ unnecessary_dunder_call.py:23:7: PLC2801 [*] Unnecessary dunder call to `__sub__
25 25 | print(-(-5 - a).__sub__(1)) # PLC2801
26 26 | print(+-+-+-a.__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:24:8: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:24:8
|
22 | print(-(-a.__sub__(1))) # PLC2801
23 | print((5 - a).__sub__(1)) # PLC2801
24 | print(-(5 - a).__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^
25 | print(-(-5 - a).__sub__(1)) # PLC2801
26 | print(+-+-+-a.__sub__(1)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
21 21 | print(-(a).__sub__(1)) # PLC2801
@@ -431,16 +452,17 @@ unnecessary_dunder_call.py:24:8: PLC2801 [*] Unnecessary dunder call to `__sub__
26 26 | print(+-+-+-a.__sub__(1)) # PLC2801
27 27 | print(a.__rsub__(2 - 1)) # PLC2801
-unnecessary_dunder_call.py:25:8: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:25:8
|
23 | print((5 - a).__sub__(1)) # PLC2801
24 | print(-(5 - a).__sub__(1)) # PLC2801
25 | print(-(-5 - a).__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^
26 | print(+-+-+-a.__sub__(1)) # PLC2801
27 | print(a.__rsub__(2 - 1)) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
22 22 | print(-(-a.__sub__(1))) # PLC2801
@@ -452,16 +474,17 @@ unnecessary_dunder_call.py:25:8: PLC2801 [*] Unnecessary dunder call to `__sub__
27 27 | print(a.__rsub__(2 - 1)) # PLC2801
28 28 | print(a.__sub__(((((1)))))) # PLC2801
-unnecessary_dunder_call.py:26:13: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:26:13
|
24 | print(-(5 - a).__sub__(1)) # PLC2801
25 | print(-(-5 - a).__sub__(1)) # PLC2801
26 | print(+-+-+-a.__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
27 | print(a.__rsub__(2 - 1)) # PLC2801
28 | print(a.__sub__(((((1)))))) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
23 23 | print((5 - a).__sub__(1)) # PLC2801
@@ -473,16 +496,17 @@ unnecessary_dunder_call.py:26:13: PLC2801 [*] Unnecessary dunder call to `__sub_
28 28 | print(a.__sub__(((((1)))))) # PLC2801
29 29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
-unnecessary_dunder_call.py:27:7: PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:27:7
|
25 | print(-(-5 - a).__sub__(1)) # PLC2801
26 | print(+-+-+-a.__sub__(1)) # PLC2801
27 | print(a.__rsub__(2 - 1)) # PLC2801
- | ^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^
28 | print(a.__sub__(((((1)))))) # PLC2801
29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
24 24 | print(-(5 - a).__sub__(1)) # PLC2801
@@ -494,16 +518,17 @@ unnecessary_dunder_call.py:27:7: PLC2801 [*] Unnecessary dunder call to `__rsub_
29 29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
30 30 | print(a.__sub__(
-unnecessary_dunder_call.py:28:7: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:28:7
|
26 | print(+-+-+-a.__sub__(1)) # PLC2801
27 | print(a.__rsub__(2 - 1)) # PLC2801
28 | print(a.__sub__(((((1)))))) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^
29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
30 | print(a.__sub__(
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
25 25 | print(-(-5 - a).__sub__(1)) # PLC2801
@@ -515,16 +540,17 @@ unnecessary_dunder_call.py:28:7: PLC2801 [*] Unnecessary dunder call to `__sub__
30 30 | print(a.__sub__(
31 31 | 3
-unnecessary_dunder_call.py:29:7: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:29:7
|
27 | print(a.__rsub__(2 - 1)) # PLC2801
28 | print(a.__sub__(((((1)))))) # PLC2801
29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
30 | print(a.__sub__(
31 | 3
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
26 26 | print(+-+-+-a.__sub__(1)) # PLC2801
@@ -536,7 +562,8 @@ unnecessary_dunder_call.py:29:7: PLC2801 [*] Unnecessary dunder call to `__sub__
31 31 | 3
32 32 | +
-unnecessary_dunder_call.py:30:7: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:30:7
|
28 | print(a.__sub__(((((1)))))) # PLC2801
29 | print(a.__sub__(((((2 - 1)))))) # PLC2801
@@ -546,11 +573,11 @@ unnecessary_dunder_call.py:30:7: PLC2801 [*] Unnecessary dunder call to `__sub__
32 | | +
33 | | 4
34 | | ))
- | |_^ PLC2801
+ | |_^
35 | print(a.__rsub__(
36 | 3
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
27 27 | print(a.__rsub__(2 - 1)) # PLC2801
@@ -567,7 +594,8 @@ unnecessary_dunder_call.py:30:7: PLC2801 [*] Unnecessary dunder call to `__sub__
36 34 | 3
37 35 | +
-unnecessary_dunder_call.py:35:7: PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:35:7
|
33 | 4
34 | ))
@@ -577,11 +605,11 @@ unnecessary_dunder_call.py:35:7: PLC2801 [*] Unnecessary dunder call to `__rsub_
37 | | +
38 | | 4
39 | | ))
- | |_^ PLC2801
+ | |_^
40 | print(2 * a.__add__(3)) # PLC2801
41 | x = 2 * a.__add__(3) # PLC2801
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
32 32 | +
@@ -598,16 +626,17 @@ unnecessary_dunder_call.py:35:7: PLC2801 [*] Unnecessary dunder call to `__rsub_
41 39 | x = 2 * a.__add__(3) # PLC2801
42 40 | x = 2 * -a.__add__(3) # PLC2801
-unnecessary_dunder_call.py:40:11: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:40:11
|
38 | 4
39 | ))
40 | print(2 * a.__add__(3)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
41 | x = 2 * a.__add__(3) # PLC2801
42 | x = 2 * -a.__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
37 37 | +
@@ -619,16 +648,17 @@ unnecessary_dunder_call.py:40:11: PLC2801 [*] Unnecessary dunder call to `__add_
42 42 | x = 2 * -a.__add__(3) # PLC2801
43 43 | x = a.__add__(3) # PLC2801
-unnecessary_dunder_call.py:41:9: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:41:9
|
39 | ))
40 | print(2 * a.__add__(3)) # PLC2801
41 | x = 2 * a.__add__(3) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
42 | x = 2 * -a.__add__(3) # PLC2801
43 | x = a.__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
38 38 | 4
@@ -640,16 +670,17 @@ unnecessary_dunder_call.py:41:9: PLC2801 [*] Unnecessary dunder call to `__add__
43 43 | x = a.__add__(3) # PLC2801
44 44 | x = -a.__add__(3) # PLC2801
-unnecessary_dunder_call.py:42:10: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:42:10
|
40 | print(2 * a.__add__(3)) # PLC2801
41 | x = 2 * a.__add__(3) # PLC2801
42 | x = 2 * -a.__add__(3) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
43 | x = a.__add__(3) # PLC2801
44 | x = -a.__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
39 39 | ))
@@ -661,16 +692,17 @@ unnecessary_dunder_call.py:42:10: PLC2801 [*] Unnecessary dunder call to `__add_
44 44 | x = -a.__add__(3) # PLC2801
45 45 | x = (-a).__add__(3) # PLC2801
-unnecessary_dunder_call.py:43:5: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:43:5
|
41 | x = 2 * a.__add__(3) # PLC2801
42 | x = 2 * -a.__add__(3) # PLC2801
43 | x = a.__add__(3) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
44 | x = -a.__add__(3) # PLC2801
45 | x = (-a).__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
40 40 | print(2 * a.__add__(3)) # PLC2801
@@ -682,16 +714,17 @@ unnecessary_dunder_call.py:43:5: PLC2801 [*] Unnecessary dunder call to `__add__
45 45 | x = (-a).__add__(3) # PLC2801
46 46 | x = -(-a).__add__(3) # PLC2801
-unnecessary_dunder_call.py:44:6: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:44:6
|
42 | x = 2 * -a.__add__(3) # PLC2801
43 | x = a.__add__(3) # PLC2801
44 | x = -a.__add__(3) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
45 | x = (-a).__add__(3) # PLC2801
46 | x = -(-a).__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
41 41 | x = 2 * a.__add__(3) # PLC2801
@@ -703,15 +736,16 @@ unnecessary_dunder_call.py:44:6: PLC2801 [*] Unnecessary dunder call to `__add__
46 46 | x = -(-a).__add__(3) # PLC2801
47 47 |
-unnecessary_dunder_call.py:45:5: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:45:5
|
43 | x = a.__add__(3) # PLC2801
44 | x = -a.__add__(3) # PLC2801
45 | x = (-a).__add__(3) # PLC2801
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
46 | x = -(-a).__add__(3) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
42 42 | x = 2 * -a.__add__(3) # PLC2801
@@ -723,16 +757,17 @@ unnecessary_dunder_call.py:45:5: PLC2801 [*] Unnecessary dunder call to `__add__
47 47 |
48 48 | # Calls
-unnecessary_dunder_call.py:46:6: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:46:6
|
44 | x = -a.__add__(3) # PLC2801
45 | x = (-a).__add__(3) # PLC2801
46 | x = -(-a).__add__(3) # PLC2801
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
47 |
48 | # Calls
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
43 43 | x = a.__add__(3) # PLC2801
@@ -744,22 +779,24 @@ unnecessary_dunder_call.py:46:6: PLC2801 [*] Unnecessary dunder call to `__add__
48 48 | # Calls
49 49 | print(a.__call__()) # PLC2801 (no fix, intentional)
-unnecessary_dunder_call.py:49:7: PLC2801 Unnecessary dunder call to `__call__`
+PLC2801 Unnecessary dunder call to `__call__`
+ --> unnecessary_dunder_call.py:49:7
|
48 | # Calls
49 | print(a.__call__()) # PLC2801 (no fix, intentional)
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
50 |
51 | class Foo:
|
-unnecessary_dunder_call.py:63:1: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:63:1
|
62 | foo = Foo(1)
63 | foo.__add__(2).get_v() # PLC2801
- | ^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
60 60 | return self.v
@@ -771,15 +808,16 @@ unnecessary_dunder_call.py:63:1: PLC2801 [*] Unnecessary dunder call to `__add__
65 65 |
66 66 | # Lambda expressions
-unnecessary_dunder_call.py:67:16: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:67:16
|
66 | # Lambda expressions
67 | blah = lambda: a.__add__(1) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
68 |
69 | # If expressions
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
64 64 |
@@ -791,15 +829,16 @@ unnecessary_dunder_call.py:67:16: PLC2801 [*] Unnecessary dunder call to `__add_
69 69 | # If expressions
70 70 | print(a.__add__(1) if a > 0 else a.__sub__(1)) # PLC2801
-unnecessary_dunder_call.py:70:7: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:70:7
|
69 | # If expressions
70 | print(a.__add__(1) if a > 0 else a.__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
71 |
72 | # Dict/Set/List/Tuple
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
67 67 | blah = lambda: a.__add__(1) # PLC2801
@@ -811,15 +850,16 @@ unnecessary_dunder_call.py:70:7: PLC2801 [*] Unnecessary dunder call to `__add__
72 72 | # Dict/Set/List/Tuple
73 73 | print({"a": a.__add__(1)}) # PLC2801
-unnecessary_dunder_call.py:70:34: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:70:34
|
69 | # If expressions
70 | print(a.__add__(1) if a > 0 else a.__sub__(1)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
71 |
72 | # Dict/Set/List/Tuple
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
67 67 | blah = lambda: a.__add__(1) # PLC2801
@@ -831,15 +871,16 @@ unnecessary_dunder_call.py:70:34: PLC2801 [*] Unnecessary dunder call to `__sub_
72 72 | # Dict/Set/List/Tuple
73 73 | print({"a": a.__add__(1)}) # PLC2801
-unnecessary_dunder_call.py:73:13: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:73:13
|
72 | # Dict/Set/List/Tuple
73 | print({"a": a.__add__(1)}) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
74 | print({a.__add__(1)}) # PLC2801
75 | print([a.__add__(1)]) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
70 70 | print(a.__add__(1) if a > 0 else a.__sub__(1)) # PLC2801
@@ -851,16 +892,17 @@ unnecessary_dunder_call.py:73:13: PLC2801 [*] Unnecessary dunder call to `__add_
75 75 | print([a.__add__(1)]) # PLC2801
76 76 | print((a.__add__(1),)) # PLC2801
-unnecessary_dunder_call.py:74:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:74:8
|
72 | # Dict/Set/List/Tuple
73 | print({"a": a.__add__(1)}) # PLC2801
74 | print({a.__add__(1)}) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
75 | print([a.__add__(1)]) # PLC2801
76 | print((a.__add__(1),)) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
71 71 |
@@ -872,15 +914,16 @@ unnecessary_dunder_call.py:74:8: PLC2801 [*] Unnecessary dunder call to `__add__
76 76 | print((a.__add__(1),)) # PLC2801
77 77 |
-unnecessary_dunder_call.py:75:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:75:8
|
73 | print({"a": a.__add__(1)}) # PLC2801
74 | print({a.__add__(1)}) # PLC2801
75 | print([a.__add__(1)]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
76 | print((a.__add__(1),)) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
72 72 | # Dict/Set/List/Tuple
@@ -892,16 +935,17 @@ unnecessary_dunder_call.py:75:8: PLC2801 [*] Unnecessary dunder call to `__add__
77 77 |
78 78 | # Comprehension variants
-unnecessary_dunder_call.py:76:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:76:8
|
74 | print({a.__add__(1)}) # PLC2801
75 | print([a.__add__(1)]) # PLC2801
76 | print((a.__add__(1),)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
77 |
78 | # Comprehension variants
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
73 73 | print({"a": a.__add__(1)}) # PLC2801
@@ -913,15 +957,16 @@ unnecessary_dunder_call.py:76:8: PLC2801 [*] Unnecessary dunder call to `__add__
78 78 | # Comprehension variants
79 79 | print({i: i.__add__(1) for i in range(5)}) # PLC2801
-unnecessary_dunder_call.py:79:11: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:79:11
|
78 | # Comprehension variants
79 | print({i: i.__add__(1) for i in range(5)}) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
80 | print({i.__add__(1) for i in range(5)}) # PLC2801
81 | print([i.__add__(1) for i in range(5)]) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
76 76 | print((a.__add__(1),)) # PLC2801
@@ -933,16 +978,17 @@ unnecessary_dunder_call.py:79:11: PLC2801 [*] Unnecessary dunder call to `__add_
81 81 | print([i.__add__(1) for i in range(5)]) # PLC2801
82 82 | print((i.__add__(1) for i in range(5))) # PLC2801
-unnecessary_dunder_call.py:80:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:80:8
|
78 | # Comprehension variants
79 | print({i: i.__add__(1) for i in range(5)}) # PLC2801
80 | print({i.__add__(1) for i in range(5)}) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
81 | print([i.__add__(1) for i in range(5)]) # PLC2801
82 | print((i.__add__(1) for i in range(5))) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
77 77 |
@@ -954,15 +1000,16 @@ unnecessary_dunder_call.py:80:8: PLC2801 [*] Unnecessary dunder call to `__add__
82 82 | print((i.__add__(1) for i in range(5))) # PLC2801
83 83 |
-unnecessary_dunder_call.py:81:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:81:8
|
79 | print({i: i.__add__(1) for i in range(5)}) # PLC2801
80 | print({i.__add__(1) for i in range(5)}) # PLC2801
81 | print([i.__add__(1) for i in range(5)]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
82 | print((i.__add__(1) for i in range(5))) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
78 78 | # Comprehension variants
@@ -974,16 +1021,17 @@ unnecessary_dunder_call.py:81:8: PLC2801 [*] Unnecessary dunder call to `__add__
83 83 |
84 84 | # Generators
-unnecessary_dunder_call.py:82:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:82:8
|
80 | print({i.__add__(1) for i in range(5)}) # PLC2801
81 | print([i.__add__(1) for i in range(5)]) # PLC2801
82 | print((i.__add__(1) for i in range(5))) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
83 |
84 | # Generators
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
79 79 | print({i: i.__add__(1) for i in range(5)}) # PLC2801
@@ -995,14 +1043,15 @@ unnecessary_dunder_call.py:82:8: PLC2801 [*] Unnecessary dunder call to `__add__
84 84 | # Generators
85 85 | gen = (i.__add__(1) for i in range(5)) # PLC2801
-unnecessary_dunder_call.py:85:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:85:8
|
84 | # Generators
85 | gen = (i.__add__(1) for i in range(5)) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
86 | print(next(gen))
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
82 82 | print((i.__add__(1) for i in range(5))) # PLC2801
@@ -1014,15 +1063,16 @@ unnecessary_dunder_call.py:85:8: PLC2801 [*] Unnecessary dunder call to `__add__
87 87 |
88 88 | # Subscripts
-unnecessary_dunder_call.py:89:13: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:89:13
|
88 | # Subscripts
89 | print({"a": a.__add__(1)}["a"]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
90 | # https://github.com/astral-sh/ruff/issues/15745
91 | print("x".__add__("y")[0]) # PLC2801
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
86 86 | print(next(gen))
@@ -1034,16 +1084,17 @@ unnecessary_dunder_call.py:89:13: PLC2801 [*] Unnecessary dunder call to `__add_
91 91 | print("x".__add__("y")[0]) # PLC2801
92 92 |
-unnecessary_dunder_call.py:91:7: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:91:7
|
89 | print({"a": a.__add__(1)}["a"]) # PLC2801
90 | # https://github.com/astral-sh/ruff/issues/15745
91 | print("x".__add__("y")[0]) # PLC2801
- | ^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^
92 |
93 | # Starred
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
88 88 | # Subscripts
@@ -1055,15 +1106,16 @@ unnecessary_dunder_call.py:91:7: PLC2801 [*] Unnecessary dunder call to `__add__
93 93 | # Starred
94 94 | print(*[a.__add__(1)]) # PLC2801
-unnecessary_dunder_call.py:94:9: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:94:9
|
93 | # Starred
94 | print(*[a.__add__(1)]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
95 |
96 | list1 = [1, 2, 3]
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
91 91 | print("x".__add__("y")[0]) # PLC2801
@@ -1075,16 +1127,17 @@ unnecessary_dunder_call.py:94:9: PLC2801 [*] Unnecessary dunder call to `__add__
96 96 | list1 = [1, 2, 3]
97 97 | list2 = [4, 5, 6]
-unnecessary_dunder_call.py:98:9: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:98:9
|
96 | list1 = [1, 2, 3]
97 | list2 = [4, 5, 6]
98 | print([*list1.__add__(list2)]) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^
99 |
100 | # Slices
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
95 95 |
@@ -1096,15 +1149,16 @@ unnecessary_dunder_call.py:98:9: PLC2801 [*] Unnecessary dunder call to `__add__
100 100 | # Slices
101 101 | print([a.__add__(1), a.__sub__(1)][0:1]) # PLC2801
-unnecessary_dunder_call.py:101:8: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:101:8
|
100 | # Slices
101 | print([a.__add__(1), a.__sub__(1)][0:1]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
102 |
103 | # Attribute access
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
98 98 | print([*list1.__add__(list2)]) # PLC2801
@@ -1116,15 +1170,16 @@ unnecessary_dunder_call.py:101:8: PLC2801 [*] Unnecessary dunder call to `__add_
103 103 | # Attribute access
104 104 | # https://github.com/astral-sh/ruff/issues/15745
-unnecessary_dunder_call.py:101:22: PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
+ --> unnecessary_dunder_call.py:101:22
|
100 | # Slices
101 | print([a.__add__(1), a.__sub__(1)][0:1]) # PLC2801
- | ^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^
102 |
103 | # Attribute access
|
- = help: Use `-` operator
+help: Use `-` operator
ℹ Unsafe fix
98 98 | print([*list1.__add__(list2)]) # PLC2801
@@ -1136,16 +1191,17 @@ unnecessary_dunder_call.py:101:22: PLC2801 [*] Unnecessary dunder call to `__sub
103 103 | # Attribute access
104 104 | # https://github.com/astral-sh/ruff/issues/15745
-unnecessary_dunder_call.py:105:7: PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
+ --> unnecessary_dunder_call.py:105:7
|
103 | # Attribute access
104 | # https://github.com/astral-sh/ruff/issues/15745
105 | print(1j.__add__(1.0).real) # PLC2801
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
106 |
107 | class Thing:
|
- = help: Use `+` operator
+help: Use `+` operator
ℹ Unsafe fix
102 102 |
@@ -1157,26 +1213,28 @@ unnecessary_dunder_call.py:105:7: PLC2801 [*] Unnecessary dunder call to `__add_
107 107 | class Thing:
108 108 | def __init__(self, stuff: Any) -> None:
-unnecessary_dunder_call.py:116:16: PLC2801 Unnecessary dunder call to `__getattribute__`. Access attribute directly or use getattr built-in function.
+PLC2801 Unnecessary dunder call to `__getattribute__`. Access attribute directly or use getattr built-in function.
+ --> unnecessary_dunder_call.py:116:16
|
115 | def do_thing(self, item):
116 | return object.__getattribute__(self, item) # PLC2801
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117 |
118 | def use_descriptor(self, item):
|
- = help: Access attribute directly or use getattr built-in function
+help: Access attribute directly or use getattr built-in function
-unnecessary_dunder_call.py:128:1: PLC2801 [*] Unnecessary dunder call to `__contains__`. Use `in` operator.
+PLC2801 [*] Unnecessary dunder call to `__contains__`. Use `in` operator.
+ --> unnecessary_dunder_call.py:128:1
|
126 | blah = dict[{"a": 1}.__delitem__("a")] # OK
127 |
128 | "abc".__contains__("a")
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^^^^^^^^^
129 |
130 | # https://github.com/astral-sh/ruff/issues/14597
|
- = help: Use `in` operator
+help: Use `in` operator
ℹ Unsafe fix
125 125 |
@@ -1188,15 +1246,16 @@ unnecessary_dunder_call.py:128:1: PLC2801 [*] Unnecessary dunder call to `__cont
130 130 | # https://github.com/astral-sh/ruff/issues/14597
131 131 | assert "abc".__str__() == "abc"
-unnecessary_dunder_call.py:131:8: PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+ --> unnecessary_dunder_call.py:131:8
|
130 | # https://github.com/astral-sh/ruff/issues/14597
131 | assert "abc".__str__() == "abc"
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
132 |
133 | # https://github.com/astral-sh/ruff/issues/18813
|
- = help: Use `str()` builtin
+help: Use `str()` builtin
ℹ Unsafe fix
128 128 | "abc".__contains__("a")
@@ -1208,13 +1267,14 @@ unnecessary_dunder_call.py:131:8: PLC2801 [*] Unnecessary dunder call to `__str_
133 133 | # https://github.com/astral-sh/ruff/issues/18813
134 134 | three = 1 if 1 else(3.0).__str__()
-unnecessary_dunder_call.py:134:20: PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
+ --> unnecessary_dunder_call.py:134:20
|
133 | # https://github.com/astral-sh/ruff/issues/18813
134 | three = 1 if 1 else(3.0).__str__()
- | ^^^^^^^^^^^^^^^ PLC2801
+ | ^^^^^^^^^^^^^^^
|
- = help: Use `str()` builtin
+help: Use `str()` builtin
ℹ Unsafe fix
131 131 | assert "abc".__str__() == "abc"
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap
index d80235c4b6..59968f3620 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap
@@ -1,25 +1,28 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-unnecessary_direct_lambda_call.py:4:5: PLC3002 Lambda expression called directly. Execute the expression inline instead.
+PLC3002 Lambda expression called directly. Execute the expression inline instead.
+ --> unnecessary_direct_lambda_call.py:4:5
|
2 | # pylint: disable=undefined-variable, line-too-long
3 |
4 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC3002
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
|
-unnecessary_direct_lambda_call.py:5:9: PLC3002 Lambda expression called directly. Execute the expression inline instead.
+PLC3002 Lambda expression called directly. Execute the expression inline instead.
+ --> unnecessary_direct_lambda_call.py:5:9
|
4 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call]
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
- | ^^^^^^^^^^^^^^^^^^^ PLC3002
+ | ^^^^^^^^^^^^^^^^^^^
|
-unnecessary_direct_lambda_call.py:5:30: PLC3002 Lambda expression called directly. Execute the expression inline instead.
+PLC3002 Lambda expression called directly. Execute the expression inline instead.
+ --> unnecessary_direct_lambda_call.py:5:30
|
4 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call]
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
- | ^^^^^^^^^^^^^^^^^^ PLC3002
+ | ^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap
index 7fefeeb11b..19a74bf16b 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap
@@ -1,20 +1,22 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-yield_in_init.py:9:9: PLE0100 `__init__` method is a generator
+PLE0100 `__init__` method is a generator
+ --> yield_in_init.py:9:9
|
7 | class A:
8 | def __init__(self):
9 | yield
- | ^^^^^ PLE0100
+ | ^^^^^
|
-yield_in_init.py:14:9: PLE0100 `__init__` method is a generator
+PLE0100 `__init__` method is a generator
+ --> yield_in_init.py:14:9
|
12 | class B:
13 | def __init__(self):
14 | yield from self.gen()
- | ^^^^^^^^^^^^^^^^^^^^^ PLE0100
+ | ^^^^^^^^^^^^^^^^^^^^^
15 |
16 | def gen(self):
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0101_return_in_init.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0101_return_in_init.py.snap
index 79ae8f1ae6..446aa7333c 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0101_return_in_init.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0101_return_in_init.py.snap
@@ -1,21 +1,23 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-return_in_init.py:14:9: PLE0101 Explicit return in `__init__`
+PLE0101 Explicit return in `__init__`
+ --> return_in_init.py:14:9
|
12 | class B:
13 | def __init__(self):
14 | return 3
- | ^^^^^^^^ PLE0101
+ | ^^^^^^^^
15 |
16 | def gen(self):
|
-return_in_init.py:22:9: PLE0101 Explicit return in `__init__`
+PLE0101 Explicit return in `__init__`
+ --> return_in_init.py:22:9
|
21 | def __init__(self):
22 | return 1
- | ^^^^^^^^ PLE0101
+ | ^^^^^^^^
23 |
24 | class MyClass2:
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap
index 9bcbce8cff..94d0f24d68 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap
@@ -1,38 +1,41 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-nonlocal_and_global.py:7:12: PLE0115 Name `counter` is both `nonlocal` and `global`
+PLE0115 Name `counter` is both `nonlocal` and `global`
+ --> nonlocal_and_global.py:7:12
|
6 | def count():
7 | global counter
- | ^^^^^^^ PLE0115
+ | ^^^^^^^
8 | nonlocal counter
9 | counter += 1
|
-nonlocal_and_global.py:20:20: PLE0115 Name `counter` is both `nonlocal` and `global`
+PLE0115 Name `counter` is both `nonlocal` and `global`
+ --> nonlocal_and_global.py:20:20
|
18 | counter += 1
19 | else:
20 | global counter
- | ^^^^^^^ PLE0115
+ | ^^^^^^^
21 | counter += 1
|
-nonlocal_and_global.py:31:16: PLE0115 Name `counter` is both `nonlocal` and `global`
+PLE0115 Name `counter` is both `nonlocal` and `global`
+ --> nonlocal_and_global.py:31:16
|
29 | nonlocal counter
30 | counter += 1
31 | global counter
- | ^^^^^^^ PLE0115
+ | ^^^^^^^
|
-nonlocal_and_global.py:36:12: PLE0115 Name `counter` is both `nonlocal` and `global`
+PLE0115 Name `counter` is both `nonlocal` and `global`
+ --> nonlocal_and_global.py:36:12
|
34 | def count():
35 | nonlocal counter
36 | global counter
- | ^^^^^^^ PLE0115
+ | ^^^^^^^
37 | counter += 1
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap
index 4e375e6b6a..70e4d1609d 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap
@@ -1,24 +1,26 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-nonlocal_without_binding.py:5:14: PLE0117 Nonlocal name `x` found without binding
+PLE0117 Nonlocal name `x` found without binding
+ --> nonlocal_without_binding.py:5:14
|
4 | def f():
5 | nonlocal x
- | ^ PLE0117
+ | ^
|
-nonlocal_without_binding.py:9:14: PLE0117 Nonlocal name `y` found without binding
+PLE0117 Nonlocal name `y` found without binding
+ --> nonlocal_without_binding.py:9:14
|
8 | def f():
9 | nonlocal y
- | ^ PLE0117
+ | ^
|
-nonlocal_without_binding.py:19:18: PLE0117 Nonlocal name `y` found without binding
+PLE0117 Nonlocal name `y` found without binding
+ --> nonlocal_without_binding.py:19:18
|
18 | def f():
19 | nonlocal y
- | ^ PLE0117
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap
index adabada987..4ad920a4ff 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap
@@ -1,133 +1,147 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-load_before_global_declaration.py:5:11: PLE0118 Name `x` is used prior to global declaration on line 7
+PLE0118 Name `x` is used prior to global declaration on line 7
+ --> load_before_global_declaration.py:5:11
|
3 | ###
4 | def f():
5 | print(x)
- | ^ PLE0118
+ | ^
6 |
7 | global x
|
-load_before_global_declaration.py:15:11: PLE0118 Name `x` is used prior to global declaration on line 17
+PLE0118 Name `x` is used prior to global declaration on line 17
+ --> load_before_global_declaration.py:15:11
|
13 | global x
14 |
15 | print(x)
- | ^ PLE0118
+ | ^
16 |
17 | global x
|
-load_before_global_declaration.py:23:11: PLE0118 Name `x` is used prior to global declaration on line 25
+PLE0118 Name `x` is used prior to global declaration on line 25
+ --> load_before_global_declaration.py:23:11
|
22 | def f():
23 | print(x)
- | ^ PLE0118
+ | ^
24 |
25 | global x, y
|
-load_before_global_declaration.py:33:11: PLE0118 Name `x` is used prior to global declaration on line 35
+PLE0118 Name `x` is used prior to global declaration on line 35
+ --> load_before_global_declaration.py:33:11
|
31 | global x, y
32 |
33 | print(x)
- | ^ PLE0118
+ | ^
34 |
35 | global x, y
|
-load_before_global_declaration.py:41:5: PLE0118 Name `x` is used prior to global declaration on line 43
+PLE0118 Name `x` is used prior to global declaration on line 43
+ --> load_before_global_declaration.py:41:5
|
40 | def f():
41 | x = 1
- | ^ PLE0118
+ | ^
42 |
43 | global x
|
-load_before_global_declaration.py:51:5: PLE0118 Name `x` is used prior to global declaration on line 53
+PLE0118 Name `x` is used prior to global declaration on line 53
+ --> load_before_global_declaration.py:51:5
|
49 | global x
50 |
51 | x = 1
- | ^ PLE0118
+ | ^
52 |
53 | global x
|
-load_before_global_declaration.py:59:9: PLE0118 Name `x` is used prior to global declaration on line 61
+PLE0118 Name `x` is used prior to global declaration on line 61
+ --> load_before_global_declaration.py:59:9
|
58 | def f():
59 | del x
- | ^ PLE0118
+ | ^
60 |
61 | global x, y
|
-load_before_global_declaration.py:69:9: PLE0118 Name `x` is used prior to global declaration on line 71
+PLE0118 Name `x` is used prior to global declaration on line 71
+ --> load_before_global_declaration.py:69:9
|
67 | global x, y
68 |
69 | del x
- | ^ PLE0118
+ | ^
70 |
71 | global x, y
|
-load_before_global_declaration.py:77:9: PLE0118 Name `x` is used prior to global declaration on line 79
+PLE0118 Name `x` is used prior to global declaration on line 79
+ --> load_before_global_declaration.py:77:9
|
76 | def f():
77 | del x
- | ^ PLE0118
+ | ^
78 |
79 | global x
|
-load_before_global_declaration.py:87:9: PLE0118 Name `x` is used prior to global declaration on line 89
+PLE0118 Name `x` is used prior to global declaration on line 89
+ --> load_before_global_declaration.py:87:9
|
85 | global x
86 |
87 | del x
- | ^ PLE0118
+ | ^
88 |
89 | global x
|
-load_before_global_declaration.py:95:9: PLE0118 Name `x` is used prior to global declaration on line 97
+PLE0118 Name `x` is used prior to global declaration on line 97
+ --> load_before_global_declaration.py:95:9
|
94 | def f():
95 | del x
- | ^ PLE0118
+ | ^
96 |
97 | global x, y
|
-load_before_global_declaration.py:105:9: PLE0118 Name `x` is used prior to global declaration on line 107
+PLE0118 Name `x` is used prior to global declaration on line 107
+ --> load_before_global_declaration.py:105:9
|
103 | global x, y
104 |
105 | del x
- | ^ PLE0118
+ | ^
106 |
107 | global x, y
|
-load_before_global_declaration.py:113:14: PLE0118 Name `x` is used prior to global declaration on line 114
+PLE0118 Name `x` is used prior to global declaration on line 114
+ --> load_before_global_declaration.py:113:14
|
112 | def f():
113 | print(f"{x=}")
- | ^ PLE0118
+ | ^
114 | global x
|
-load_before_global_declaration.py:162:1: PLE0118 Name `x` is used prior to global declaration on line 163
+PLE0118 Name `x` is used prior to global declaration on line 163
+ --> load_before_global_declaration.py:162:1
|
161 | # surprisingly still an error, global in module scope
162 | x = None
- | ^ PLE0118
+ | ^
163 | global x
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0237_non_slot_assignment.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0237_non_slot_assignment.py.snap
index f053c56e66..ffa9f688bf 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0237_non_slot_assignment.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0237_non_slot_assignment.py.snap
@@ -1,30 +1,32 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-non_slot_assignment.py:6:9: PLE0237 Attribute `surname` is not defined in class's `__slots__`
+PLE0237 Attribute `surname` is not defined in class's `__slots__`
+ --> non_slot_assignment.py:6:9
|
4 | def __init__(self, name, surname):
5 | self.name = name
6 | self.surname = surname # [assigning-non-slot]
- | ^^^^^^^^^^^^ PLE0237
+ | ^^^^^^^^^^^^
7 | self.setup()
|
-non_slot_assignment.py:18:9: PLE0237 Attribute `middle_name` is not defined in class's `__slots__`
+PLE0237 Attribute `middle_name` is not defined in class's `__slots__`
+ --> non_slot_assignment.py:18:9
|
16 | def __init__(self, name, middle_name):
17 | self.name = name
18 | self.middle_name = middle_name # [assigning-non-slot]
- | ^^^^^^^^^^^^^^^^ PLE0237
+ | ^^^^^^^^^^^^^^^^
19 | self.setup()
|
-non_slot_assignment.py:42:9: PLE0237 Attribute `middle_name` is not defined in class's `__slots__`
+PLE0237 Attribute `middle_name` is not defined in class's `__slots__`
+ --> non_slot_assignment.py:42:9
|
40 | def __init__(self, name, middle_name):
41 | self.name = name
42 | self.middle_name = middle_name # [assigning-non-slot]
- | ^^^^^^^^^^^^^^^^ PLE0237
+ | ^^^^^^^^^^^^^^^^
43 | self.setup()
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0241_duplicate_bases.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0241_duplicate_bases.py.snap
index 7848ac3fb6..5961b78d8e 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0241_duplicate_bases.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0241_duplicate_bases.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-duplicate_bases.py:13:13: PLE0241 [*] Duplicate base `A` for class `F1`
+PLE0241 [*] Duplicate base `A` for class `F1`
+ --> duplicate_bases.py:13:13
|
12 | # Duplicate base class is last.
13 | class F1(A, A):
- | ^ PLE0241
+ | ^
14 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
10 10 |
@@ -20,13 +21,14 @@ duplicate_bases.py:13:13: PLE0241 [*] Duplicate base `A` for class `F1`
15 15 |
16 16 |
-duplicate_bases.py:17:13: PLE0241 [*] Duplicate base `A` for class `F2`
+PLE0241 [*] Duplicate base `A` for class `F2`
+ --> duplicate_bases.py:17:13
|
17 | class F2(A, A,):
- | ^ PLE0241
+ | ^
18 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
14 14 | ...
@@ -38,16 +40,17 @@ duplicate_bases.py:17:13: PLE0241 [*] Duplicate base `A` for class `F2`
19 19 |
20 20 |
-duplicate_bases.py:23:5: PLE0241 [*] Duplicate base `A` for class `F3`
+PLE0241 [*] Duplicate base `A` for class `F3`
+ --> duplicate_bases.py:23:5
|
21 | class F3(
22 | A,
23 | A
- | ^ PLE0241
+ | ^
24 | ):
25 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
19 19 |
@@ -58,16 +61,17 @@ duplicate_bases.py:23:5: PLE0241 [*] Duplicate base `A` for class `F3`
24 23 | ):
25 24 | ...
-duplicate_bases.py:30:5: PLE0241 [*] Duplicate base `A` for class `F4`
+PLE0241 [*] Duplicate base `A` for class `F4`
+ --> duplicate_bases.py:30:5
|
28 | class F4(
29 | A,
30 | A,
- | ^ PLE0241
+ | ^
31 | ):
32 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
27 27 |
@@ -78,14 +82,15 @@ duplicate_bases.py:30:5: PLE0241 [*] Duplicate base `A` for class `F4`
32 31 | ...
33 32 |
-duplicate_bases.py:36:13: PLE0241 [*] Duplicate base `A` for class `G1`
+PLE0241 [*] Duplicate base `A` for class `G1`
+ --> duplicate_bases.py:36:13
|
35 | # Duplicate base class is not last.
36 | class G1(A, A, B):
- | ^ PLE0241
+ | ^
37 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
33 33 |
@@ -97,13 +102,14 @@ duplicate_bases.py:36:13: PLE0241 [*] Duplicate base `A` for class `G1`
38 38 |
39 39 |
-duplicate_bases.py:40:13: PLE0241 [*] Duplicate base `A` for class `G2`
+PLE0241 [*] Duplicate base `A` for class `G2`
+ --> duplicate_bases.py:40:13
|
40 | class G2(A, A, B,):
- | ^ PLE0241
+ | ^
41 | ...
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
37 37 | ...
@@ -115,16 +121,17 @@ duplicate_bases.py:40:13: PLE0241 [*] Duplicate base `A` for class `G2`
42 42 |
43 43 |
-duplicate_bases.py:46:5: PLE0241 [*] Duplicate base `A` for class `G3`
+PLE0241 [*] Duplicate base `A` for class `G3`
+ --> duplicate_bases.py:46:5
|
44 | class G3(
45 | A,
46 | A,
- | ^ PLE0241
+ | ^
47 | B
48 | ):
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
43 43 |
@@ -135,16 +142,17 @@ duplicate_bases.py:46:5: PLE0241 [*] Duplicate base `A` for class `G3`
48 47 | ):
49 48 | ...
-duplicate_bases.py:54:5: PLE0241 [*] Duplicate base `A` for class `G4`
+PLE0241 [*] Duplicate base `A` for class `G4`
+ --> duplicate_bases.py:54:5
|
52 | class G4(
53 | A,
54 | A,
- | ^ PLE0241
+ | ^
55 | B,
56 | ):
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Safe fix
51 51 |
@@ -155,16 +163,17 @@ duplicate_bases.py:54:5: PLE0241 [*] Duplicate base `A` for class `G4`
56 55 | ):
57 56 | ...
-duplicate_bases.py:76:5: PLE0241 [*] Duplicate base `Foo` for class `Bar`
+PLE0241 [*] Duplicate base `Foo` for class `Bar`
+ --> duplicate_bases.py:76:5
|
74 | # https://github.com/astral-sh/ruff/issues/18814
75 | class Bar(Foo, # 1
76 | Foo # 2
- | ^^^ PLE0241
+ | ^^^
77 | ):
78 | pass
|
- = help: Remove duplicate base
+help: Remove duplicate base
ℹ Unsafe fix
72 72 | ...
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0302_unexpected_special_method_signature.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0302_unexpected_special_method_signature.py.snap
index c97826b90f..5a6196b824 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0302_unexpected_special_method_signature.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0302_unexpected_special_method_signature.py.snap
@@ -1,145 +1,161 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-unexpected_special_method_signature.py:5:9: PLE0302 The special method `__bool__` expects 1 parameter, 2 were given
+PLE0302 The special method `__bool__` expects 1 parameter, 2 were given
+ --> unexpected_special_method_signature.py:5:9
|
3 | ...
4 |
5 | def __bool__(self, x): # too many mandatory args
- | ^^^^^^^^ PLE0302
+ | ^^^^^^^^
6 | ...
|
-unexpected_special_method_signature.py:19:9: PLE0302 The special method `__bool__` expects 0 parameters, 1 was given
+PLE0302 The special method `__bool__` expects 0 parameters, 1 was given
+ --> unexpected_special_method_signature.py:19:9
|
18 | @staticmethod
19 | def __bool__(x): # too many mandatory args
- | ^^^^^^^^ PLE0302
+ | ^^^^^^^^
20 | ...
|
-unexpected_special_method_signature.py:32:9: PLE0302 The special method `__eq__` expects 2 parameters, 1 was given
+PLE0302 The special method `__eq__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:32:9
|
30 | ...
31 |
32 | def __eq__(self): # too few mandatory args
- | ^^^^^^ PLE0302
+ | ^^^^^^
33 | ...
|
-unexpected_special_method_signature.py:35:9: PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
+PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
+ --> unexpected_special_method_signature.py:35:9
|
33 | ...
34 |
35 | def __eq__(self, other, other_other): # too many mandatory args
- | ^^^^^^ PLE0302
+ | ^^^^^^
36 | ...
|
-unexpected_special_method_signature.py:44:9: PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
+PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
+ --> unexpected_special_method_signature.py:44:9
|
42 | ...
43 |
44 | def __round__(self, x, y): # disallow 2 args
- | ^^^^^^^^^ PLE0302
+ | ^^^^^^^^^
45 | ...
|
-unexpected_special_method_signature.py:47:9: PLE0302 The special method `__round__` expects between 1 and 2 parameters, 4 were given
+PLE0302 The special method `__round__` expects between 1 and 2 parameters, 4 were given
+ --> unexpected_special_method_signature.py:47:9
|
45 | ...
46 |
47 | def __round__(self, x, y, z=2): # disallow 3 args even when one is optional
- | ^^^^^^^^^ PLE0302
+ | ^^^^^^^^^
48 | ...
|
-unexpected_special_method_signature.py:56:9: PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
+PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
+ --> unexpected_special_method_signature.py:56:9
|
54 | ...
55 |
56 | def __eq__(self, x, y, *args): # too many args with *args
- | ^^^^^^ PLE0302
+ | ^^^^^^
57 | ...
|
-unexpected_special_method_signature.py:65:9: PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
+PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
+ --> unexpected_special_method_signature.py:65:9
|
63 | ...
64 |
65 | def __round__(self, x, y, *args): # disallow 2 args
- | ^^^^^^^^^ PLE0302
+ | ^^^^^^^^^
66 | ...
|
-unexpected_special_method_signature.py:89:9: PLE0302 The special method `__next__` expects 1 parameter, 2 were given
+PLE0302 The special method `__next__` expects 1 parameter, 2 were given
+ --> unexpected_special_method_signature.py:89:9
|
87 | ...
88 |
89 | def __next__(self, x): # #16217 assert special method is linted, expects 1 parameter
- | ^^^^^^^^ PLE0302
+ | ^^^^^^^^
90 | ...
|
-unexpected_special_method_signature.py:92:9: PLE0302 The special method `__buffer__` expects 2 parameters, 1 was given
+PLE0302 The special method `__buffer__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:92:9
|
90 | ...
91 |
92 | def __buffer__(self): # #16217 assert special method is linted, expects 2 parameters
- | ^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^
93 | ...
|
-unexpected_special_method_signature.py:95:9: PLE0302 The special method `__class_getitem__` expects 2 parameters, 1 was given
+PLE0302 The special method `__class_getitem__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:95:9
|
93 | ...
94 |
95 | def __class_getitem__(self): # #16217 assert special method is linted, expects 2 parameters
- | ^^^^^^^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^^^^^^^
96 | ...
|
-unexpected_special_method_signature.py:98:9: PLE0302 The special method `__mro_entries__` expects 2 parameters, 1 was given
+PLE0302 The special method `__mro_entries__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:98:9
|
96 | ...
97 |
98 | def __mro_entries__(self): # #16217 assert special method is linted, expects 2 parameters
- | ^^^^^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^^^^^
99 | ...
|
-unexpected_special_method_signature.py:101:9: PLE0302 The special method `__release_buffer__` expects 2 parameters, 1 was given
+PLE0302 The special method `__release_buffer__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:101:9
|
99 | ...
100 |
101 | def __release_buffer__(self): # #16217 assert special method is linted, expects 2 parameters
- | ^^^^^^^^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^^^^^^^^
102 | ...
|
-unexpected_special_method_signature.py:104:9: PLE0302 The special method `__subclasshook__` expects 2 parameters, 1 was given
+PLE0302 The special method `__subclasshook__` expects 2 parameters, 1 was given
+ --> unexpected_special_method_signature.py:104:9
|
102 | ...
103 |
104 | def __subclasshook__(self): # #16217 assert special method is linted, expects 2 parameters
- | ^^^^^^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^^^^^^
105 | ...
|
-unexpected_special_method_signature.py:107:9: PLE0302 The special method `__setattr__` expects 3 parameters, 2 were given
+PLE0302 The special method `__setattr__` expects 3 parameters, 2 were given
+ --> unexpected_special_method_signature.py:107:9
|
105 | ...
106 |
107 | def __setattr__(self, /, name): # #16217 assert positional-only special method is linted, expects 3 parameters
- | ^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^
108 | ...
|
-unexpected_special_method_signature.py:110:9: PLE0302 The special method `__setitem__` expects 3 parameters, 4 were given
+PLE0302 The special method `__setitem__` expects 3 parameters, 4 were given
+ --> unexpected_special_method_signature.py:110:9
|
108 | ...
109 |
110 | def __setitem__(self, key, /, value, extra_value): # #16217 assert positional-only special method is linted, expects 3 parameters
- | ^^^^^^^^^^^ PLE0302
+ | ^^^^^^^^^^^
111 | ...
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap
index f7a85c61e5..55b8ad7aa0 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap
@@ -1,43 +1,47 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-invalid_return_type_length.py:6:16: PLE0303 `__len__` does not return a non-negative integer
+PLE0303 `__len__` does not return a non-negative integer
+ --> invalid_return_type_length.py:6:16
|
4 | class Bool:
5 | def __len__(self):
6 | return True # [invalid-length-return]
- | ^^^^ PLE0303
+ | ^^^^
|
-invalid_return_type_length.py:11:16: PLE0303 `__len__` does not return a non-negative integer
+PLE0303 `__len__` does not return a non-negative integer
+ --> invalid_return_type_length.py:11:16
|
9 | class Float:
10 | def __len__(self):
11 | return 3.05 # [invalid-length-return]
- | ^^^^ PLE0303
+ | ^^^^
|
-invalid_return_type_length.py:16:16: PLE0303 `__len__` does not return a non-negative integer
+PLE0303 `__len__` does not return a non-negative integer
+ --> invalid_return_type_length.py:16:16
|
14 | class Str:
15 | def __len__(self):
16 | return "ruff" # [invalid-length-return]
- | ^^^^^^ PLE0303
+ | ^^^^^^
|
-invalid_return_type_length.py:20:9: PLE0303 `__len__` does not return a non-negative integer
+PLE0303 `__len__` does not return a non-negative integer
+ --> invalid_return_type_length.py:20:9
|
19 | class LengthNoReturn:
20 | def __len__(self):
- | ^^^^^^^ PLE0303
+ | ^^^^^^^
21 | print("ruff") # [invalid-length-return]
|
-invalid_return_type_length.py:26:16: PLE0303 `__len__` does not return a non-negative integer
+PLE0303 `__len__` does not return a non-negative integer
+ --> invalid_return_type_length.py:26:16
|
24 | class LengthNegative:
25 | def __len__(self):
26 | return -42 # [invalid-length-return]
- | ^^^ PLE0303
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap
index 4f156b0611..efbea371b0 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap
@@ -1,20 +1,22 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-invalid_return_type_bool.py:5:16: PLE0304 `__bool__` does not return `bool`
+PLE0304 `__bool__` does not return `bool`
+ --> invalid_return_type_bool.py:5:16
|
3 | class Float:
4 | def __bool__(self):
5 | return 3.05 # [invalid-bool-return]
- | ^^^^ PLE0304
+ | ^^^^
6 |
7 | class Int:
|
-invalid_return_type_bool.py:9:16: PLE0304 `__bool__` does not return `bool`
+PLE0304 `__bool__` does not return `bool`
+ --> invalid_return_type_bool.py:9:16
|
7 | class Int:
8 | def __bool__(self):
9 | return 0 # [invalid-bool-return]
- | ^ PLE0304
+ | ^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap
index 92964417da..6e707341df 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap
@@ -1,42 +1,46 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-invalid_return_type_index.py:8:16: PLE0305 `__index__` does not return an integer
+PLE0305 `__index__` does not return an integer
+ --> invalid_return_type_index.py:8:16
|
7 | def __index__(self):
8 | return True # [invalid-index-return]
- | ^^^^ PLE0305
+ | ^^^^
|
-invalid_return_type_index.py:13:16: PLE0305 `__index__` does not return an integer
+PLE0305 `__index__` does not return an integer
+ --> invalid_return_type_index.py:13:16
|
11 | class Float:
12 | def __index__(self):
13 | return 3.05 # [invalid-index-return]
- | ^^^^ PLE0305
+ | ^^^^
|
-invalid_return_type_index.py:18:16: PLE0305 `__index__` does not return an integer
+PLE0305 `__index__` does not return an integer
+ --> invalid_return_type_index.py:18:16
|
16 | class Dict:
17 | def __index__(self):
18 | return {"1": "1"} # [invalid-index-return]
- | ^^^^^^^^^^ PLE0305
+ | ^^^^^^^^^^
|
-invalid_return_type_index.py:23:16: PLE0305 `__index__` does not return an integer
+PLE0305 `__index__` does not return an integer
+ --> invalid_return_type_index.py:23:16
|
21 | class Str:
22 | def __index__(self):
23 | return "ruff" # [invalid-index-return]
- | ^^^^^^ PLE0305
+ | ^^^^^^
|
-invalid_return_type_index.py:27:9: PLE0305 `__index__` does not return an integer
+PLE0305 `__index__` does not return an integer
+ --> invalid_return_type_index.py:27:9
|
26 | class IndexNoReturn:
27 | def __index__(self):
- | ^^^^^^^^^ PLE0305
+ | ^^^^^^^^^
28 | print("ruff") # [invalid-index-return]
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap
index 31fe3edc92..779d6da34a 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap
@@ -1,44 +1,48 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-invalid_return_type_str.py:6:16: PLE0307 `__str__` does not return `str`
+PLE0307 `__str__` does not return `str`
+ --> invalid_return_type_str.py:6:16
|
4 | class Float:
5 | def __str__(self):
6 | return 3.05
- | ^^^^ PLE0307
+ | ^^^^
|
-invalid_return_type_str.py:11:16: PLE0307 `__str__` does not return `str`
+PLE0307 `__str__` does not return `str`
+ --> invalid_return_type_str.py:11:16
|
9 | class Int:
10 | def __str__(self):
11 | return 1
- | ^ PLE0307
+ | ^
|
-invalid_return_type_str.py:16:16: PLE0307 `__str__` does not return `str`
+PLE0307 `__str__` does not return `str`
+ --> invalid_return_type_str.py:16:16
|
14 | class Int2:
15 | def __str__(self):
16 | return 0
- | ^ PLE0307
+ | ^
|
-invalid_return_type_str.py:21:16: PLE0307 `__str__` does not return `str`
+PLE0307 `__str__` does not return `str`
+ --> invalid_return_type_str.py:21:16
|
19 | class Bool:
20 | def __str__(self):
21 | return False
- | ^^^^^ PLE0307
+ | ^^^^^
|
-invalid_return_type_str.py:58:9: PLE0307 `__str__` does not return `str`
+PLE0307 `__str__` does not return `str`
+ --> invalid_return_type_str.py:58:9
|
57 | class Str5:
58 | def __str__(self): # PLE0307 (returns None if x <= 0)
- | ^^^^^^^ PLE0307
+ | ^^^^^^^
59 | if x > 0:
60 | raise RuntimeError("__str__ not allowed")
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap
index 3f2c76c929..597bc48971 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap
@@ -1,35 +1,38 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-invalid_return_type_bytes.py:6:16: PLE0308 `__bytes__` does not return `bytes`
+PLE0308 `__bytes__` does not return `bytes`
+ --> invalid_return_type_bytes.py:6:16
|
4 | class Float:
5 | def __bytes__(self):
6 | return 3.05 # [invalid-bytes-return]
- | ^^^^ PLE0308
+ | ^^^^
|
-invalid_return_type_bytes.py:11:16: PLE0308 `__bytes__` does not return `bytes`
+PLE0308 `__bytes__` does not return `bytes`
+ --> invalid_return_type_bytes.py:11:16
|
9 | class Int:
10 | def __bytes__(self):
11 | return 0 # [invalid-bytes-return]
- | ^ PLE0308
+ | ^
|
-invalid_return_type_bytes.py:16:16: PLE0308 `__bytes__` does not return `bytes`
+PLE0308 `__bytes__` does not return `bytes`
+ --> invalid_return_type_bytes.py:16:16
|
14 | class Str:
15 | def __bytes__(self):
16 | return "some bytes" # [invalid-bytes-return]
- | ^^^^^^^^^^^^ PLE0308
+ | ^^^^^^^^^^^^
|
-invalid_return_type_bytes.py:20:9: PLE0308 `__bytes__` does not return `bytes`
+PLE0308 `__bytes__` does not return `bytes`
+ --> invalid_return_type_bytes.py:20:9
|
19 | class BytesNoReturn:
20 | def __bytes__(self):
- | ^^^^^^^^^ PLE0308
+ | ^^^^^^^^^
21 | print("ruff") # [invalid-bytes-return]
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap
index 23f61bc9dc..466ddc53bb 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap
@@ -1,35 +1,38 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-invalid_return_type_hash.py:6:16: PLE0309 `__hash__` does not return an integer
+PLE0309 `__hash__` does not return an integer
+ --> invalid_return_type_hash.py:6:16
|
4 | class Bool:
5 | def __hash__(self):
6 | return True # [invalid-hash-return]
- | ^^^^ PLE0309
+ | ^^^^
|
-invalid_return_type_hash.py:11:16: PLE0309 `__hash__` does not return an integer
+PLE0309 `__hash__` does not return an integer
+ --> invalid_return_type_hash.py:11:16
|
9 | class Float:
10 | def __hash__(self):
11 | return 3.05 # [invalid-hash-return]
- | ^^^^ PLE0309
+ | ^^^^
|
-invalid_return_type_hash.py:16:16: PLE0309 `__hash__` does not return an integer
+PLE0309 `__hash__` does not return an integer
+ --> invalid_return_type_hash.py:16:16
|
14 | class Str:
15 | def __hash__(self):
16 | return "ruff" # [invalid-hash-return]
- | ^^^^^^ PLE0309
+ | ^^^^^^
|
-invalid_return_type_hash.py:20:9: PLE0309 `__hash__` does not return an integer
+PLE0309 `__hash__` does not return an integer
+ --> invalid_return_type_hash.py:20:9
|
19 | class HashNoReturn:
20 | def __hash__(self):
- | ^^^^^^^^ PLE0309
+ | ^^^^^^^^
21 | print("ruff") # [invalid-hash-return]
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap
index 775afaf683..ade9450cef 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap
@@ -1,18 +1,20 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-invalid_all_object.py:1:1: PLE0604 Invalid object in `__all__`, must contain only strings
+PLE0604 Invalid object in `__all__`, must contain only strings
+ --> invalid_all_object.py:1:1
|
1 | __all__ = (
- | ^^^^^^^ PLE0604
+ | ^^^^^^^
2 | None, # [invalid-all-object]
3 | Fruit,
|
-invalid_all_object.py:7:1: PLE0604 Invalid object in `__all__`, must contain only strings
+PLE0604 Invalid object in `__all__`, must contain only strings
+ --> invalid_all_object.py:7:1
|
5 | )
6 |
7 | __all__ = list([None, "Fruit", "Worm"]) # [invalid-all-object]
- | ^^^^^^^ PLE0604
+ | ^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0605_invalid_all_format.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0605_invalid_all_format.py.snap
index f2ae393351..2e52733f9f 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0605_invalid_all_format.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0605_invalid_all_format.py.snap
@@ -1,130 +1,143 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-invalid_all_format.py:1:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:1:1
|
1 | __all__ = "CONST" # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
2 |
3 | __all__ = ["Hello"] + {"world"} # [invalid-all-format]
|
-invalid_all_format.py:3:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:3:1
|
1 | __all__ = "CONST" # [invalid-all-format]
2 |
3 | __all__ = ["Hello"] + {"world"} # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
4 |
5 | __all__ += {"world"} # [invalid-all-format]
|
-invalid_all_format.py:5:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:5:1
|
3 | __all__ = ["Hello"] + {"world"} # [invalid-all-format]
4 |
5 | __all__ += {"world"} # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
6 |
7 | __all__ = {"world"} + ["Hello"] # [invalid-all-format]
|
-invalid_all_format.py:7:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:7:1
|
5 | __all__ += {"world"} # [invalid-all-format]
6 |
7 | __all__ = {"world"} + ["Hello"] # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
8 |
9 | __all__ = {"world"} + list(["Hello"]) # [invalid-all-format]
|
-invalid_all_format.py:9:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:9:1
|
7 | __all__ = {"world"} + ["Hello"] # [invalid-all-format]
8 |
9 | __all__ = {"world"} + list(["Hello"]) # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
10 |
11 | __all__ = list(["Hello"]) + {"world"} # [invalid-all-format]
|
-invalid_all_format.py:11:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:11:1
|
9 | __all__ = {"world"} + list(["Hello"]) # [invalid-all-format]
10 |
11 | __all__ = list(["Hello"]) + {"world"} # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
12 |
13 | __all__ = (x for x in ["Hello", "world"]) # [invalid-all-format]
|
-invalid_all_format.py:13:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:13:1
|
11 | __all__ = list(["Hello"]) + {"world"} # [invalid-all-format]
12 |
13 | __all__ = (x for x in ["Hello", "world"]) # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
14 |
15 | __all__ = {x for x in ["Hello", "world"]} # [invalid-all-format]
|
-invalid_all_format.py:15:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:15:1
|
13 | __all__ = (x for x in ["Hello", "world"]) # [invalid-all-format]
14 |
15 | __all__ = {x for x in ["Hello", "world"]} # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
16 |
17 | __all__ = foo # [invalid-all-format]
|
-invalid_all_format.py:17:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:17:1
|
15 | __all__ = {x for x in ["Hello", "world"]} # [invalid-all-format]
16 |
17 | __all__ = foo # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
18 |
19 | __all__ = foo.bar # [invalid-all-format]
|
-invalid_all_format.py:19:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:19:1
|
17 | __all__ = foo # [invalid-all-format]
18 |
19 | __all__ = foo.bar # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
20 |
21 | __all__ = foo["bar"] # [invalid-all-format]
|
-invalid_all_format.py:21:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:21:1
|
19 | __all__ = foo.bar # [invalid-all-format]
20 |
21 | __all__ = foo["bar"] # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
22 |
23 | __all__ = (foo := bar) # [invalid-all-format]
|
-invalid_all_format.py:23:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:23:1
|
21 | __all__ = foo["bar"] # [invalid-all-format]
22 |
23 | __all__ = (foo := bar) # [invalid-all-format]
- | ^^^^^^^ PLE0605
+ | ^^^^^^^
24 |
25 | __all__ = ["Hello"]
|
-invalid_all_format.py:23:12: PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+PLE0605 Invalid format for `__all__`, must be `tuple` or `list`
+ --> invalid_all_format.py:23:12
|
21 | __all__ = foo["bar"] # [invalid-all-format]
22 |
23 | __all__ = (foo := bar) # [invalid-all-format]
- | ^^^ PLE0605
+ | ^^^
24 |
25 | __all__ = ["Hello"]
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0643_potential_index_error.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0643_potential_index_error.py.snap
index 78dcba4f77..0a3a7fcfab 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0643_potential_index_error.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0643_potential_index_error.py.snap
@@ -1,38 +1,42 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-potential_index_error.py:1:17: PLE0643 Expression is likely to raise `IndexError`
+PLE0643 Expression is likely to raise `IndexError`
+ --> potential_index_error.py:1:17
|
1 | print([1, 2, 3][3]) # PLE0643
- | ^ PLE0643
+ | ^
2 | print([1, 2, 3][-4]) # PLE0643
3 | print([1, 2, 3][999999999999999999999999999999999999999999]) # PLE0643
|
-potential_index_error.py:2:17: PLE0643 Expression is likely to raise `IndexError`
+PLE0643 Expression is likely to raise `IndexError`
+ --> potential_index_error.py:2:17
|
1 | print([1, 2, 3][3]) # PLE0643
2 | print([1, 2, 3][-4]) # PLE0643
- | ^^ PLE0643
+ | ^^
3 | print([1, 2, 3][999999999999999999999999999999999999999999]) # PLE0643
4 | print([1, 2, 3][-999999999999999999999999999999999999999999]) # PLE0643
|
-potential_index_error.py:3:17: PLE0643 Expression is likely to raise `IndexError`
+PLE0643 Expression is likely to raise `IndexError`
+ --> potential_index_error.py:3:17
|
1 | print([1, 2, 3][3]) # PLE0643
2 | print([1, 2, 3][-4]) # PLE0643
3 | print([1, 2, 3][999999999999999999999999999999999999999999]) # PLE0643
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE0643
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | print([1, 2, 3][-999999999999999999999999999999999999999999]) # PLE0643
|
-potential_index_error.py:4:17: PLE0643 Expression is likely to raise `IndexError`
+PLE0643 Expression is likely to raise `IndexError`
+ --> potential_index_error.py:4:17
|
2 | print([1, 2, 3][-4]) # PLE0643
3 | print([1, 2, 3][999999999999999999999999999999999999999999]) # PLE0643
4 | print([1, 2, 3][-999999999999999999999999999999999999999999]) # PLE0643
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE0643
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 |
6 | print([1, 2, 3][2]) # OK
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap
index 560e9029f0..5d3ee1f406 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap
@@ -1,88 +1,97 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-misplaced_bare_raise.py:30:5: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:30:5
|
29 | try:
30 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
31 | except Exception:
32 | pass
|
-misplaced_bare_raise.py:36:9: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:36:9
|
34 | def f():
35 | try:
36 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
37 | except Exception:
38 | pass
|
-misplaced_bare_raise.py:41:5: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:41:5
|
40 | def g():
41 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
42 |
43 | def h():
|
-misplaced_bare_raise.py:47:17: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:47:17
|
45 | if True:
46 | def i():
47 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
48 | except Exception:
49 | pass
|
-misplaced_bare_raise.py:50:5: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:50:5
|
48 | except Exception:
49 | pass
50 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
51 |
52 | raise # [misplaced-bare-raise]
|
-misplaced_bare_raise.py:52:1: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:52:1
|
50 | raise # [misplaced-bare-raise]
51 |
52 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
53 |
54 | try:
|
-misplaced_bare_raise.py:58:9: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:58:9
|
56 | except:
57 | def i():
58 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
59 |
60 | try:
|
-misplaced_bare_raise.py:64:9: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:64:9
|
62 | except:
63 | class C:
64 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
65 |
66 | try:
|
-misplaced_bare_raise.py:71:5: PLE0704 Bare `raise` statement is not inside an exception handler
+PLE0704 Bare `raise` statement is not inside an exception handler
+ --> misplaced_bare_raise.py:71:5
|
69 | pass
70 | finally:
71 | raise # [misplaced-bare-raise]
- | ^^^^^ PLE0704
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap
index 702fb4f4c9..8c677630f1 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap
@@ -1,79 +1,86 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-repeated_keyword_argument.py:16:21: PLE1132 Repeated keyword argument: `c`
+PLE1132 Repeated keyword argument: `c`
+ --> repeated_keyword_argument.py:16:21
|
15 | # Invalid
16 | func(a=11, c=31, **{"c": 41})
- | ^^^ PLE1132
+ | ^^^
17 | func(a=11, c=31, **{"c": 41, "a": 51})
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
|
-repeated_keyword_argument.py:17:21: PLE1132 Repeated keyword argument: `c`
+PLE1132 Repeated keyword argument: `c`
+ --> repeated_keyword_argument.py:17:21
|
15 | # Invalid
16 | func(a=11, c=31, **{"c": 41})
17 | func(a=11, c=31, **{"c": 41, "a": 51})
- | ^^^ PLE1132
+ | ^^^
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
|
-repeated_keyword_argument.py:17:30: PLE1132 Repeated keyword argument: `a`
+PLE1132 Repeated keyword argument: `a`
+ --> repeated_keyword_argument.py:17:30
|
15 | # Invalid
16 | func(a=11, c=31, **{"c": 41})
17 | func(a=11, c=31, **{"c": 41, "a": 51})
- | ^^^ PLE1132
+ | ^^^
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
|
-repeated_keyword_argument.py:18:27: PLE1132 Repeated keyword argument: `b`
+PLE1132 Repeated keyword argument: `b`
+ --> repeated_keyword_argument.py:18:27
|
16 | func(a=11, c=31, **{"c": 41})
17 | func(a=11, c=31, **{"c": 41, "a": 51})
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
- | ^^^ PLE1132
+ | ^^^
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
20 | func(a=11, b=21, **{"c": 31, "c": 32})
|
-repeated_keyword_argument.py:18:36: PLE1132 Repeated keyword argument: `c`
+PLE1132 Repeated keyword argument: `c`
+ --> repeated_keyword_argument.py:18:36
|
16 | func(a=11, c=31, **{"c": 41})
17 | func(a=11, c=31, **{"c": 41, "a": 51})
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
- | ^^^ PLE1132
+ | ^^^
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
20 | func(a=11, b=21, **{"c": 31, "c": 32})
|
-repeated_keyword_argument.py:18:45: PLE1132 Repeated keyword argument: `a`
+PLE1132 Repeated keyword argument: `a`
+ --> repeated_keyword_argument.py:18:45
|
16 | func(a=11, c=31, **{"c": 41})
17 | func(a=11, c=31, **{"c": 41, "a": 51})
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
- | ^^^ PLE1132
+ | ^^^
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
20 | func(a=11, b=21, **{"c": 31, "c": 32})
|
-repeated_keyword_argument.py:19:34: PLE1132 Repeated keyword argument: `c`
+PLE1132 Repeated keyword argument: `c`
+ --> repeated_keyword_argument.py:19:34
|
17 | func(a=11, c=31, **{"c": 41, "a": 51})
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
- | ^^^ PLE1132
+ | ^^^
20 | func(a=11, b=21, **{"c": 31, "c": 32})
|
-repeated_keyword_argument.py:20:30: PLE1132 Repeated keyword argument: `c`
+PLE1132 Repeated keyword argument: `c`
+ --> repeated_keyword_argument.py:20:30
|
18 | func(a=11, b=21, c=31, **{"b": 22, "c": 41, "a": 51})
19 | func(a=11, b=21, **{"c": 31}, **{"c": 32})
20 | func(a=11, b=21, **{"c": 31, "c": 32})
- | ^^^ PLE1132
+ | ^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1141_dict_iter_missing_items.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1141_dict_iter_missing_items.py.snap
index c99492114a..e50e12a1fa 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1141_dict_iter_missing_items.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1141_dict_iter_missing_items.py.snap
@@ -1,14 +1,15 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-dict_iter_missing_items.py:13:13: PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
+PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
+ --> dict_iter_missing_items.py:13:13
|
12 | # Errors
13 | for k, v in d:
- | ^ PLE1141
+ | ^
14 | pass
|
- = help: Add a call to `.items()`
+help: Add a call to `.items()`
ℹ Unsafe fix
10 10 | s2 = {1, 2, 3}
@@ -20,15 +21,16 @@ dict_iter_missing_items.py:13:13: PLE1141 [*] Unpacking a dictionary in iteratio
15 15 |
16 16 | for k, v in d_tuple_incorrect_tuple:
-dict_iter_missing_items.py:16:13: PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
+PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
+ --> dict_iter_missing_items.py:16:13
|
14 | pass
15 |
16 | for k, v in d_tuple_incorrect_tuple:
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLE1141
+ | ^^^^^^^^^^^^^^^^^^^^^^^
17 | pass
|
- = help: Add a call to `.items()`
+help: Add a call to `.items()`
ℹ Unsafe fix
13 13 | for k, v in d:
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap
index 4045604439..67bd86f7de 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap
@@ -1,10 +1,10 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-await_outside_async.ipynb:9:5: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.ipynb:9:5
|
8 | def foo():
9 | await asyncio.sleep(1) # # [await-outside-async]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap
index 05e0044833..5427508ed8 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap
@@ -1,86 +1,97 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-await_outside_async.py:15:11: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:15:11
|
14 | def not_async():
15 | print(await nested()) # [await-outside-async]
- | ^^^^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^^^^
|
-await_outside_async.py:29:9: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:29:9
|
27 | async def func2():
28 | def inner_func():
29 | await asyncio.sleep(1) # [await-outside-async]
- | ^^^^^^^^^^^^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
-await_outside_async.py:38:5: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:38:5
|
37 | def async_for_loop():
38 | / async for x in foo():
39 | | pass
- | |____________^ PLE1142
+ | |____________^
|
-await_outside_async.py:43:5: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:43:5
|
42 | def async_with():
43 | / async with foo():
44 | | pass
- | |____________^ PLE1142
+ | |____________^
|
-await_outside_async.py:54:6: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:54:6
|
52 | # See: https://github.com/astral-sh/ruff/issues/14167
53 | def async_for_list_comprehension_elt():
54 | [await x for x in foo()]
- | ^^^^^^^ PLE1142
+ | ^^^^^^^
|
-await_outside_async.py:59:8: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:59:8
|
57 | # See: https://github.com/astral-sh/ruff/issues/14167
58 | def async_for_list_comprehension():
59 | [x async for x in foo()]
- | ^^^^^^^^^^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^^^^^^^^^^
|
-await_outside_async.py:64:17: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:64:17
|
62 | # See: https://github.com/astral-sh/ruff/issues/14167
63 | def await_generator_iter():
64 | (x for x in await foo())
- | ^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^
|
-await_outside_async.py:74:17: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:74:17
|
72 | # See: https://github.com/astral-sh/ruff/issues/14167
73 | def async_for_list_comprehension_target():
74 | [x for x in await foo()]
- | ^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^
|
-await_outside_async.py:78:6: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:78:6
|
77 | def async_for_dictionary_comprehension_key():
78 | {await x: y for x, y in foo()}
- | ^^^^^^^ PLE1142
+ | ^^^^^^^
|
-await_outside_async.py:82:9: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:82:9
|
81 | def async_for_dictionary_comprehension_value():
82 | {y: await x for x, y in foo()}
- | ^^^^^^^ PLE1142
+ | ^^^^^^^
|
-await_outside_async.py:86:11: PLE1142 `await` should be used within an async function
+PLE1142 `await` should be used within an async function
+ --> await_outside_async.py:86:11
|
85 | def async_for_dict_comprehension():
86 | {x: y async for x, y in foo()}
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLE1142
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap
index d905356f3d..5c99c8e502 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap
@@ -1,42 +1,46 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-logging_too_many_args.py:3:1: PLE1205 Too many arguments for `logging` format string
+PLE1205 Too many arguments for `logging` format string
+ --> logging_too_many_args.py:3:1
|
1 | import logging
2 |
3 | logging.warning("Hello %s", "World!", "again") # [logging-too-many-args]
- | ^^^^^^^^^^^^^^^ PLE1205
+ | ^^^^^^^^^^^^^^^
4 |
5 | logging.warning("Hello %s", "World!", "again", something="else")
|
-logging_too_many_args.py:5:1: PLE1205 Too many arguments for `logging` format string
+PLE1205 Too many arguments for `logging` format string
+ --> logging_too_many_args.py:5:1
|
3 | logging.warning("Hello %s", "World!", "again") # [logging-too-many-args]
4 |
5 | logging.warning("Hello %s", "World!", "again", something="else")
- | ^^^^^^^^^^^^^^^ PLE1205
+ | ^^^^^^^^^^^^^^^
6 |
7 | logging.warning("Hello %s", "World!")
|
-logging_too_many_args.py:29:1: PLE1205 Too many arguments for `logging` format string
+PLE1205 Too many arguments for `logging` format string
+ --> logging_too_many_args.py:29:1
|
27 | from logging import info, error, warning
28 |
29 | warning("Hello %s", "World!", "again") # [logging-too-many-args]
- | ^^^^^^^ PLE1205
+ | ^^^^^^^
30 |
31 | warning("Hello %s", "World!", "again", something="else")
|
-logging_too_many_args.py:31:1: PLE1205 Too many arguments for `logging` format string
+PLE1205 Too many arguments for `logging` format string
+ --> logging_too_many_args.py:31:1
|
29 | warning("Hello %s", "World!", "again") # [logging-too-many-args]
30 |
31 | warning("Hello %s", "World!", "again", something="else")
- | ^^^^^^^ PLE1205
+ | ^^^^^^^
32 |
33 | warning("Hello %s", "World!")
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap
index 0961e1b05f..b9fe686170 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap
@@ -1,22 +1,24 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-logging_too_few_args.py:3:1: PLE1206 Not enough arguments for `logging` format string
+PLE1206 Not enough arguments for `logging` format string
+ --> logging_too_few_args.py:3:1
|
1 | import logging
2 |
3 | logging.warning("Hello %s %s", "World!") # [logging-too-few-args]
- | ^^^^^^^^^^^^^^^ PLE1206
+ | ^^^^^^^^^^^^^^^
4 |
5 | # do not handle calls with kwargs (like pylint)
|
-logging_too_few_args.py:33:1: PLE1206 Not enough arguments for `logging` format string
+PLE1206 Not enough arguments for `logging` format string
+ --> logging_too_few_args.py:33:1
|
31 | from logging import error, info, warning
32 |
33 | warning("Hello %s %s", "World!") # [logging-too-few-args]
- | ^^^^^^^ PLE1206
+ | ^^^^^^^
34 |
35 | # do not handle calls with kwargs (like pylint)
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap
index aed97848ee..8de582760c 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1300_bad_string_format_character.py.snap
@@ -1,62 +1,68 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-bad_string_format_character.py:5:1: PLE1300 Unsupported format character 'z'
+PLE1300 Unsupported format character 'z'
+ --> bad_string_format_character.py:5:1
|
3 | ## Old style formatting
4 |
5 | "%s %z" % ("hello", "world") # [bad-format-character]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 | "%s" "%z" % ("hello", "world") # [bad-format-character]
|
-bad_string_format_character.py:7:1: PLE1300 Unsupported format character 'z'
+PLE1300 Unsupported format character 'z'
+ --> bad_string_format_character.py:7:1
|
5 | "%s %z" % ("hello", "world") # [bad-format-character]
6 |
7 | "%s" "%z" % ("hello", "world") # [bad-format-character]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 | """%s %z""" % ("hello", "world") # [bad-format-character]
|
-bad_string_format_character.py:9:1: PLE1300 Unsupported format character 'z'
+PLE1300 Unsupported format character 'z'
+ --> bad_string_format_character.py:9:1
|
7 | "%s" "%z" % ("hello", "world") # [bad-format-character]
8 |
9 | """%s %z""" % ("hello", "world") # [bad-format-character]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |
11 | """%s""" """%z""" % ("hello", "world") # [bad-format-character]
|
-bad_string_format_character.py:11:1: PLE1300 Unsupported format character 'z'
+PLE1300 Unsupported format character 'z'
+ --> bad_string_format_character.py:11:1
|
9 | """%s %z""" % ("hello", "world") # [bad-format-character]
10 |
11 | """%s""" """%z""" % ("hello", "world") # [bad-format-character]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 |
13 | ## New style formatting
|
-bad_string_format_character.py:15:1: PLE1300 Unsupported format character 'y'
+PLE1300 Unsupported format character 'y'
+ --> bad_string_format_character.py:15:1
|
13 | ## New style formatting
14 |
15 | "{:s} {:y}".format("hello", "world") # [bad-format-character]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 |
17 | "{:*^30s}".format("centered") # OK
|
-bad_string_format_character.py:19:1: PLE1300 Unsupported format character 'y'
+PLE1300 Unsupported format character 'y'
+ --> bad_string_format_character.py:19:1
|
17 | "{:*^30s}".format("centered") # OK
18 | "{:{s}}".format("hello", s="s") # OK (nested placeholder value not checked)
19 | "{:{s:y}}".format("hello", s="s") # [bad-format-character] (nested placeholder format spec checked)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1300
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 | "{0:.{prec}g}".format(1.23, prec=15) # OK (cannot validate after nested placeholder)
21 | "{0:.{foo}{bar}{foobar}y}".format(...) # OK (cannot validate after nested placeholders)
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap
index 971f3addb6..d490b171ba 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap
@@ -1,129 +1,142 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-bad_string_format_type.py:2:7: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:2:7
|
1 | # Errors
2 | print("foo %(foo)d bar %(bar)d" % {"foo": "1", "bar": "2"})
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 |
4 | "foo %e bar %s" % ("1", 2)
|
-bad_string_format_type.py:4:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:4:1
|
2 | print("foo %(foo)d bar %(bar)d" % {"foo": "1", "bar": "2"})
3 |
4 | "foo %e bar %s" % ("1", 2)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
5 |
6 | "%d" % "1"
|
-bad_string_format_type.py:6:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:6:1
|
4 | "foo %e bar %s" % ("1", 2)
5 |
6 | "%d" % "1"
- | ^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^
7 | "%o" % "1"
8 | "%(key)d" % {"key": "1"}
|
-bad_string_format_type.py:7:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:7:1
|
6 | "%d" % "1"
7 | "%o" % "1"
- | ^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^
8 | "%(key)d" % {"key": "1"}
9 | "%x" % 1.1
|
-bad_string_format_type.py:8:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:8:1
|
6 | "%d" % "1"
7 | "%o" % "1"
8 | "%(key)d" % {"key": "1"}
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
9 | "%x" % 1.1
10 | "%(key)x" % {"key": 1.1}
|
-bad_string_format_type.py:9:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:9:1
|
7 | "%o" % "1"
8 | "%(key)d" % {"key": "1"}
9 | "%x" % 1.1
- | ^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^
10 | "%(key)x" % {"key": 1.1}
11 | "%d" % []
|
-bad_string_format_type.py:10:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:10:1
|
8 | "%(key)d" % {"key": "1"}
9 | "%x" % 1.1
10 | "%(key)x" % {"key": 1.1}
- | ^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
11 | "%d" % []
12 | "%d" % ([],)
|
-bad_string_format_type.py:11:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:11:1
|
9 | "%x" % 1.1
10 | "%(key)x" % {"key": 1.1}
11 | "%d" % []
- | ^^^^^^^^^ PLE1307
+ | ^^^^^^^^^
12 | "%d" % ([],)
13 | "%(key)d" % {"key": []}
|
-bad_string_format_type.py:12:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:12:1
|
10 | "%(key)x" % {"key": 1.1}
11 | "%d" % []
12 | "%d" % ([],)
- | ^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^
13 | "%(key)d" % {"key": []}
14 | print("%d" % ("%s" % ("nested",),))
|
-bad_string_format_type.py:13:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:13:1
|
11 | "%d" % []
12 | "%d" % ([],)
13 | "%(key)d" % {"key": []}
- | ^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^
14 | print("%d" % ("%s" % ("nested",),))
15 | "%d" % ((1, 2, 3),)
|
-bad_string_format_type.py:14:7: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:14:7
|
12 | "%d" % ([],)
13 | "%(key)d" % {"key": []}
14 | print("%d" % ("%s" % ("nested",),))
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | "%d" % ((1, 2, 3),)
16 | "%d" % (1 if x > 0 else [])
|
-bad_string_format_type.py:15:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:15:1
|
13 | "%(key)d" % {"key": []}
14 | print("%d" % ("%s" % ("nested",),))
15 | "%d" % ((1, 2, 3),)
- | ^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^
16 | "%d" % (1 if x > 0 else [])
|
-bad_string_format_type.py:16:1: PLE1307 Format type does not match argument type
+PLE1307 Format type does not match argument type
+ --> bad_string_format_type.py:16:1
|
14 | print("%d" % ("%s" % ("nested",),))
15 | "%d" % ((1, 2, 3),)
16 | "%d" % (1 if x > 0 else [])
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1307
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 |
18 | # False negatives
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap
index a3d6f646c0..5c2872ae8b 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap
@@ -1,210 +1,232 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-bad_str_strip_call.py:2:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:2:21
|
1 | # PLE1310
2 | "Hello World".strip("Hello")
- | ^^^^^^^ PLE1310
+ | ^^^^^^^
3 |
4 | # PLE1310
|
-bad_str_strip_call.py:5:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:5:21
|
4 | # PLE1310
5 | "Hello World".strip("Hello")
- | ^^^^^^^ PLE1310
+ | ^^^^^^^
6 |
7 | # PLE1310
|
-bad_str_strip_call.py:8:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:8:21
|
7 | # PLE1310
8 | "Hello World".strip(u"Hello")
- | ^^^^^^^^ PLE1310
+ | ^^^^^^^^
9 |
10 | # PLE1310
|
-bad_str_strip_call.py:11:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:11:21
|
10 | # PLE1310
11 | "Hello World".strip(r"Hello")
- | ^^^^^^^^ PLE1310
+ | ^^^^^^^^
12 |
13 | # PLE1310
|
-bad_str_strip_call.py:14:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:14:21
|
13 | # PLE1310
14 | "Hello World".strip("Hello\t")
- | ^^^^^^^^^ PLE1310
+ | ^^^^^^^^^
15 |
16 | # PLE1310
|
-bad_str_strip_call.py:17:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:17:21
|
16 | # PLE1310
17 | "Hello World".strip(r"Hello\t")
- | ^^^^^^^^^^ PLE1310
+ | ^^^^^^^^^^
18 |
19 | # PLE1310
|
-bad_str_strip_call.py:20:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:20:21
|
19 | # PLE1310
20 | "Hello World".strip("Hello\\")
- | ^^^^^^^^^ PLE1310
+ | ^^^^^^^^^
21 |
22 | # PLE1310
|
-bad_str_strip_call.py:23:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:23:21
|
22 | # PLE1310
23 | "Hello World".strip(r"Hello\\")
- | ^^^^^^^^^^ PLE1310
+ | ^^^^^^^^^^
24 |
25 | # PLE1310
|
-bad_str_strip_call.py:26:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:26:21
|
25 | # PLE1310
26 | "Hello World".strip("🤣🤣🤣🤣🙃👀😀")
- | ^^^^^^^^^^^^^^^^ PLE1310
+ | ^^^^^^^^^^^^^^^^
27 |
28 | # PLE1310
|
-bad_str_strip_call.py:30:5: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:30:5
|
28 | # PLE1310
29 | "Hello World".strip(
30 | / """
31 | | there are a lot of characters to strip
32 | | """
- | |___^ PLE1310
+ | |___^
33 | )
|
-bad_str_strip_call.py:36:21: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:36:21
|
35 | # PLE1310
36 | "Hello World".strip("can we get a long " \
| _____________________^
37 | | "string of characters to strip " \
38 | | "please?")
- | |_____________________________^ PLE1310
+ | |_____________________________^
39 |
40 | # PLE1310
|
-bad_str_strip_call.py:42:5: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:42:5
|
40 | # PLE1310
41 | "Hello World".strip(
42 | / "can we get a long "
43 | | "string of characters to strip "
44 | | "please?"
- | |_____________^ PLE1310
+ | |_____________^
45 | )
|
-bad_str_strip_call.py:49:5: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:49:5
|
47 | # PLE1310
48 | "Hello World".strip(
49 | / "can \t we get a long"
50 | | "string \t of characters to strip"
51 | | "please?"
- | |_____________^ PLE1310
+ | |_____________^
52 | )
|
-bad_str_strip_call.py:61:11: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:61:11
|
60 | # PLE1310
61 | u''.strip('http://')
- | ^^^^^^^^^ PLE1310
+ | ^^^^^^^^^
62 |
63 | # PLE1310
|
-bad_str_strip_call.py:64:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
+PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
+ --> bad_str_strip_call.py:64:12
|
63 | # PLE1310
64 | u''.lstrip('http://')
- | ^^^^^^^^^ PLE1310
+ | ^^^^^^^^^
65 |
66 | # PLE1310
|
-bad_str_strip_call.py:67:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
+PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
+ --> bad_str_strip_call.py:67:12
|
66 | # PLE1310
67 | b''.rstrip(b'http://')
- | ^^^^^^^^^^ PLE1310
+ | ^^^^^^^^^^
68 |
69 | # OK
|
-bad_str_strip_call.py:79:10: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:79:10
|
78 | # Errors: Multiple backslashes
79 | ''.strip('\\b\\x09')
- | ^^^^^^^^^^ PLE1310
+ | ^^^^^^^^^^
80 | ''.strip(r'\b\x09')
81 | ''.strip('\\\x5C')
|
-bad_str_strip_call.py:80:10: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:80:10
|
78 | # Errors: Multiple backslashes
79 | ''.strip('\\b\\x09')
80 | ''.strip(r'\b\x09')
- | ^^^^^^^^^ PLE1310
+ | ^^^^^^^^^
81 | ''.strip('\\\x5C')
|
-bad_str_strip_call.py:81:10: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:81:10
|
79 | ''.strip('\\b\\x09')
80 | ''.strip(r'\b\x09')
81 | ''.strip('\\\x5C')
- | ^^^^^^^^ PLE1310
+ | ^^^^^^^^
82 |
83 | # Errors: Type inference
|
-bad_str_strip_call.py:85:9: PLE1310 String `strip` call contains duplicate characters
+PLE1310 String `strip` call contains duplicate characters
+ --> bad_str_strip_call.py:85:9
|
83 | # Errors: Type inference
84 | b = b''
85 | b.strip(b'//')
- | ^^^^^ PLE1310
+ | ^^^^^
86 |
87 | # Errors: Type inference (preview)
|
-bad_str_strip_call.py:89:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
+PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
+ --> bad_str_strip_call.py:89:12
|
87 | # Errors: Type inference (preview)
88 | foo: str = ""; bar: bytes = b""
89 | foo.rstrip("//")
- | ^^^^ PLE1310
+ | ^^^^
90 | bar.lstrip(b"//")
|
-bad_str_strip_call.py:90:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
+PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
+ --> bad_str_strip_call.py:90:12
|
88 | foo: str = ""; bar: bytes = b""
89 | foo.rstrip("//")
90 | bar.lstrip(b"//")
- | ^^^^^ PLE1310
+ | ^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap
index 79e29de638..b027830f43 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap
@@ -1,52 +1,57 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-invalid_envvar_value.py:3:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+ --> invalid_envvar_value.py:3:11
|
1 | import os
2 |
3 | os.getenv(1) # [invalid-envvar-value]
- | ^ PLE1507
+ | ^
4 | os.getenv("a")
5 | os.getenv("test")
|
-invalid_envvar_value.py:7:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+ --> invalid_envvar_value.py:7:15
|
5 | os.getenv("test")
6 | os.getenv(key="testingAgain")
7 | os.getenv(key=11) # [invalid-envvar-value]
- | ^^ PLE1507
+ | ^^
8 | os.getenv(["hello"]) # [invalid-envvar-value]
9 | os.getenv(key="foo", default="bar")
|
-invalid_envvar_value.py:8:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+ --> invalid_envvar_value.py:8:11
|
6 | os.getenv(key="testingAgain")
7 | os.getenv(key=11) # [invalid-envvar-value]
8 | os.getenv(["hello"]) # [invalid-envvar-value]
- | ^^^^^^^^^ PLE1507
+ | ^^^^^^^^^
9 | os.getenv(key="foo", default="bar")
10 | os.getenv(key=f"foo", default="bar")
|
-invalid_envvar_value.py:12:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+ --> invalid_envvar_value.py:12:15
|
10 | os.getenv(key=f"foo", default="bar")
11 | os.getenv(key="foo" + "bar", default=1)
12 | os.getenv(key=1 + "bar", default=1) # [invalid-envvar-value]
- | ^^^^^^^^^ PLE1507
+ | ^^^^^^^^^
13 | os.getenv("PATH_TEST" if using_clear_path else "PATH_ORIG")
14 | os.getenv(1 if using_clear_path else "PATH_ORIG")
|
-invalid_envvar_value.py:14:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
+ --> invalid_envvar_value.py:14:11
|
12 | os.getenv(key=1 + "bar", default=1) # [invalid-envvar-value]
13 | os.getenv("PATH_TEST" if using_clear_path else "PATH_ORIG")
14 | os.getenv(1 if using_clear_path else "PATH_ORIG")
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1507
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 |
16 | AA = "aa"
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1519_singledispatch_method.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1519_singledispatch_method.py.snap
index 4ec3382c4b..3b95a4d1db 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1519_singledispatch_method.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1519_singledispatch_method.py.snap
@@ -1,15 +1,16 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-singledispatch_method.py:10:5: PLE1519 [*] `@singledispatch` decorator should not be used on methods
+PLE1519 [*] `@singledispatch` decorator should not be used on methods
+ --> singledispatch_method.py:10:5
|
9 | class Board:
10 | @singledispatch # [singledispatch-method]
- | ^^^^^^^^^^^^^^^ PLE1519
+ | ^^^^^^^^^^^^^^^
11 | @classmethod
12 | def convert_position(cls, position):
|
- = help: Replace with `@singledispatchmethod`
+help: Replace with `@singledispatchmethod`
ℹ Unsafe fix
7 7 |
@@ -21,16 +22,17 @@ singledispatch_method.py:10:5: PLE1519 [*] `@singledispatch` decorator should no
12 12 | def convert_position(cls, position):
13 13 | pass
-singledispatch_method.py:15:5: PLE1519 [*] `@singledispatch` decorator should not be used on methods
+PLE1519 [*] `@singledispatch` decorator should not be used on methods
+ --> singledispatch_method.py:15:5
|
13 | pass
14 |
15 | @singledispatch # [singledispatch-method]
- | ^^^^^^^^^^^^^^^ PLE1519
+ | ^^^^^^^^^^^^^^^
16 | def move(self, position):
17 | pass
|
- = help: Replace with `@singledispatchmethod`
+help: Replace with `@singledispatchmethod`
ℹ Unsafe fix
12 12 | def convert_position(cls, position):
@@ -42,16 +44,17 @@ singledispatch_method.py:15:5: PLE1519 [*] `@singledispatch` decorator should no
17 17 | pass
18 18 |
-singledispatch_method.py:23:5: PLE1519 [*] `@singledispatch` decorator should not be used on methods
+PLE1519 [*] `@singledispatch` decorator should not be used on methods
+ --> singledispatch_method.py:23:5
|
21 | pass
22 |
23 | @singledispatch # [singledispatch-method]
- | ^^^^^^^^^^^^^^^ PLE1519
+ | ^^^^^^^^^^^^^^^
24 | @staticmethod
25 | def do(position):
|
- = help: Replace with `@singledispatchmethod`
+help: Replace with `@singledispatchmethod`
ℹ Unsafe fix
20 20 | def place(self, position):
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1520_singledispatchmethod_function.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1520_singledispatchmethod_function.py.snap
index 36b591bc45..07d807862a 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1520_singledispatchmethod_function.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1520_singledispatchmethod_function.py.snap
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-singledispatchmethod_function.py:4:1: PLE1520 [*] `@singledispatchmethod` decorator should not be used on non-method functions
+PLE1520 [*] `@singledispatchmethod` decorator should not be used on non-method functions
+ --> singledispatchmethod_function.py:4:1
|
4 | @singledispatchmethod # [singledispatchmethod-function]
- | ^^^^^^^^^^^^^^^^^^^^^ PLE1520
+ | ^^^^^^^^^^^^^^^^^^^^^
5 | def convert_position(position):
6 | pass
|
- = help: Replace with `@singledispatch`
+help: Replace with `@singledispatch`
ℹ Unsafe fix
1 |-from functools import singledispatchmethod
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap
index c57a96cd09..1b6adf6316 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap
@@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
-snapshot_kind: text
---
-yield_from_in_async_function.py:7:5: PLE1700 `yield from` statement in async function; use `async for` instead
+PLE1700 `yield from` statement in async function; use `async for` instead
+ --> yield_from_in_async_function.py:7:5
|
5 | async def fail():
6 | l = (1, 2, 3)
7 | yield from l
- | ^^^^^^^^^^^^ PLE1700
+ | ^^^^^^^^^^^^
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap
index 8d11a86388..18356831d7 100644
--- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap
+++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap
@@ -1,41 +1,42 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
-bidirectional_unicode.py:2:1: PLE2502 Contains control characters that can permit obfuscated code
+PLE2502 Contains control characters that can permit obfuscated code
+ --> bidirectional_unicode.py:2:1
|
1 | # E2502
2 | print("שלום")
- | ^^^^^^^^^^^^^ PLE2502
+ | ^^^^^^^^^^^^^
3 |
4 | # E2502
-5 | example = "x" * 100 # "x" is assigned
|
-bidirectional_unicode.py:5:1: PLE2502 Contains control characters that can permit obfuscated code
+PLE2502 Contains control characters that can permit obfuscated code
+ --> bidirectional_unicode.py:5:1
|
4 | # E2502
5 | example = "x" * 100 # "x" is assigned
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 | # E2502
-8 | if access_level != "none": # Check if admin ' and access_level != 'user
|
-bidirectional_unicode.py:8:1: PLE2502 Contains control characters that can permit obfuscated code
+PLE2502 Contains control characters that can permit obfuscated code
+ --> bidirectional_unicode.py:8:1
|
7 | # E2502
8 | if access_level != "none": # Check if admin ' and access_level != 'user
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | print("You are an admin.")
|
-bidirectional_unicode.py:14:1: PLE2502 Contains control characters that can permit obfuscated code
+PLE2502 Contains control characters that can permit obfuscated code
+ --> bidirectional_unicode.py:14:1
|
12 | # E2502
13 | def subtract_funds(account: str, amount: int):
14 | """Subtract funds from bank account then """
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE2502
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | return
16 | bank[account] -= amount
-17 | return
|
diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters.py.snap
index d9f3c78c2dc1089a5ee387bd11d39453191cad71..f2bd3e976d087c3c8d7fbba733eb2708f640e92c 100644
GIT binary patch
delta 383
zcmZ1@|3q$r_2kpMZY;XGb_$c%@rtn+np&AnoK-HyWoV{QqmZOvtB|JtXhMfNmx6*q
z4cFvCPL;_w`FJO%GJZnQ2UKol4psA!QDpK3CXGqVvT)_W%qLNlvznS(85vHlVcEpS
zWeT*2Yw}+