astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not detecting variable from previous notebook cells

sh-shahrokhi opened this issue · comments

Hi, I'm using ruf-vscode 2023.50.0, ruff 0.1.6, vscode 1.84.2 on Windows 11.
In juoyter notebooks, ruff can't see variables from previous cells.

image

Ruff extension is set as default python formatter/linter.

Simple code for replication:

colors = ['red', 'orange', 'green', 'blue', 'purple']

in another cell:

colors2 = colors + ['black']

Thanks

Hey, thanks for opening this issue. This is happening because colors is possibly a magic command. For more context, refer astral-sh/ruff#8526. I'll close this one in favor of the linked issue.