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

Support for `jupyter.runStartupCommands`

indrex opened this issue · comments

Environment:

  • VSCode (latest)
  • Jupyter and ruff extensions

Issue:

  • Jupyter allows some commands to be run at startup
  • This can be tested using jupyter.runStartupCommands in VSCode settings
  • If I import a module using this, it is not recognized by ruff
  • It lints the import wondering where did it come from

Expected resolution:

  • Look at the auto imports, or the available namespace variables
  • Allow a setting to let ruff know of such imports?

Example:
import pandas as pd is run at startup
image