You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a complex project, with submodules, with different settings and the meta project excludes the sub ones with extend-exclude. We use it so that CI only care about its repository but while developing we do use the whole collection of repo, even when developing in submodules.
As excluding sub project is an intended behavior, I opened sub projects as new folder in the workspace, awaiting it to force include the sub directories, but it doesn't work as I intended.
The closest issue I found is #414, except this time it is for a whole child folder opened in a workspace.
formatting temp/sub/foo/test.py does nothing as expected
formatting temp/test.py break the long line as expected
formatting temp/sub/test.py does nothing instead of breaking the line
In the extension output I get (I changed my home to <$HOME> for privacy):
DEBUG main ruff_server::session::index::ruff_settings: Indexing settings for workspace: <$HOME>/ex
2025-05-14 10:05:51.825783382 DEBUG ThreadId(04) ruff_server::session::index::ruff_settings: Loaded settings from: `<$HOME>/ex/.ruff.toml` for `<$HOME>/ex`
2025-05-14 10:05:51.825915250 DEBUG ThreadId(04) ruff_server::session::index::ruff_settings: Ignored path via `extend-exclude`: <$HOME>/ex/sub
2025-05-14 10:05:51.826834994 INFO main ruff_server::session::index: Registering workspace: <$HOME>/ex
2025-05-14 10:05:51.826868981 DEBUG main ruff_server::session::index::ruff_settings: Indexing settings for workspace: <$HOME>/ex/sub
2025-05-14 10:05:51.827300462 DEBUG main ruff_server::session::index::ruff_settings: Loaded settings from: `<$HOME>/ex/.ruff.toml`
2025-05-14 10:05:51.827922641 DEBUG ThreadId(16) ruff_server::session::index::ruff_settings: Ignored path via `extend-exclude`: <$HOME>/ex/sub
2025-05-14 10:05:51.830188073 INFO main ruff_server::session::index: Registering workspace: <$HOME>/ex/sub
2025-05-14 10:05:51.836248830 INFO ruff:main ruff_server::server: Configuration file watcher successfully registered
It seems to me a bug occurs right after the Indexing settings for workspace: <$HOME>/ex/sub, I feel like the intended behavior would be loading ex/sub/.ruff.toml.
Also feel free to edit the title I struggle to find a representative one
The text was updated successfully, but these errors were encountered:
Thanks for the detailed write up. I think this is working as intended for performance reasons.
Ruff tries to skip over directories that are excluded. For example, ruff skips over .venv and it won't show any lint warnings even if there's a ruff.toml in one of the packages that you installed (there shouldn't be any but there could).
What you're asking for would require ruff to always walk the entire directory tree because, maybe, there's some .ruff.toml somewhere. This would be very expensive because folders like .venv tend to contain many files.
Ruff's behavior here is consistent with git's where you can't unignore files in a previously ignored directory because git doesn't traverse the directory (for performance reasons).
You could make use of VS code's multi folder feature and adding individual folders (e.g. opening sub explicitly)
Hum there might be a misunderstanding, I get the performance reasons and tried to force include the folder :
As excluding sub project is an intended behavior, I opened sub projects as new folder in the workspace, awaiting it to force include the sub directories, but it doesn't work as I intended.
Except if what you call multi folder feature is different of what I call Workspace ? I must admit that I don't use this kind of feature really often...
But the sequence
2025-05-14 10:05:51.826868981 DEBUG main ruff_server::session::index::ruff_settings: Indexing settings for workspace: <$HOME>/ex/sub
2025-05-14 10:05:51.827300462 DEBUG main ruff_server::session::index::ruff_settings: Loaded settings from: `<$HOME>/ex/.ruff.toml`
Hey,
I'm working on a complex project, with submodules, with different settings and the meta project excludes the sub ones with
extend-exclude
. We use it so that CI only care about its repository but while developing we do use the whole collection of repo, even when developing in submodules.As excluding sub project is an intended behavior, I opened sub projects as new folder in the workspace, awaiting it to force include the sub directories, but it doesn't work as I intended.
The closest issue I found is #414, except this time it is for a whole child folder opened in a workspace.
I've reproduced a minimal exemple to clarify:
Where the
test.py
files are filled with->
cat ex/.ruff.toml
->
cat ex/sub/.ruff.toml
What I get:
temp/sub/foo/test.py
does nothing as expectedtemp/test.py
break the long line as expectedtemp/sub/test.py
does nothing instead of breaking the lineIn the extension output I get (I changed my home to
<$HOME>
for privacy):It seems to me a bug occurs right after the
Indexing settings for workspace: <$HOME>/ex/sub
, I feel like the intended behavior would be loadingex/sub/.ruff.toml
.Also feel free to edit the title I struggle to find a representative one
The text was updated successfully, but these errors were encountered: