Skip to content

Commit d2c9f74

Browse files
committed
Readd accidentally removed snapshots
1 parent 60406b1 commit d2c9f74

5 files changed

+213
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
source: crates/ruff_linter/src/linter.rs
3+
---
4+
isort.ipynb:cell 1:1:1: I001 [*] Import block is un-sorted or un-formatted
5+
|
6+
1 | / from pathlib import Path
7+
2 | | import random
8+
3 | | import math
9+
| |___________^ I001
10+
|
11+
= help: Organize imports
12+
13+
Safe fix
14+
1 |+import math
15+
2 |+import random
16+
1 3 | from pathlib import Path
17+
2 |-import random
18+
3 |-import math
19+
4 4 | from typing import Any
20+
5 5 | import collections
21+
6 6 | # Newline should be added here
22+
23+
isort.ipynb:cell 2:1:1: I001 [*] Import block is un-sorted or un-formatted
24+
|
25+
1 | / from typing import Any
26+
2 | | import collections
27+
| |__________________^ I001
28+
3 | # Newline should be added here
29+
4 | def foo():
30+
|
31+
= help: Organize imports
32+
33+
Safe fix
34+
1 1 | from pathlib import Path
35+
2 2 | import random
36+
3 3 | import math
37+
4 |+import collections
38+
4 5 | from typing import Any
39+
5 |-import collections
40+
6 |+
41+
7 |+
42+
6 8 | # Newline should be added here
43+
7 9 | def foo():
44+
8 10 | pass
45+
46+
isort.ipynb:cell 3:1:1: I001 [*] Import block is un-sorted or un-formatted
47+
|
48+
1 | / from pathlib import Path
49+
2 | | import sys
50+
| |__________^ I001
51+
3 |
52+
4 | %matplotlib \
53+
|
54+
= help: Organize imports
55+
56+
Safe fix
57+
6 6 | # Newline should be added here
58+
7 7 | def foo():
59+
8 8 | pass
60+
9 |+import sys
61+
9 10 | from pathlib import Path
62+
10 |-import sys
63+
11 11 |
64+
12 12 | %matplotlib \
65+
13 13 | --inline
66+
67+
isort.ipynb:cell 3:7:1: I001 [*] Import block is un-sorted or un-formatted
68+
|
69+
5 | --inline
70+
6 |
71+
7 | / import math
72+
8 | | import abc
73+
| |__________^ I001
74+
|
75+
= help: Organize imports
76+
77+
Safe fix
78+
12 12 | %matplotlib \
79+
13 13 | --inline
80+
14 14 |
81+
15 |+import abc
82+
15 16 | import math
83+
16 |-import abc
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
source: crates/ruff_linter/src/linter.rs
3+
---
4+
ipy_escape_command.ipynb:cell 1:5:8: F401 [*] `os` imported but unused
5+
|
6+
3 | %matplotlib inline
7+
4 |
8+
5 | import os
9+
| ^^ F401
10+
6 |
11+
7 | _ = math.pi
12+
|
13+
= help: Remove unused import: `os`
14+
15+
Safe fix
16+
2 2 |
17+
3 3 | %matplotlib inline
18+
4 4 |
19+
5 |-import os
20+
6 5 |
21+
7 6 | _ = math.pi
22+
8 7 | %%timeit
23+
24+
ipy_escape_command.ipynb:cell 2:2:8: F401 [*] `sys` imported but unused
25+
|
26+
1 | %%timeit
27+
2 | import sys
28+
| ^^^ F401
29+
|
30+
= help: Remove unused import: `sys`
31+
32+
Safe fix
33+
6 6 |
34+
7 7 | _ = math.pi
35+
8 8 | %%timeit
36+
9 |-import sys
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
source: crates/ruff_linter/src/linter.rs
3+
---
4+
undefined_name.ipynb:cell 3:1:7: F821 Undefined name `undefined`
5+
|
6+
1 | print(undefined)
7+
| ^^^^^^^^^ F821
8+
|
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
source: crates/ruff_linter/src/linter.rs
3+
---
4+
unused_variable.ipynb:cell 1:2:5: F841 [*] Local variable `foo1` is assigned to but never used
5+
|
6+
1 | def f():
7+
2 | foo1 = %matplotlib --list
8+
| ^^^^ F841
9+
3 | foo2: list[str] = %matplotlib --list
10+
|
11+
= help: Remove assignment to unused variable `foo1`
12+
13+
Unsafe fix
14+
1 1 | def f():
15+
2 |- foo1 = %matplotlib --list
16+
2 |+ %matplotlib --list
17+
3 3 | foo2: list[str] = %matplotlib --list
18+
4 4 | def f():
19+
5 5 | bar1 = !pwd
20+
21+
unused_variable.ipynb:cell 1:3:5: F841 [*] Local variable `foo2` is assigned to but never used
22+
|
23+
1 | def f():
24+
2 | foo1 = %matplotlib --list
25+
3 | foo2: list[str] = %matplotlib --list
26+
| ^^^^ F841
27+
|
28+
= help: Remove assignment to unused variable `foo2`
29+
30+
Unsafe fix
31+
1 1 | def f():
32+
2 2 | foo1 = %matplotlib --list
33+
3 |- foo2: list[str] = %matplotlib --list
34+
3 |+ %matplotlib --list
35+
4 4 | def f():
36+
5 5 | bar1 = !pwd
37+
6 6 | bar2: str = !pwd
38+
39+
unused_variable.ipynb:cell 2:2:5: F841 [*] Local variable `bar1` is assigned to but never used
40+
|
41+
1 | def f():
42+
2 | bar1 = !pwd
43+
| ^^^^ F841
44+
3 | bar2: str = !pwd
45+
|
46+
= help: Remove assignment to unused variable `bar1`
47+
48+
Unsafe fix
49+
2 2 | foo1 = %matplotlib --list
50+
3 3 | foo2: list[str] = %matplotlib --list
51+
4 4 | def f():
52+
5 |- bar1 = !pwd
53+
5 |+ !pwd
54+
6 6 | bar2: str = !pwd
55+
56+
unused_variable.ipynb:cell 2:3:5: F841 [*] Local variable `bar2` is assigned to but never used
57+
|
58+
1 | def f():
59+
2 | bar1 = !pwd
60+
3 | bar2: str = !pwd
61+
| ^^^^ F841
62+
|
63+
= help: Remove assignment to unused variable `bar2`
64+
65+
Unsafe fix
66+
3 3 | foo2: list[str] = %matplotlib --list
67+
4 4 | def f():
68+
5 5 | bar1 = !pwd
69+
6 |- bar2: str = !pwd
70+
6 |+ !pwd
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
source: crates/ruff_linter/src/linter.rs
3+
---
4+
vscode_language_id.ipynb:cell 3:1:8: F401 [*] `os` imported but unused
5+
|
6+
1 | import os
7+
| ^^ F401
8+
2 |
9+
3 | print("hello world")
10+
|
11+
= help: Remove unused import: `os`
12+
13+
Safe fix
14+
1 |-import os
15+
2 1 |
16+
3 2 | print("hello world")

0 commit comments

Comments
 (0)