Replies: 10 comments 4 replies
-
Hi @agandra, thanks for your report! Which Darker version are you running? Support for VSCode Does Darker apply formatting changes correctly if you run VSCode with a local repository and a local Darker instead of using the Remote Container plugin? Does it work if you explicitly run the |
Beta Was this translation helpful? Give feedback.
-
Pip freeze returns that i'm on darker 1.4.0. I run all my python code through docker containers, but will try to get python working on my local machine to install locally and see if darker works. If i run Format Document manually it formats the entire document correctly. So it appears that for some reason it runs format on save but the actual file doesn't format. But when I do it explicitly it works. |
Beta Was this translation helpful? Give feedback.
-
If you've set up Darker disguising as Black correctly (as it seems from the configuration you pasted), it shouldn't format the entire document, but only the modified lines. So maybe something wrong there as well? |
Beta Was this translation helpful? Give feedback.
-
Sorry, correction on what I previously said. It only formats the diff correctly, does not effect unmodified code. So I think its working properly, it just does not happen on save. |
Beta Was this translation helpful? Give feedback.
-
Ok thanks for the clarification. And sorry for mixing things up: Last week we finally merged another fix for (There was only a partial fix in #215 for version 1.3.2.) You can test the fix in #255 before 1.4.1 is released by installing Darker from GitHub |
Beta Was this translation helpful? Give feedback.
-
In the meanwhile, you can still make the formatter work on save by clicking on save twice. |
Beta Was this translation helpful? Give feedback.
-
@agandra Darker 1.4.1 has now been released and the fix in #255 is there. Thanks again for your report, and let us know if there are still VSCode (or other) issues! |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, it still doesn't work - but now (as a patch of course), sometimes it works when pressing save 3 times instead (or even more)
where the In the second save, less chars a missing (only the the first '/'). |
Beta Was this translation helpful? Give feedback.
-
@mayk0gan, this looks like you've enabled the I guess we could add a warning or a descriptive error message whenever Darker encounters a |
Beta Was this translation helpful? Give feedback.
-
@agandra and @tobiasdiez, do you still have the issue of Darker not reformatting on save in VSCode when using Darker 1.4.1 or newer and making sure no linters are run (either with |
Beta Was this translation helpful? Give feedback.
-
Hey, I have setup my black and darker inside a dev container using the Remote Container plugin on VSCode. However, when I make changes the formatting is not reflected in my codebase. Nothing happens on save even though darker is running. It worked on the entire file when I pointed it at black instead of darker.
Here is my dev container file:
When I look at my output for python when i make changes this is what appears:
If i run in my terminal manually:
I see the output being the file formatted correctly. However, there are is no change happening within the actual code.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions