Re: [libgpiod][PATCH 02/11] treewide: apply formatting changes with clang-format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2022 at 2:59 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Nov 30, 2022 at 01:42:22PM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> >
> > Use linux kernel's .clang-format file to automatically improve the coding
> > style of libgpiod's C code base. We don't import the file into the
> > repository as it's not perfect and certain converted fragments were
> > rolled back because they looked better before the conversion.
>
> ...
>
> >               if (gpiod_line_settings_get_direction(
> > -                             per_line->node->settings) !=
> > +                         per_line->node->settings) !=
> >                   GPIOD_LINE_DIRECTION_OUTPUT)
> >                       continue;
>
> Personally I percept this as an ugly indented code...
>
> One reason is too strict 80 or whatever rule (we are almost in
> the second quarter of the 21st century!), another is that trailing
> opening parenthesis.

This is very much a question of personal preference and as the
maintainer I get to pick and choose the coding style for the project
but let me provide a personal argument in favor of the 80 line limit.
I mostly work with C and use a single big screen for work. When the
limit is set to 80 chars (or 88 which is standard for python), I get
to have four columns of code on my screen and still work comfortably.
Unless it really adds to the readability, I prefer to keep it.

Bart

>
> That said, some of the changes in this patch I like, some I disgust.
> Quite controversial to me, but it's your project and esp. taking into
> account that it's a user space, the kernel or other project rules are
> not applicable in a general sense anyway.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux