Re: clang-format output in branch kevin/clang-format
"Kevin J. McCarthy" <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <acScBiOuv-svSoho@qinghai> |
On Tue, Mar 24, 2026 at 09:20:55AM +0100, Rene Kita wrote:
>This
>#v+
>-#ifndef RE_NREGS
>-#define RE_NREGS 30
>-#endif
>-
>+# ifndef RE_NREGS
>+# define RE_NREGS 30
>+# endif
>#v-
>
>made me stumble. At first I thought 'Right, space after shell comments'
>only to realize that this is cpp not shell... :-)
That was actually due to a configuration decision. See:
IndentPPDirectives: AfterHash
There are other choices, but I saw this version in several places and
arbitrarily chose it. The other choices were None, Leave, and
BeforeHash, which would have been:
#ifndef RE_NREGS
#define RE_NREGS 30
#endif
>While I see some value in the
>remaining changes (and in general agree about the parentheses style) I'm
>still not convinced this is worth the noise.
Yes, that's my conundrum too. There are some places where the output
is... bad. But it's mostly just "okay/acceptable" and it does make
everything homogeneous. Perhaps tweaking the "Penalty" configs could
reduce some of the badness, but that seems an undocumented black art.
I have to admit I like the parenthesis style too. I got used to the
space-before, but it's "noise" and I feel like the code is just a little
bit easier to look at without them...
This week I've been a bit busy, so I've let the message sit. I'll give
a couple more days for comments.
>It also adds some horrible things like:
>#v+
>- (!ciss->path || url_pct_decode (ciss->path) >= 0) ? 0 : -1;
>+ (!ciss->path || url_pct_decode (ciss->path) >= 0) ?
>+ 0 :
>+ -1;
>#v-
Yup.
>and
>
>#v+
>- scratch[taglen] = 0; /* overwrite the colon as mutt_parse_rfc822_line expects */
>+ scratch[taglen] =
>+ 0; /* overwrite the colon as mutt_parse_rfc822_line expects */
>#v-
Yeah, I think the problem here is that I'm not letting it mess with
comments via:
ReflowComments: IndentOnly
Because the alternative would be to totally destroy any carefully
formatted comments in the code.
>Just my 2c.
Thanks for taking a look.
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmnEnAYACgkQre92hIAx a9rpFw/7BHcLQ3XJSmo8ivU0ItdFTynIhrgiMwpG5iaE6qqviN9cwfaGtaAmJrAi NKFJqPHMblILR5x1eEfSzlACzq9HC0gSjb4p6VOHdfd8AzjSeqUzsjJNKmo5hzBM J9p2Z9w+DoFC/9OgY1kVGTbNyeXsftANHb0LrAfmhykZP2AdLiwD5TI9qb0/kxb3 l7i2SMChFrGV+cHLKjOpT/DQQ3rJTOdsDgr6SUvkGsNjSKrzjFmqdoepOIllW127 pzVVTwx+Tza48x4iGnGGTwA1hajPmwlnYhzosUaFvACw0loJ6wTyrLUpkrlc7Jwe wwtqgBgRd6T3e3ZNQE7WYLcX7itwtoBfQxlh+39dkfC9EKWD2XIEwK/IJpmLfCe4 cn14CDL/btnElGplC9RPiixuV+XaOTZ97eC8KVexgCSZ+6T1GmVtPZsfWiIZrTvl giYFEfKjouwWtXqdoLRp0cYAGVUQ8PCPKZLUS9GRfV+qNhjRYmHDY6evwTCq5Ur3 QETAM6hPR43nsX8xhRJzKd6tc1YAm4R+G2dbwsu8Oo/ml41p7e1nZU/MkaTIIBDL 0w2/CMnM4UEOP2nWSbR/0bR81qWcgHZOXY2Kstkr2DP85up0EesBS+uy61hhUs41 YtmsZzhXUTpmRztYY6+0VFj0XTqRtM7a58SaEcyD/M87D680t+4= =QSXM -----END PGP SIGNATURE-----