Zac-HD / shed

`shed` canonicalises Python code. Shed your legacy, stop bikeshedding, and move on. Black++
https://pypi.org/project/shed/
GNU Affero General Public License v3.0
342 stars 23 forks source link

VSCode auto-format using shed #30

Closed tclasen closed 2 years ago

tclasen commented 2 years ago

Current I'm using black to auto-format my code on save when using VSCode, there is a setting in .vscode/settings.json here you specify the path to the black binary if it isn't in your path. I tried the following, but it doesn't work as I had hoped it to:

"python.formatting.blackPath": "./.venv/bin/shed",
"python.formatting.provider": "black",

Is there another way to hook up shed to VSCode or is there possibly a way for my above example to work?

Zac-HD commented 2 years ago

I'd recommend using black to format on save, and setting up shed to run when you commit or push - removing "unused" imports when you save - just before using them - isn't really that helpful!

Zac-HD commented 2 years ago

If you want to shed-on-save anyway go ahead, but I don't know how to set that up sorry.