Skip to content
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

Ruff's VSCode extension doesn't recongnize terminal command executions in jupyter notebooks #16484

Open
juanbfactored opened this issue Mar 3, 2025 · 2 comments
Labels
question Asking for support or clarification

Comments

@juanbfactored
Copy link

Summary

The ruff linter VS Code extension assigns syntax errors to any line using the terminal magic of "!" in any Jupyter notebook cell. For example, if I have a cell like this:

!brew install ruff

The extension will highlight this line and tell me I have a syntax error. For more reference see the image below

Image

Version

2025.14.0

@ntBre
Copy link
Contributor

ntBre commented Mar 4, 2025

Is this in an unsaved file/buffer possibly? I'm looking at the filename ruff_demo.ipynb#..... and thinking the bit after # may be confusing our file type detection.

I'm not able to reproduce this with a regular filename like try.ipynb.

@ntBre ntBre added the question Asking for support or clarification label Mar 4, 2025
@juanbfactored
Copy link
Author

juanbfactored commented Mar 4, 2025

It is not an unsaved file or buffer. I cloned a repo and opened this notebook in VS Code. To make sure it wasn't related to any issues with the file, I closed the tab with the notebook, quit VS Code, and reopened it. The error is still there.

Additionally, I created another notebook test.ipynb and the same incorrect error was highlighted when I opened it in VS Code.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

2 participants