grantjenks / blue

The slightly less uncompromising Python code formatter.
https://blue.readthedocs.io/
Other
393 stars 21 forks source link

Doc: how to use blue with vscode? #95

Open maphew opened 1 year ago

maphew commented 1 year ago

How to use blue with Visual Studio Code?

I see one closed ticket with vscode asking for it to be added as an extension, however it should be simple to use or adapt the existing black formatter to use blue instead, yes? Maybe it's only a documentation change.

maphew commented 1 year ago

Draft

  1. Install blue e.g. pipx install blue

Within vscode:

  1. Install Black Formatter extension (ctrl-shift-x >> black formatter >> install)
  2. Configure extension (click gear cog)
  3. Change "Black formatter path" setting to where blue executable is. On Windows if installed with hatch it will be in %userprofile%\.local\bin\blue.exe