-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Diagnostics use one based cell indices:
/home/micha/astral/test/test-notebook.ipynb:cell 1:2:8: F401 [*] `math` imported but unused
/home/micha/astral/test/test-notebook.ipynb:cell 5:1:8: F811 Redefinition of unused `random` from line 1
/home/micha/astral/test/test-notebook.ipynb:cell 5:2:8: F401 [*] `pprint` imported but unused
/home/micha/astral/test/test-notebook.ipynb:cell 7:2:4: F632 [*] Use `==` to compare constant literals
/home/micha/astral/test/test-notebook.ipynb:cell 7:3:38: F632 [*] Use `==` to compare constant literals
Found 5 errors.
[*] 4 potentially fixable with the --fix option.
Diffs use zero based cell indices
--- /home/micha/astral/test/test-notebook.ipynb:cell 0
+++ /home/micha/astral/test/test-notebook.ipynb:cell 0
@@ -1,2 +1 @@
-import random
-import math
+import random
--- /home/micha/astral/test/test-notebook.ipynb:cell 4
+++ /home/micha/astral/test/test-notebook.ipynb:cell 4
@@ -1,4 +1,3 @@
import random
-import pprint
random.randint(10, 20)
--- /home/micha/astral/test/test-notebook.ipynb:cell 6
+++ /home/micha/astral/test/test-notebook.ipynb:cell 6
@@ -1,3 +1,3 @@
foo = 1
-if foo is 2:
- raise ValueError(f"Invalid foo: {foo is 1}")
+if foo == 2:
+ raise ValueError(f"Invalid foo: {foo == 1}")
Would fix 4 errors.
Expected
The indices to be consistent between diagnostics and the diff mode. I'm leaning towards one based indices because that's what we use for row/column too.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working