How to ignore ruff errors in jupyter notebook in VSCode?

236 Views Asked by At

I am using ruff to lint and format my Python code in Visual Studio Code. I also work often with jupyter notebooks inside VSCode. When I do that I get some ruff linting errors that don't really make sense in a notebook such as Module level import not at top of cell:

In a Python file, this warning certainly makes sense, but not really in a notebook. I couldn't find how I could silence these warnings for notebooks specifically. There are no ruff settings related to notebooks and I couldn't find how to apply settings specifically to jupyter notebooks. Does somebody know how to silence these warnings inside a notebook in VSCode?

0

There are 0 best solutions below