Re: clang-format

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <abrcrkinf_Bjwq1Z@devuan>
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.

> 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>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmm63VEACgkQ64mZXMKQ
wqmlog/+LxcnV7U7Nmag0MagY3qc1siqyOP1ahQ+j4NJYJJJoemDd3DvULuHRmQK
L3qvEXv+DX2ERdqAZX6jp+ymc/MAX7ZXj2+jrpkzZ2PBIPQ5S5WycTqRZk1n05xl
xiXKOK4debjeTG6Abd37l1xOwxQuZYfFSatWHIooAecLre+KGC5lNzLWMaGmJX0k
MupTiNF7k1WPAJd2rlqbspr1Ivltj8TSxjFpahAKChH+FFarpEsp2QSQ+dparoeL
5stlR1tZ8v2JRdeVHURE9KfnYyoipS3dapJXvlTfI4aHVmPZT2KWke5cIsD/csGX
T35xvuNEcIRHLzIovCr3MS/pfMwumUnm/4rFYLVB5O/XeftJ+741NJb73Hb5Wt9Y
I2H29VocE7QUfoCj2g59+tdS/SlZdxs6djX7RO4xfsshLfFJ8qdnEQcgQx7+s2o9
xRH7mzx9dDC6wIs7qSluCCytWRGbtUbwndXbF0FxET+DlBMA8scdxo9Y7FkSqZ5s
bOEHb4hrwmLlDETRtEH9H+ZVJZqpeBpO0JixEEhOWfb/lqk00T35mmxUS6oyfT5u
KhI0Itfabxe2TIlOryOFY4ooWeC+G7yWdu675khPJYl7fcNUiS6cKdxI5KrqA/AV
9tAPzxBOyPqSSA2oo20S/jrzpfjA4LoPPZLEMPdq+lSkV9LYpl4=
=E514
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.