-
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
SyntaxError is unable to return code on Linux #12271
Comments
I suspect that you're using two different Ruff versions. Can you try running |
@MichaReiser oh!you're right,my local version on MacOS is 0.4.9 (though I have the same pyproject.toml), But why is it that there is no code in higher versions instead |
This has been changed as part of 0.5. For more details, see the announcement blog post. Do you have a specific use for the error code? |
@MichaReiser |
Yeah, I think I should've added something around the fact that the type of |
This change breaks the Sublime Text plugin which assumed "code: str". kaste/SublimeLinter-contrib-ruff#2 This is easy to fix and I have to anyway but in Sublime Text the "rule name" aka "code" actually matters as the "diagnostics" can be styled per linter name, per error-type ("severity"), and per rule-name. E.g. I literally use a bomb icon for E999 errors. (Why is that an Optional[str] anyway. If I do |
You can find some context in the blog post and some discussion in the original PR but the tldr is that the rule itself is deprecated i.e., |
"SyntaxError", ""code": null", "linux", "Debian"
I run the same code on MacOS and Linux(Debian GNU/Linux 10 (buster)), with the cmd:
ruff version 0.5.1
The code in the test.py is any Python code that may cause syntax errors, such as:
the output on linux is:
but on MacOS,the output is:
I can't understand why the output is different (especially if one code field has a value and the other doesn't)
The text was updated successfully, but these errors were encountered: