-
Notifications
You must be signed in to change notification settings - Fork 49
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
Ruff Crashes with ValueError #132
Comments
Thanks for the trace! |
This is probably a bug in Ruff. Will look into it. |
Are you able to share the file contents? |
It seems to be an issue with VS Code integration. I updated the traceback to include all of the info. The file empty.py is literally empty. |
I think I have pretty much the same problem. When I have Ruff activated and try to save any file, all the code in that file gets deleted and I get this error:
I also described it in issue #58 , but that issue derailed a bit and was closed. |
I fixed one thing in Ruff that could be the cause of this. It would've gone out in 0.0.248. |
I just tried out the pre-release version and the LSP server doesn't crash anymore. 👍 However now I'm getting the following errors on every file:
Also I still have the problem that when I try to save a file, all the code in it gets deleted. ...is this a separate issue? |
Yeah I figured this was what was happening -- that there was some kind of IO error, and Ruff was returning a bad value for that error, which was causing the server to crash. Now, at least, we can see the error without the LSP crashing. |
(So we can keep this open.) |
Just tried it again after a while and it doesn't crash anymore! 😃 There's still the problem, that it deletes the entire contents of the file when I save, but I was able to get around that by disabling the "organize imports" option. 👍 |
I am encountering the same error for ruff==0.3.7 python --version is 3.11
Is there any fix? |
What you likely want is Also I don't see how this is related to the original issue? |
`ruff <path>` has been removed. Use `ruff check <path>` instead. astral-sh/ruff-vscode#132
Ruff shows this output in VS Code.
The text was updated successfully, but these errors were encountered: