Re: clang-format

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <abntCfaaoyXJl73h@devuan>
Hi Kevin,

On 2026-03-15T13:36:07+0100, Alejandro Colomar wrote:
> > Yes, this seems to be the problem with format tools.  AFAICT, there are just
> > two options, true and false.  I don't think there is a way to say "let them
> > be", but please correct me if I'm wrong.
> 
> I've never used clang-format(1), so I don't know.
> 
> I think I'd use it unce to make the source more consistent, and then
> stop using it, as others have said.  After that, style should get more
> consistent, and new code would likely follow the existing style.
> 
> Then maybe run it once a year or so, just to check that everything is
> more or less good.
> 
> I have so far not engaged using these tools precisely because they are
> too strict, and that ends up making source code worse.  I still want to
> experiment with them, in case I can enforce some rules that are more
> simple and which have no exceptions, but I'm not yet convinced.

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.

I would like it if you could enable a few options that it would
diagnose, and ignore everything else, just like compiler diagnostics
have always worked.  But it doesn't work like that.

> > Rene voiced a dislike of formatters, especially when they are run
> > automatically on a pipeline.  Perhaps we could run this formatter once,
> > clean up the egregious function alignment issues, and then just leave the
> > format config as "reference"?

I agree with Rene.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmm57ZwACgkQ64mZXMKQ
wqnGXw/+M9jl/ZXEDwHrpkPfnVqhvDAM+P1ZgX9Mn9t2huoZZV4fV286rK4ZVeJ+
J68CyzRkUezE6pnVscb1nQB9C4J3MPmmc7+52zbNKvcGh+jzdcWKuLkrTkKA7HWX
mfdK39FrferMYtcuY+abPbFtD0fdq+bI4ZBJR+dtMw4n8e8NvuY4jZQuNCQn9qnm
+zhzGuDbJfYbcItzteTllqaesecMCKIIJ/u5SVp/1mBuYWaDlgIz8PiKyQj316+B
19jih5dpw+DUi2IX5S3taONzetNZaMdx3Y/GM8GYl/q/iFNyKCzXu5IaebwAbESw
lpOwzOAExut37t5C9mX6UfFJw7bOrDRwDG87xMOxNN3bKUD74HYzzjGOCjdhn4oc
FN7FhTzyha2rSU1qOWzFoEzMUPz8F8AIK0nYQB8HZJLDJ6WsADEb9bfnpNAhxjgv
Xqoyn1r3ToQ3zI6flNurwieO3ZayLEFvHJZ2FsEhUHwkT3ixNh8bBLPsfgql25Da
pvgVKvM40XGm+11b+ZLupJ7wI6Y6Piqiwb/Kkp7/k6SstTYhCGiRCFooNGR3Q/xd
sbfsxPa78rfkVudthVkl/HXahzTNz27H1j6wV03c+L2U3F6RvRBQeK2T13R6ufQ9
Bc11eedxuUoEog0rmQyLn4S5QsrR7raCjk0zUvVF5wiiQvIDrIM=
=TTm6
-----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.