Closed utterances-bot closed 3 weeks ago
I agree with you on this one. In my opinion, black
is a great tool if you have a big messy codebase that one ever cared to format. Then you can apply black
once to format this codebase to be uniform. And that's it.
I consider other use-cases harmful. Linters are way better in enforcing consistency and sharing knowledge than auto-formatters. I also like the idea that a good linter help you to develop a healthy habit to write good-formatted code all the time. Instead of auto-formatters that promotes "write however you want" philosophy.
Here's our statement on auto-formatters in wemake-python-styleguide
: https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/auto-formatters.html
If you don't want the whole code base to be reformatted in one commit, you can use Darker to only apply Black reformatting to lines modified since the last commit (or since e.g. a given branch).
Running Darker can be bound to a shortcut in an IDE – it's quite nice to quickly write code without caring at all about formatting and then let Black quickly reformat just that part.
Hi, @akaihola! It is great to hear from you! django-split-settings
is doing great! 👍
I will check Darker
out!
Black is great tool for opensource projects which are open for new, inexperienced contributors. In projects which I meet to many time was waste on fixing code formatting in PR than on reviewing changes in code. But if we talk about project developed by same group of experienced users you may expect that they will not push wrong formatted code.
@sobolev after read https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/auto-formatters.html I have two remarks.
Now black add trailing comas, not remove them. Also line length you may configure, In many projects I see line length set to 120 for both black and flake8.
My unpopular opinion about black code formatter - Blog | luminousmen
In this post, I will try to gather all my thoughts on the topic of automatic code formatting and why I personally don't like this approach
https://luminousmen.com/post/my-unpopular-opinion-about-black-code-formatter