From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0AE5644037;
	Wed, 15 May 2024 17:07:31 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 87C1F402D1;
	Wed, 15 May 2024 17:07:30 +0200 (CEST)
Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com
 [209.85.214.180])
 by mails.dpdk.org (Postfix) with ESMTP id 3D2BF4021D
 for <dev@dpdk.org>; Wed, 15 May 2024 17:07:29 +0200 (CEST)
Received: by mail-pl1-f180.google.com with SMTP id
 d9443c01a7336-1ec41d82b8bso66370485ad.2
 for <dev@dpdk.org>; Wed, 15 May 2024 08:07:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715785648;
 x=1716390448; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:from:to:cc:subject:date
 :message-id:reply-to;
 bh=s8RuR+Gj5EKqnrMAb7PAn0vAmsPtV1gr6KM8GSb5cCg=;
 b=kVTNo+6w7kW0nAHy7Ozoz4KeFxHbsxlEK3MKPchk5cau+PL60dIeOWc6oV3AuAYbPr
 vFXL7EAo1SwpwQDCyUUenehbPLLZEU8wbey/W2CCIy9OjZic4wJP+IQ+BSCrU+5rxCfe
 E41Nyq46KVk7J5Qs+qMhAD0+KiPxTOV4x919Z/Q1f7U/guO3M60uCwRmKCq9uqnIWZxK
 rmORo/fYxSeEi/llVu47386p7Dp5d4WRnfRIXtLI+5TKJe5ZoROnLdVjk89pDn05wY2P
 BPIhf0jDNk5nzUnh1PakF8ha06ha8OQy9k3ukB4JherdwEeWxegpW9/lzeXybXYVmu32
 VDDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1715785648; x=1716390448;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=s8RuR+Gj5EKqnrMAb7PAn0vAmsPtV1gr6KM8GSb5cCg=;
 b=i6T0cmenqwMwtQtk7uG2PgK1QThbnyRutMkveusU/ukZJhVxdt9Kt4afqUrgKm8aMB
 3g035/zH4q+krfwK2SxpjA9uqX5gUdW4VXwVSRbEhReG5O2Ici67GYmwZ12NFBa7cKo/
 6glxSy5P8cZWu3LHJxZbIxSU9nWdt/N2D8szX8tNwe2XFRnVwctxzd8814BD1vB5AQzG
 nTzxVnCNzOMq7Sv9KqUpZ4bnLRJCbsNkdNKOz/KAkgUTLpYdtwZsgQRZhYujNQXpq/7Q
 TE6oST0Vri6Av5H+S/YdLKQyW4S2VLpnn+eml3N6yh+4UkzaXlLqo0r8qiQcxqxINtJv
 RM9Q==
X-Forwarded-Encrypted: i=1;
 AJvYcCWRo8z9OYB8ge69GNMDqWcPBxn3mcAhe4Cjoar08mg7pgIIZuU7mlMjhOY4kyxE0zvE0mfJKE8BQOZmgKA=
X-Gm-Message-State: AOJu0YxjWyipcByQmAcjQ+wRCm3JLY79nS85MpfF4OQJzA5eF6T+n9ml
 n+Y8vkmaDP3CDV1MzfSNHxotHQLB4vSBqRX8VrS0y9HgPf68buf/L0fDyyVNO8Q=
X-Google-Smtp-Source: AGHT+IFOnPYZuaiQu2yjLru44XNLxPY510stKcjHA/ZAWziH+eZQnB/6zVLbhtQy3pOg5VuHlNhmQA==
X-Received: by 2002:a17:902:d48c:b0:1eb:4c47:3454 with SMTP id
 d9443c01a7336-1ef434d2774mr229748315ad.0.1715785641472; 
 Wed, 15 May 2024 08:07:21 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-1ef0b9d16afsm119751415ad.19.2024.05.15.08.07.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 15 May 2024 08:07:21 -0700 (PDT)
Date: Wed, 15 May 2024 08:07:19 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: Abdullah =?UTF-8?B?w5ZtZXIgWWFtYcOn?= <aomeryamac@gmail.com>, Ferruh
 Yigit <ferruh.yigit@amd.com>, <dev@dpdk.org>
Subject: Re: [PATCH v4] devtools: add .clang-format file
Message-ID: <20240515080719.6964bf8a@hermes.local>
In-Reply-To: <ZkR1qqI3_Hlf7Ayb@bricha3-mobl1.ger.corp.intel.com>
References: <CA+sj1i9RvD5o7sczf_aVjjo+5P=P0UzL=8hEe9qc92VSQsqpjw@mail.gmail.com>
 <20240508211934.1143124-1-aomeryamac@gmail.com>
 <bf38f8a0-6f63-4e07-b6a7-a83de6bced9d@amd.com>
 <CA+sj1i85pTN8zhn5YOwcV0jRJaUSpymQX93L2s5S+Fm8x1Z_PQ@mail.gmail.com>
 <ZkR1qqI3_Hlf7Ayb@bricha3-mobl1.ger.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Wed, 15 May 2024 09:43:22 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Wed, May 15, 2024 at 11:28:33AM +0300, Abdullah =C3=96mer Yama=C3=A7 w=
rote:
> >    I want to update you.
> >    On Mon, May 13, 2024 at 4:08=E2=80=AFPM Ferruh Yigit <[1]ferruh.yigi=
t@amd.com>
> >    wrote:
> >=20
> >      On 5/8/2024 10:19 PM, Abdullah =C3=96mer Yama=C3=A7 wrote: =20
> >      > clang-format is a tool to format C/C++/Objective-C code. It can =
be =20
> >      used =20
> >      > to reformat code to match a given coding style, or to ensure tha=
t =20
> >      code =20
> >      > adheres to a specific coding style. It helps to maintain a =20
> >      consistent =20
> >      > coding style across the DPDK codebase.
> >      >
> >      > .clang-format file overrides the default style options provided =
by
> >      > clang-format and large set of IDEs and text editors support it.
> >      >
> >      > Signed-off-by: Abdullah =C3=96mer Yama=C3=A7 <[2]aomeryamac@gmai=
l.com>
> >      > =20
> >      Hi Omer,
> >      I tried on ethdev.c (clang-format -i ./lib/ethdev/rte_ethdev.c), I
> >      will
> >      highlight a few issues below (not all of them), I hope it is OK to
> >      continue step by step, fixing these issues.
> >      1. clang format failed for following options, not sure why, am I
> >      using a
> >      wrong version:
> >      LineEnding: LF
> >      InsertNewlineAtEOF: true
> >      I commented them out to continue the test.
> >      And for 'ColumnLimit', I prefer default 80 with the flexibility to
> >      go
> >      100 when makes sense, so I will got with 'ColumnLimit: 80'; but I
> >      don't
> >      want to start this discussion.
> >=20
> >    In the .editorconfig file, 100 is stated as a max_line_length. That's
> >    why I prefer 100.
> >  =20
>=20
> +1 for keeping as 100
>=20
> >      2. Double tab indentation vs parenthesis align
> >               if (iter->bus !=3D NULL &&
> >       -                       /* not in middle of rte_eth_dev iteration,
> >      */
> >       -                       iter->class_device =3D=3D NULL) {
> >       +           /* not in middle of rte_eth_dev iteration, */
> >       +           iter->class_device =3D=3D 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.
> >=20
> >    Still, some discussions are going on
> >  =20
>=20
> This is one where I don't think we will were reach a consensus, and even =
if
> we did, it would mean massive churn to DPDK. Can we have clang-format NOT
> adjust line-continuations in a file?


Clang format is useful on new and seriously broken code.
Do not want to do it automatically or accept patches across all the current=
 code.

For indentation, can we get some setting that matches what DPDK double tab =
does?
If not is there something close. Often useful to look at the other clang fo=
rmat
pre-set styles in source.