[PATCH v4] devtools: add .clang-format file
Morten Brørup
mb at smartsharesystems.com
Mon May 13 21:11:32 CEST 2024
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Monday, 13 May 2024 17.55
>
> On Mon, 13 May 2024 14:08:07 +0100
> Ferruh Yigit <ferruh.yigit at amd.com> wrote:
>
> > 2. Double tab indentation vs parenthesis align
> > if (iter->bus != NULL &&
> > - /* not in middle of rte_eth_dev iteration, */
> > - iter->class_device == NULL) {
> > + /* not in middle of rte_eth_dev iteration, */
> > + iter->class_device == NULL) {
> >
> > DPDK coding guide suggests double tab, but also accepts alignment by
> > spaces. But as far as I can see most of code has double tab.
> > Majority of the diff caused because of this rule.
>
>
> I personally am more used the aligned style, and most tools support
> that.
> The DPDK one is unique (not done by most other projects). So can we just
> keep the kernel (what is this clang-format) version.
I personally prefer the double tab.
It also works with editors showing tab as 4 space indentation.
Mixing tabs and spaces only works if the editor shows tabs as 8 space indentation.
Double tab works with both editor configurations.
And there is no confusion if the following block happens to be aligned with the following parameters. E.g.:
if fool(x,
y)
myfn();
vs.
if fool(x,
y)
myfn();
More information about the dev
mailing list