Re: clang-format output in branch kevin/clang-format
Alejandro Colomar via Mutt-dev <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <acUaB18-FFqCegtk@devuan> |
Hi Kevin, On 2026-03-26T10:37:58+0800, Kevin J. McCarthy wrote: > 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, This is interesting. There's a 'Leave' option, which means clang-format(1) remembers the original value. I wish there was a similar option for all other configurations. Sadly, that's not the case, and thus, clang-tidy(1) is bad IMO. Have a lovely day! Alex > 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 -- <https://www.alejandro-colomar.es>
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmnFGvAACgkQ64mZXMKQ wqmhEA//RcGaVBUW9W8wqAvs/d0Jt1Uv4LfYDthbYRfS7JPJPjurjIyQxKnu3iK6 6zWgpGZ0CKG6lkwleXc1Q4U9/QVUOosSExmo/qBo5HmRmZnLUObULbSdwC0cWaps xfLkyOM/3ARVNqdXGHGMEHS5pwEXdloXFSVbFCbCllohCsZ846y5Ntoo2JXjlVDU Vm98aAp4iSotnKWKwn+KTwYQhEa6TfKZUHu//Xf1wKC2MPhZx4EbhYIYJucZSvK5 YYmrBejYBU/EONMvdRBVGYpEATiDDPy3TXldKBOkwdHi3jDpa2E85StJUBXT+PBL XvcQQfM93sxg31zdVkvzVkJqlXd3xoHwWBKTt6pGhDQhCK05tzkswzJpkg5XyQar kD3sqlN2rbMZLPh0Oj01ZRIhi2HSNX/33UsazUtBRZdetIQ8FWGqoNu3aSEkguxP /8Yy3ngqcHbHiXFVsHKSZz5sk/EA2Li6GMeT8uCpdsGP4msCHSpvL9azdYciLIEN LIuofybv3Clh3aPfFmLv77F35VD/I3HdgUNmRASGwWu21/4iUHtqN4XYXk9Qx5xy 8qsRJQaTFL86FJ9Ej92mhGmkuSrWcPgyk89zfkyPD7Sh8uAWwJLNtL30WcEkOnDL U3nbASM3StOse5vkk6fdelN1q1rSVCsx4PIU6PwG54FCvVb+Kxg= =W9wW -----END PGP SIGNATURE-----