-
Notifications
You must be signed in to change notification settings - Fork 64
Description
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:
ex/
├── .ruff.toml
├── sub
│ ├── .ruff.toml
│ ├── test.py
│ └── foo
│ └── test.py
└── test.py
Where the test.py
files are filled with
print("That's a pretty long long long long long long long long long long long long long long long long long long long long long long line")
-> cat ex/.ruff.toml
target-version = "py312"
line-length = 120
extend-exclude = [
"sub",
]
-> cat ex/sub/.ruff.toml
target-version = "py312"
line-length = 120
extend-exclude = [
"foo",
]
What I get:
- 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