Skip to content
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 format deletes code #529

Open
Ragnoroct opened this issue Nov 22, 2024 · 0 comments
Open

ruff format deletes code #529

Ragnoroct opened this issue Nov 22, 2024 · 0 comments

Comments

@Ragnoroct
Copy link

Ragnoroct commented Nov 22, 2024

Describe the bug
ctrl+alt+L deletes my code on format. Same thing happens when it formats on save. I noticed this happening when I first tried the plugin. it was deleting the whole file though. When I tried the plugin again it deleted only my most recent changes to the file.

It was formatting it just fine before

To Reproduce
Steps to reproduce the behavior:

  1. Open editor and a file
  2. Press ctrl+alt+L to format the code. It deletes the most recent code I wrote

Expected behavior
It should format as if I typed ruff format in the terminal without deleting anything it should not.

Screenshots
image

Environments (please complete the following information):

  • IDE: PyCharm Professional 2024.3
  • OS: Ubuntu 22.04
  • Ruff Version: local=0.6.7 global=0.0.272 (I'm assuming it's using local)
  • Plugin version: 0.0.42

Additional context
First time I experienced this it deleted the whole file. Second time it has been only deleting my most recent changes to the file. After a full pycharm restart it still does the same thing.

It has been deleting the whole import code section. It happens pretty consistently. I can't replicate when it happens and when it doesn't.

Is there a way for me to turn on logging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant