-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files are excluded when not in the inclusion set #623
Comments
Thanks for the report. I think I know why this might be happening. |
This was introduced in astral-sh/ruff#13326 as the server will always include files that has the Python language id even though it's excluded by way of not including it. Sorry for this, it's a mistake on my end. |
Hmm, I think there are two arguments here:
The behavior as mentioned in (1) is also how other extensions like black work. |
Would it make sense to add a configuration parameter of some sort to choose whether to include all python language id files or to strictly follow the configured include set? I'm fine with the current behavior being the default if that more closely matches the expectations for VSCode extensions, but I'd still like the ability to somehow only use the strict inclusion set. |
I'd need to think about this but the language ID is internal to the language server protocol so the users shouldn't need to worry about it. This functionality might be more similar to how |
I have ruff configured to only run against a certain directory and ignore all others. I've done this via setting the
include
value inpyproject.toml
:This works correctly when I run
ruff format
from the command line - only files in that directory are changed. However, when I save a file in VSCode that should be excluded, formatting is applied.VSCode
settings.json
:I swear I had this working a couple weeks ago, so I'm not sure if some sort of regression was introduced recently or if I somehow didn't test it correctly previously. If I explicitly add other directories to the
exclude
configuration it works, but that's obviously not as flexible as being able to only include a single directory. VSCode extension version isv2024.50.0
, ruff version is0.6.6
.The text was updated successfully, but these errors were encountered: