News for hackers. Stuff that matters.
Re:Black – Uncompromising Python code formatter by bunderbunder on Friday May 17, 2019 @01:08PM (#19941514)
My sense is that configurable autoformatters are doomed to suck.

Because an autoformatter with 10 simple yes/no options has 1024 different ways those options can interact, and an autoformatter with 20 yes/no options has 1,048,576 different ways that they can interact. It's simply not possible to make sure that you're going to get reliably good results in the face of that kind of combinatorial explosion.

Versus, if there's only one way that it will format things, then the people designing the rules have a single stationary target that they can aim at.

Re:Black – Uncompromising Python code formatter by colatkinson on Friday May 17, 2019 @09:37PM (#19945062)
This isn't really the case, though. Lots of options are completely orthogonal (e.g. tabs vs spaces and function brace style don't really affect each other). My experience with clang-format has been that each option (mostly) only affects a single token type, which is determined using clang as a backend. I've only seen satisfactory results.

If you don't have as powerful a backend as the full clang paraer/lexer on the other hand, I could quickly see things breaking as you described.

Re:Black – Uncompromising Python code formatter by camgunz on Friday May 17, 2019 @01:26PM (#19941686)
Let me introduce you to Uncrustify (well, its GUI anyway) [1]. It's ridiculously configurable and super good at what it does.

[1]: http://universalindent.sourceforge.net/screenshots.php