wbolster / emacs-python-black

Emacs package to reformat Python using black-macchiato
BSD 3-Clause "New" or "Revised" License
95 stars 11 forks source link

add optional blackd support #8

Closed satyajeet-sundial closed 2 years ago

satyajeet-sundial commented 2 years ago

right now, running black on every save can be slow.

black has an optional add-on through pip install black[d] which runs a small server and can be faster than spawning a new process everytime.

https://black.readthedocs.io/en/stable/usage_and_configuration/black_as_a_server.html

emacs-python-black could support this interface in addition to calling the black program for faster formatting.

wbolster commented 2 years ago

hi, thanks for you message.

i can see how this may be useful, but the added complexity needed for this is way more than i would like in this (trivial by design) emacs package. it would mean moving away from reformatter.el, which i don't want to since it's great, or writing a custom executable (and dealing with the complexity of installing and running that), because, as the page you linked to, notes:

There is no official blackd client tool (yet!).

so at this point i lean towards ‘wontfix’ for this.

satyajeet-sundial commented 2 years ago

@wbolster alright, you're right in that the black command should automatically "know" if a daemon is running and use that instead of doing the formatting itself.