-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid syntax error location for Notebook with ruff format
#11453
Comments
Are you able to share the raw notebook file? |
I figured it out, right down the bottom there was as cell I missed containing
Which is clearly invalid - it's actually a fragment of a uri I added at some stage to test something and I should have set the cell to markdown or commented it out. The linter was flagging as an error, I guess the only real issue is the message is a bit cryptic, ideally |
Thanks for the details. So, yeah the
I can look into it. |
ruff format
Note the |
I meant that the output in the CLI does provide the correct cell number: $ ruff check ~/playground/ruff/notebooks/syntax_error.ipynb
error: Failed to parse /Users/dhruv/playground/ruff/notebooks/syntax_error.ipynb:4:1:5: Invalid decimal integer literal
/Users/dhruv/playground/ruff/notebooks/syntax_error.ipynb:cell 4:1:5: E999 SyntaxError: Invalid decimal integer literal Regarding the VS Code problems tab, I don't know if that's even possible. I'll need to look into it. |
Ah right yeah, I don't think it's an issue in the vs code tab, as I mentioned you can click to jump to the problem anyway |
I'm getting the error
error: Failed to parse notebooks/tickets v2.ipynb:1:1:5: Invalid decimal integer literal
when I runruff format .
on a project (previously I was using whatever the default vscode formatter is).I assume the :1:1:5 is a reference to a cell but I cannot parse it, does that mean cell 1, line 1 column 5? And is it 0 or 1 based - either way the message doesn't help as the first cell contains
and the second
Also
pre-commit
doesn't seem to complain, not doesformat on save
(vscode setting) which I've configured to use Ruff as the default formatter, it's only when I try and format from the cmd line. I tried escaping the space with\
and surrounding the filename with " "I'm using ruff 0.4.4 (global pipx installation) and my settings are:
The text was updated successfully, but these errors were encountered: