-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
lint.per-file-ignores
option is ignored by the new language server
#11751
Comments
I think you have a typo: |
oh oops! weird though because the old language server and the cli both seem to work with that glob |
fixing that typo doesn't seem to work for me. it seems that the new lsp is only seeing the name of the file, but not the full path. |
I'm not sure we can do. In the [tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["F401"] And |
i think it's because that repo does not use the new language server. adding the same thing to |
Not for me... I have it enabled in my user settings, and I've verified that it's running via the logging. Could you be using an old Ruff version? There were some early versions of the native server that didn't support this. |
according to the vscode extension log it's using 0.4.8:
maybe it only happens on windows? i'm on windows 10, let me know if you need any more info |
I will try it on Windows, perhaps there's a difference there. |
Ok, I can successfully reproduce this on Windows. |
So the LSP file paths are now like:
But the resolved ignore patterns are like:
|
## Summary As-is, we're using the URL path for all files, leading us to use paths like: ``` /c%3A/Users/crmar/workspace/fastapi/tests/main.py ``` This doesn't match against per-file ignores and other patterns in Ruff configuration. This PR modifies the LSP to use the real file path if available, and the virtual file path if not. Closes #11751. ## Test Plan Ran the LSP on Windows. In the FastAPI repo, added: ```toml [tool.ruff.lint.per-file-ignores] "tests/**/*.py" = ["F401"] ``` And verified that an unused import was ignored in `tests` after this change, but not before.
when enabling the new
ruff.nativeServer
setting in vscode, it seems to ignoretool.ruff.lint.per-file-ignores
The text was updated successfully, but these errors were encountered: