On Fri, 2019-09-27 at 10:33 +0100, Daniel P. Berrangé wrote:
On Thu, Sep 26, 2019 at 06:08:14PM +0200, Ján Tomko wrote:
> * function calls sometimes leave an empty opening parenthesis
> * always rewrapping function arguments might create unnecessary churn
> * parameters wrapping might not be smart enough, e.g. we like to do
> virReportError(VIR_ERR_CODE, "%s",
> _("string"));
> in a lot of places.
Yeah these last two points are the ones I struggled with too when I
looked at clang-format 6 months back.
The churn does worry me as it would make cherry-picking patches a
big pain for downstreams.
In the long term I think we'd win by having an explicit code formatting
tool that everyone is expected to comply with, even if it isn't quite the
same style that we currently use.
I have stated my support for this idea in the past, and it still
applies.
Automatic formatters sometimes produce output that's uglier than what
a human would come up with, but remove a lot of fiddling and
second-guessing, so overall the outcome is a positive one IMHO.
Plus our coding style is quite weird in some areas, and the fact that
something like clang-format, which IIRC is used for massive codebases
with hundreds of contributors such as Chromium, can't be convinced to
adapt to it, may be seen as a sign that we'd be better off adopting
one of the more widespread styles instead.
--
Andrea Bolognani / Red Hat / Virtualization