Black: An uncompromising Python code formatter
21–30 of 262 posts
Re: Black: An uncompromising Python code formatter
#22> By using it, you agree to cede control over minutiae of hand-formatting. I may be in a minority, but I do not want to cede control over minutiae of hand-formatting. Am I the only person that feels this way?
Not at all. I would never use something like this except to clean up some sloppy code that I am inheriting.
Re: Black: An uncompromising Python code formatter
#23Earlier quoted context omitted.
Why black over yapf?
Black is a simple tool. It tries to implement a single code style well. It's not configurable. We tried YAPF before and could never roll it out for everybody. I even contributed the "facebook" style to the tool. There were a few reasons why YAPF didn't work out for us but the most important were: - YAPF would at times not produce deterministic formatting (formatting the same file the second time with no changes in be…
The authors have been adding specific workarounds for some cases but it's a general issue with the approach:
- https://github.com/google/yapf/issues/264
- https://github.com/google/yapf/issues/39
Black algorithm doesn't explode in such way. It's also a lot faster overall which makes it possible and reasonable to enable a good format on save experience.
Re: Black: An uncompromising Python code formatter
#2488 characters per line is a weird choice. Why not 90?
Re: Black: An uncompromising Python code formatter
#25Re: Black: An uncompromising Python code formatter
#26At Facebook, we are now using prettier[1] on all our JavaScript files, a growing number of Hack files are formatted with Hackfmt[2] and now black is being rolled out for Python. It's a really exciting time :) [1] https://prettier.io/ [2] https://github.com/facebook/hhvm/blob/master/hphp/hack/src/h...
Thanks
Re: Black: An uncompromising Python code formatter
#27Earlier quoted context omitted.
Why black over yapf?
Black is a simple tool. It tries to implement a single code style well. It's not configurable. We tried YAPF before and could never roll it out for everybody. I even contributed the "facebook" style to the tool. There were a few reasons why YAPF didn't work out for us but the most important were: - YAPF would at times not produce deterministic formatting (formatting the same file the second time with no changes in be…
Except for the line length:
> if you're paid by the line of code you write, you can pass --line-length with a lower number.
Re: Black: An uncompromising Python code formatter
#28I usually prefer a set of dead-simple formatting/styling rule, easier to enforce, lower cognitive load.
Re: Black: An uncompromising Python code formatter
#29Any word out about a version for emacs?
Re: Black: An uncompromising Python code formatter
#30> By using it, you agree to cede control over minutiae of hand-formatting. I may be in a minority, but I do not want to cede control over minutiae of hand-formatting. Am I the only person that feels this way?