-
-
Notifications
You must be signed in to change notification settings - Fork 10
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 does not format the code after ctrl+alt+l (almost always) #531
Comments
I have run into the same issue with plugin verion 0.0.42 and ruff version 0.7.1. To get the ruff plugin to format the code I need to press Ctrl-Alt-L at least 3 times in succession. There are no warnings or errors, but that is the only way to make it format. |
Got the same issue
|
Sorry for the late confirmation. IDE: PyCharm Pro 2024.3.1 #PY-243.22562.220 As @jaens pointed out, the |
We initially treated format as an experimental option, but if this is going to be used by everyone, it might be better to turn it on by default. Please comment if the formatting does not take place even after enabling this format option. I also have a windows environment, so I will try that as well. |
Formatting is important for me. It would be nice for me to make it enabled by default! :) I have enabled formatting in every project. |
I also tested it in windows. It works fine. PyCharm 2024.3.1.1 (Professional Edition) |
With the latest update it works on the first time for me now as well, I was one of the previous commenters with issues I would vote for turning it on be default |
@Olegt0rr def foo(
bar: int,
baz: str,
):
eggs = [
1,
2,
] after enter def foo(
bar: int,
baz: str,
):
eggs = [
1,
2,
] The project doesn't have the any ruff config file like
Which do you use the LSP Client? if you select LSP4IJ when you should install LSP4IJ as a plugin. |
Video with both local and global ruff executable |
@Olegt0rr |
I'm not using any formatters... But just removed all old plugins from IDE and... magic! ruff works Unfortunately, in my emotions I deleted all plugins in a row, both the ones that were turned off and the ones I haven't used in a long time... And now I can't say which one had compatibility problems (which would be useful for those who are experiencing problems) |
When you press ctrl alt L or in other words, launch code reformat even with a button from the menu, the code is not formatted, almost always (if it is, I return everything back ctrl + z several times and the bug manifests itself). I found a specific behavior when I quickly press ctrl + alt + L several times in a row, after that the code is formatted. And if you format it with expectation, it is not formatted. Also, I have assigned ruff to alt shift f and by this combination the formatting is triggered every time. I also tried all ruff settings (global ruf, lsp), turned off all third-party plugins
Screenshots
The text was updated successfully, but these errors were encountered: