Use Annotation::tags instead of hardcoded rule matching in ruff server#20565
Use Annotation::tags instead of hardcoded rule matching in ruff server#20565MichaReiser merged 3 commits intoastral-sh:mainfrom
Annotation::tags instead of hardcoded rule matching in ruff server#20565Conversation
|
MichaReiser
left a comment
There was a problem hiding this comment.
Thank you
The changes in the diagnostic generation code look correct to me but we also need to set the tags when creating the F401, F841, and RUF059 diagnostics, similar to how we do it for deprecated in ty
That also makes me believe that you used the Ruff version bundled with VS code (or local to your project) when testing the change.
To test the change, set the ruff.path setting in VS Code to <ruff_repository>/target/debug/ruff. You then need to build ruff with cargo build --bin ruff and restart (or reload) VS Code.
There are two things you can do to verify your test setup is working as expected:
- Add a
tracing::warn!("Hy from Ruff");to thetagsfunction. You should see this message in Ruff's output panel (if it is using the correct version) - F401 etc. shouldn't be highlighted as
Unnecessarywith the version from this PR.
|
Thanks for the tips, I'll try these out today! |
|
I was able to test it out with the config you suggested and added the tags in. Let me know if it looks good and if you get the same results! |
|
Thank you. This is looking great. |
Summary
Fixes #20532
Test Plan
Tested the specific rules by creating a test file, verified the rules are still identified