Skip to content

VS Code formatOnSave changes by Darker leads to file conflicts #525

Answered by Ashblaze
kedhammar asked this question in Q&A
Discussion options

You must be logged in to vote

@kedhammar It might be worth making this an issue, so that there is a proper fix from darker. Also, pasting my workaround from the other discussion post.

As a workaround, it is possible to use "Run on Save" or "emeraldwalk" extension from the VSCode Marketplace to automatically trigger darker.

Steps:

  1. Set "Default Formatter" as "None" in your VS Code settings.
  2. Uncheck "Format on Save" (OR) remove/disable Black (and all other) formatter extension from VS Code.
  3. Install extension "Run on Save" (emeraldwalk) from marketplace.
  4. Add darker executable's folder location to system path.
  5. Add the following to settings.json (you can modify this to suit your needs):
"emeraldwalk.runonsave": {
    "com…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@kedhammar
Comment options

Answer selected by kedhammar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants