koxudaxi / ruff-pycharm-plugin

PyCharm plugin for ruff. This plugin provides reformat code using ruff.
MIT License
222 stars 10 forks source link

Reformat code doesn't work #512

Closed stallam-unb closed 1 month ago

stallam-unb commented 2 months ago

Describe the bug Ctrl+Alt+L no longer appears to format code since update 0.0.40. Running ruff format in a terminal however does work as intended.

To Reproduce Steps to reproduce the behavior:

  1. Open any file.
  2. Press Ctrl+Alt+L.
  3. Only default PyCharm stuff works.

Expected behavior Ruff should auto format code.

Screenshots Environments (please complete the following information):

nickymarino commented 2 months ago

This might be the same problem as #424 -- I was able to follow the advice there to enable "Use ruff format(Experimental) for version 0.0.289 or later" in PyCharm Settings > Tools > Ruff, and that fixed this problem for me

stallam-unb commented 2 months ago

This might be the same problem as #424 -- I was able to follow the advice there to enable "Use ruff format(Experimental) for version 0.0.289 or later" in PyCharm Settings > Tools > Ruff, and that fixed this problem for me

It is already enabled for me and it still doesn't work.

gromsterus commented 1 month ago

I have a similar problem.

  1. Code example image

  2. Do Reformat Code (ruff check --fix worked well, but ruff format did not) image

  3. If I do File -> Reload All From Disk image

IDE: PyCharm 2024.2.3 (Professional Edition) OS: macOS Ruff Version: 0.6.9 Plugin version: 0.0.40

Plugin settings image

fadhely commented 1 month ago

Does it work if you uncheck Enable Ruff LSP feature ?

gromsterus commented 1 month ago

@fadhely no, it doesn't work :(

stallam-unb commented 1 month ago

It seems like @koxudaxi released v0.0.41 recently, and now seems to has fixed the issue for me. Thanks!

I will close the issue now, but if anyone else in this thread still has this problem, let me know and I will reopen the issue.

koxudaxi commented 1 month ago

@stallam-unb Yes, Thank you for creating and closing this issue. I removed the broken version from the store. but I didn't check the issue. sorry.