Clang format config for Weston

Pekka Paalanen ppaalanen at gmail.com
Thu Mar 14 13:11:29 UTC 2019


On Thu, 14 Mar 2019 18:11:47 +0530
Harish Krupo <harish.krupo.kps at intel.com> wrote:

> Pekka Paalanen <ppaalanen at gmail.com> writes:

> > FYI, one thing I would never want to see in a patch is adding
> > '/* clang-format off */' kind of directives into code.
> >  
> 
> /* clang-format off */ directive is supposed to be used sparingly. If
> the whole code is commented out that way then I believe the reviewer
> should point that out. We could also add a check in the CI to
> ensure that the /* clang-format off */ and /* clang-format on */ pair
> don't span more than a few lines at a time.

Hi Harish,

no, I really mean they should never be used at all. If they are
actually necessary even once, then we did something wrong: we made it
an error in CI instead of only a warning, the format checker was was a
bad choice, or the format definition is off.

If the directive is only needed sparingly, then it is not needed at
all, because reviewers can just say the checker in CI is wrong and merge
the patch with style warnings. If that becomes a hindrance, then it's
not "sparingly" anymore.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20190314/0f536690/attachment.sig>


More information about the wayland-devel mailing list