[libvirt] [PATCH 4/8] tests: Use virAsprintf() to build titles
Peter Krempa
pkrempa at redhat.com
Wed Mar 13 09:32:42 UTC 2019
On Wed, Mar 13, 2019 at 10:25:16 +0100, Andrea Bolognani wrote:
> On Wed, 2019-03-13 at 09:48 +0100, Peter Krempa wrote:
> > On Thu, Mar 07, 2019 at 16:44:33 +0100, Andrea Bolognani wrote:
> [...]
> > > #define DO_TEST(arch, name) \
> > > do { \
> > > + VIR_AUTOFREE(char *) title = NULL; \
> > > + VIR_AUTOFREE(char *) copyTitle = NULL; \
> > > + if (virAsprintf(&title, "%s (%s)", name, arch) < 0 || \
> > > + virAsprintf(©Title, "copy %s (%s)", name, arch) < 0) { \
> > > + return -EXIT_FAILURE; \
> >
> > Coding style. Single-line body.
>
> There are multiple conditions with the same indentation, so per the
> coding guidelines[1] the curly braces are required.
>
> Honesly, we should really give clang-format or whatever similar tool
> a serious go and just start enforcing that code needs to be filtered
> through it before being merged. Having humans worry about this kind
> of nonsense is such an utter waste of time.
>
>
> [1] https://libvirt.org/hacking.html#curly_braces, third example.
Hmm, interresting. In this particular instance we are pretty much always
breaking the style though. Majority of multi-line conditions with a
single line body which I've encountered don't have the block.
ACK as is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190313/0a550361/attachment-0001.sig>
More information about the libvir-list
mailing list