DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Ferruh Yigit" <ferruh.yigit@amd.com>,
	"Abdullah Ömer Yamaç" <aomeryamac@gmail.com>,
	dev@dpdk.org
Subject: Re: [PATCH v4] devtools: add .clang-format file
Date: Tue, 14 May 2024 08:56:49 +0100	[thread overview]
Message-ID: <ZkMZQXgj3L5842o7@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F449@smartserver.smartshare.dk>

On Mon, May 13, 2024 at 09:11:32PM +0200, Morten Brørup wrote:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Monday, 13 May 2024 17.55
> > 
> > On Mon, 13 May 2024 14:08:07 +0100
> > Ferruh Yigit <ferruh.yigit@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();
> 

+1, I also prefer the double tab too for this reason. The other
consideration is that double tab leads to smaller diffs on refactor - with
aligning brackets if something on the first line changes it could cause
whitespace changes to be needed on all subsequent lines 

Overall, ignoring our individual preferences, since we already have a mix
in DPDK, I think it's infeasible to try and enforce a single standard now.
:-(

/Bruce

  reply	other threads:[~2024-05-14  7:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 13:04 [PATCH] " Abdullah Ömer Yamaç
2024-04-29 13:32 ` Ferruh Yigit
2024-04-29 15:36   ` Stephen Hemminger
2024-04-29 15:43   ` Stephen Hemminger
2024-05-04 13:38     ` Abdullah Ömer Yamaç
2024-05-04 13:41       ` [PATCH v2] " Abdullah Ömer Yamaç
2024-05-04 16:27         ` Stephen Hemminger
2024-05-04 18:18           ` Abdullah Ömer Yamaç
2024-05-04 19:18             ` [PATCH v3] " Abdullah Ömer Yamaç
2024-05-05 16:18               ` Stephen Hemminger
2024-05-05 18:43                 ` Abdullah Ömer Yamaç
2024-05-05 16:20               ` Stephen Hemminger
2024-05-05 19:42                 ` Abdullah Ömer Yamaç
2024-05-05 20:38                   ` Stephen Hemminger
2024-05-06 10:43                     ` Abdullah Ömer Yamaç
2024-05-08 21:19                       ` [PATCH v4] " Abdullah Ömer Yamaç
2024-05-13 13:08                         ` Ferruh Yigit
2024-05-13 15:55                           ` Stephen Hemminger
2024-05-13 19:11                             ` Morten Brørup
2024-05-14  7:56                               ` Bruce Richardson [this message]
2024-05-14 16:59                                 ` Tyler Retzlaff
2024-05-15  8:28                           ` Abdullah Ömer Yamaç
2024-05-15  8:43                             ` Bruce Richardson
2024-05-15 10:19                               ` Abdullah Ömer Yamaç
2024-05-15 11:41                                 ` Bruce Richardson
2024-05-15 15:07                               ` Stephen Hemminger
2024-05-15 20:32                                 ` Abdullah Ömer Yamaç
2024-05-16  8:20                                   ` [PATCH v5] " Abdullah Ömer Yamaç
2024-05-17  9:30                                     ` Bruce Richardson
2024-04-30 21:27   ` [PATCH] " Abdullah Ömer Yamaç

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZkMZQXgj3L5842o7@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=aomeryamac@gmail.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).