Live data from Hacker News

Black: An uncompromising Python code formatter

github.com

1–10 of 262 posts

Re: Black: An uncompromising Python code formatter

#4
post #2

Maybe I missed it, but I don't see a comparison with PyCharm's built-in code formatter. Why would I integrate this code-formatter, "black", into PyCharm when PyCharm already does this for me and the whole team?

I'm also assuming pycharm has some options. This thing seems to make very specific decisions and if you don't agree with them, tough.

Re: Black: An uncompromising Python code formatter

#5
post #3

> 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

#6
At 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...

Re: Black: An uncompromising Python code formatter

#7
post #3

> 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?

maybe give it a try. I felt the same way about prettier, but then I realized how much time I save by no longer having to worry about formatting. As I type, I just type it all on one line and then do a keyboard shortcut and it magically gets reformatted and looks pretty.

Re: Black: An uncompromising Python code formatter

#8
post #3

> 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?

Your complaint is the entire reason it's an interesting project: it gives you practically no choice. That's why it's called black, as a reference to the Henry Ford quote: "Any customer can have a car painted any color that he wants so long as it is black."

The idea is to toss aside control over nitpicky formatting _configuration_ options in favor of not worrying about formatting configuration and just going with someone else's opinion of what the configuration should be instead.

Re: Black: An uncompromising Python code formatter

#9
post #2

Maybe I missed it, but I don't see a comparison with PyCharm's built-in code formatter. Why would I integrate this code-formatter, "black", into PyCharm when PyCharm already does this for me and the whole team?

Not everyone runs PyCharm, and this tool is open source.
Post reply on HN