On 2026-03-18T18:14:02+0100, Alejandro Colomar wrote: > Hi Will, > > On 2026-03-18T09:54:38-0700, Will Yardley wrote: > > On Wed, Mar 18, 2026 at 11:21:28AM +0800, Kevin J. McCarthy wrote: > > > On Wed, Mar 18, 2026 at 01:11:14AM +0100, Alejandro Colomar via Mutt-dev > > > wrote: > > > > Okay, so I've tried today clang-format(1) for the first time, after > > > > someone suggested it in a project I co-maintain, and now have a well > > > > formed opinion about it: > > > > > > It's pure crap. Please don't use it. > > [...] > > > Before I drop the proposal, though, are there any Mutt devs/contributors > > > who > > > would like to play devil's advocate? > > > > In more or less the same boat as Robin on this. > > > > I am not a C programmer, and can't speak to clang-format specifically. I > > will say broadly that, since starting to use them, I have really > > appreciated autoformatters generally (ruff / black for Python, prettier > > for js, etc.), especially when working with a team of people. It may > > well turn out that there isn't a good tool available for C, but I do > > think that if it is possible to find a formatter that works and can be > > enforced, there is a lot to be said for both the resulting consistency, > > and kind of taking arguments / bikeshedding about code style and > > formatting out of the equation. > > > > I'm not sure if the concerns Alejandro mentioned are about the > > functionality of the program, its default configuration, or both. It > > does seem like the program supports formatting based on different style > > guides, and configuring certain parameters > > (https://clang.llvm.org/docs/ClangFormatStyleOptions.html), so maybe > > some objections could be overcome by either disabling certain types of > > formatting, or choosing different config settings? > > The problem is the fundamental functionality of the program. It doesn't > have any way to fix the problems with configuration.
BTW, clang-format(1) programmers are aware of this limitation (people have reported it in the past), and they claim it will never be implemented, because the design of clang-format makes it almost impossible. See also: <https://stackoverflow.com/questions/30763869/how-can-i-apply-only-one-clang-format-action> <https://github.com/llvm/llvm-project/issues/53924> Cheers, Alex > > > Or, maybe come up with the style guide first, then work backwards from > > that to see if a formatter / formatter config can be created that will > > work? > > I don't know if there are any other formatters that would be good. > And I don't think writing a formatter from scratch just for mutt(1) > would be reasonable. But what is clear is that clang-format(1) is > really bad. If anyone wants to work on a new formatter, or knows of > another formatter that is better, I'm fine with that. > > > Have a lovely day! > Alex > > -- > <https://www.alejandro-colomar.es> -- <https://www.alejandro-colomar.es>
signature.asc
Description: PGP signature
