-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the future of emacs, python, and black #25
Comments
HI, thanks for open this discussion. I was early black adopter and It works for me, so I don't make a lot of attention to it. To be honest I have no experience with I prefer not to break public API, package or options names. I think we can collaborate on the future version of black. There is no reason to increase the entropy of the universe I guess :) Let start with initial PR we can discus. If everything goes fine, I'll grand you collaborator access to the repo. Have a good day, |
hey, thanks for your reply. just wondering, why does my mini |
oh btw, for me personally the ability to reformat partial files (even though that is not ideal) is what made me look into this in the first place. on top of that i like |
ok, i went ahead and played around a little. the result is a working https://github.com/wbolster/emacs-python-black except for minimal configuration, it is a superset of i figured it would be easiest to have a separate package for now. in case you are wondering why it looks complete and polished, that's because i just copy/pasted my i'm interested in hearing your thoughts! |
Looking at your Otherwise this seems useful. Thanks for working on this. |
the implementing my hack again in emacs lisp feels wrong on many levels:
on top of that, |
But that has nothing to do if it is included in this emacs package or as a separate package.
I don't really get this point.
I think this and the last point are one, and what you're saying is that you don't want to reinvent what you already have in elisp. Which is fair enough, but you could put those few lines of code in a string and call them with
Hmm, I guess you would need a custom function then, call your elisp part which creates the temp file and then run black on it like you do in your black-macciato script. Overall I don't mind too much if it's external or internal, just wanted to mention that I (and probably many others) simply wont use this functionality if I first have to do yet another 'pip install..' in my system. |
fwiw, i use it for a while, but never published on melpa, but multiple people are asking for that, so here goes: will close this issue since i consider my problem solved now (albeit by having a ‘competitor’ package). |
I agree that this package should simply use the
I was simply saying that you specifically wrote a python script |
and i, as the author of both, argue it is not that n trivial. while black-macchiato is not extremely complex, it is tricky enough (it evolved in the mean time to handle more corner cases) that having an emacs port of this inherently python-specific logic to emacs lisp is just unnecessary duplication of already completed efforts. on top of that, it is optional and the main mode of operation of |
first of all, thanks for writing this package!
i used
blacken.el
in the past, but i stopped using it recently since i think there are better options available to me… please allow me to explain. :)a while ago i wrote black-macchiato to allow formatting of partial files using
black
. (see also #11.)to integrate
black-macchiato
with emacs, i wrote black-macchiato.el, which currently lives as a private minimalistic emacs package inside my dotfiles.as you can see, it looks rather trivial, thanks to reformatter.el, which is a great library. i have positive experiences using it: i recently published a json and jsonlines reformatter: jq-format.el, which, together with my related flycheck json-jq checker (included in flycheck), makes working with json and jsonlines files a breeze.
let's get back to python. what i want is: black integration for python editing in emacs, with buffer reformatting, partial formatting, an on save hook, and minimal configuration. in practice, i want an emacs package that:
reformatter.el
black
for normal operationsblack-macchiato
for partial reformattingi really want to see this happen. compared to the current
blacken.el
, the above will be simpler (by reusing third party libraries and tools), and it would also solve things like #11 properly.now, i can see this going forward in a couple of ways:
port this package over to
reformatter.el
and add the missing features. this will likely break backwards compatibility, e.g. different command names, configuration, maybe even the package name.a ‘competing’ package doing exactly what i described above, and publish it on melpa. actually i considered doing this already, then stopped myself… and now i am writing this message instead.
i would be interested in your thoughts. i understand you may not be interested in my ideas/proposal, or you are too busy, and that is totally fine… which leads me to the following:
you could just say ‘go ahead and take over!’ and let me reimplement another emacs-python-black package, since i am actually willing to do all the work to make this happen. once i'm done, you could consider deprecating this package (or just leave it)... and you could sit back, relax, and use my package instead. :)
for reference, i successfully did a similar thing with my relatively widely used emacs-direnv project, which obsoleted multiple half-working earlier attempts to solve the same problem, projectile-direnv and direnv-el, in a friendly, non-competitive way; see here and here.
hope to hear from you!
The text was updated successfully, but these errors were encountered: