From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35E3944024; Tue, 14 May 2024 18:59:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2369840649; Tue, 14 May 2024 18:59:49 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id D8CF640608 for ; Tue, 14 May 2024 18:59:47 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 3405820B2C80; Tue, 14 May 2024 09:59:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3405820B2C80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715705987; bh=f8UVVIe96XwxD3qmFnDrB9Ws6KDyKP+PXesCeL7K9Hc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LLH8eeFjl8LHZMzyDEtBvQ/WsOT9sn5Pve5U7We/6hyHPoXVJgKvuMm+ILT0tgkBJ hcCh8MvnXBjNNX203KbPVDDVXyNrl0DxDugSF7kuLvjbsqhRoPEcl12Bu3FIz6ktto MTjL/gJWI8cOUzkL3WbVeHP7flLzf2yrnVZRVhJ8= Date: Tue, 14 May 2024 09:59:47 -0700 From: Tyler Retzlaff To: Bruce Richardson Cc: Morten =?iso-8859-1?Q?Br=F8rup?= , Stephen Hemminger , Ferruh Yigit , Abdullah =?iso-8859-1?Q?=D6mer_Yama=E7?= , dev@dpdk.org Subject: Re: [PATCH v4] devtools: add .clang-format file Message-ID: <20240514165947.GA17477@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20240508211934.1143124-1-aomeryamac@gmail.com> <20240513085517.5e572880@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F449@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, May 14, 2024 at 08:56:49AM +0100, Bruce Richardson wrote: > 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 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. > :-( -1 to anything that aligns with parameters. it's the most mechanically inconsistent convention ever, hostile to refactoring and causes a requirement to endlessly shift your eyes horizontally when reading code sequentially.