Open shunichironomura opened 1 month ago
Thanks for preparing a way for us to reproduce this very easily! It really helps.
This seems like a bug. I can look at it later today.
Ok, if I remove the ruff.configuration
settings from a.code-workspace
, then it works correctly.
"settings": {
"ruff.configuration": "${workspaceFolder:root}/ruff.toml"
}
I'm curious as to why do you want to specify the ruff.configuration
setting as it's going to be taken by default even if you don't specify it.
In my actual codebase, specifying the ruff.configuration
setting makes the extension show some rule (I001
to be specific) correctly in the editor (maybe it's another, related bug). I tried to make a minimal reproducible example but I couldn't.
Description
When working in Multi-root Workspaces in Visual Studio Code, whether
lint.per-file-ignores
takes effect depends on the file pattern.The extension settings are all set to defaults, except for the
ruff.configuration
.Reproduction
Set-up
Follow the steps below or clone https://github.com/shunichironomura/ruff-vscode-ws
(EDIT: Fixed the structure by adding the
subfolder/
)a.code-workspace
:b/a.py
andt/a.py
(both have the same contents):ruff.toml
:code a.code-workspace
Expected behavior
ruff check .
in the root results in reporting no error.b/a.py
andt/a.py
), no error is shown in the editor.Actual behavior
ruff check .
in the root results in reporting no error. (As expected)F401
is not shown inb/a.py
, but is shown int/a.py
. (Unexpected)Environment