I have a backend API package which I have been working with in VSCode for some time. uv run python -m ruff check passes cleanly in the shell. I have ruff version 0.11.13 installed and locked in my uv lock file. Opening files in VSCode shows the same errors seen in the shell.
I recently switched to opening both my backend API package and frontend package at the same time in a single VSCode "Workspace". This resulted in new errors being shown in VSCode even though the same file still showed no errors in the shell. One of the new errors was https://docs.astral.sh/ruff/rules/import-outside-top-level/
My Ruff VSCode version is 2025.32.0 which bundles ruff version v0.14.8.
I think the root cause is that when I'm only opening my backend API package the Ruff extension uses the correct Ruff binary which has been installed in that project, but when I open the same package within a VSCode "Workspace" the Ruff extension no longer finds the installed Ruff version and falls back to the bundled newer version which applies a different set of rules.
I think the "Ruff: Interpreter - Path to a Python interpreter to use to find the ruff executable." (ruff.interpreter) setting looks like it would have fixed this for me.
I am instead upgrading my ruff binary and getting my codebase / config into a clean state with the latest ruff.
I'm cutting this ticket mainly as a breadcrumb for anybody else who runs into this issue.
I have a backend API package which I have been working with in VSCode for some time.
uv run python -m ruff checkpasses cleanly in the shell. I have ruff version0.11.13installed and locked in my uv lock file. Opening files in VSCode shows the same errors seen in the shell.I recently switched to opening both my backend API package and frontend package at the same time in a single VSCode "Workspace". This resulted in new errors being shown in VSCode even though the same file still showed no errors in the shell. One of the new errors was https://docs.astral.sh/ruff/rules/import-outside-top-level/
My Ruff VSCode version is 2025.32.0 which bundles ruff version v0.14.8.
I think the root cause is that when I'm only opening my backend API package the Ruff extension uses the correct Ruff binary which has been installed in that project, but when I open the same package within a VSCode "Workspace" the Ruff extension no longer finds the installed Ruff version and falls back to the bundled newer version which applies a different set of rules.
I think the "Ruff: Interpreter - Path to a Python interpreter to use to find the ruff executable." (ruff.interpreter) setting looks like it would have fixed this for me.
I am instead upgrading my ruff binary and getting my codebase / config into a clean state with the latest ruff.
I'm cutting this ticket mainly as a breadcrumb for anybody else who runs into this issue.