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 541C243F56; Tue, 30 Apr 2024 23:27:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2017440262; Tue, 30 Apr 2024 23:27:13 +0200 (CEST) Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) by mails.dpdk.org (Postfix) with ESMTP id 8C2A94025C for ; Tue, 30 Apr 2024 23:27:11 +0200 (CEST) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-23d3afdcd71so350069fac.1 for ; Tue, 30 Apr 2024 14:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714512431; x=1715117231; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nyHXIcXQ7VdIW5CJUf7q6ajGJ4RyQPEvpJjFyx8PPTM=; b=K/m/yXAQUpq5h+BpJTFSRuiitiUYRUzG61IX+BWPhhdC6Rv/H/s6N9GX/gGGiRKa3S SHMizbATQ/vx8mXvDP297e304lMgI+MeSNA3MQIlFo2OY5ZNYytE7i1gIzRbQMnM0YfK s1/Oz9zCNPPnoo1lAyDBNoAHytgLy1XFH8mxMj5xpTon2nvJa911v2wpJX02Np7OELNk J0mpZQydpchaUKFKSQZEhO2drB7rsKpTxmgMHS1wHZ6XOQWcQAOdTpHe67xEy+qs2tv1 7QYK5iO7Z9XrU/vby/AFpL/qBizllcAGBZyHL10qiPRznNuyIfsImLHgsVBI6vg77kFI OKNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714512431; x=1715117231; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nyHXIcXQ7VdIW5CJUf7q6ajGJ4RyQPEvpJjFyx8PPTM=; b=b32boaSjRPUCEQdzHQNX9bMByrnkj9Era//H0yDSfLWPh3i12M36C+b2ekrJoKBxTy mpCknW+XuvgiYe2ljAObxBE0Fml/xutNZeLyC/2mAvGWqa1+uBlSUzSA0DzgfK4Yp3R1 b0u5qCloNL8PYzkKOmt8BtgsYl9EWX6iuZWw32EPwKBIagJjE0kZQYHx4nJ4Bs68mLUn XJEqnV0BytBS+SG9VCnj4d/Qn0cKSPAu8T63jh/WiDg1tyzv70CESrjtsFegFB0YYF6F SpAD7I9Xe5gHYf/jxCZ9AUX+ojJ4U5jJ+1FfR0e+9dmkfwB+ZzzgeTZvo3o4gEhkDuCM aXvg== X-Gm-Message-State: AOJu0YxsS4JF7EERJpyWhlw9TKA9cxJucfh4TL9cU+ZuGFD6I50r9uC2 idtmSCGRMUtcUce9X170GdnLFYLIMxMkBF7aUdzcKbJw1VGWbZo9FxLRLz20U/QsIL71llCK8i9 Rkj2qAV39jfiwq5QyUh2OSxL3gso= X-Google-Smtp-Source: AGHT+IHniDpgJuf/Z3j0VtRWmdHD6Ezo0QcEaGq1e8QkqALAUztzODCoFlmcZue8zkKhQhBorybZMRGHV90J/Kh13iU= X-Received: by 2002:a05:6870:1586:b0:233:55b8:edf1 with SMTP id j6-20020a056870158600b0023355b8edf1mr773636oab.8.1714512430704; Tue, 30 Apr 2024 14:27:10 -0700 (PDT) MIME-Version: 1.0 References: <20240429130414.1049310-1-aomeryamac@gmail.com> <64089d51-ed3c-4383-9014-920d772c9a98@amd.com> In-Reply-To: <64089d51-ed3c-4383-9014-920d772c9a98@amd.com> From: =?UTF-8?B?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= Date: Wed, 1 May 2024 00:27:00 +0300 Message-ID: Subject: Re: [PATCH] devtools: add .clang-format file To: Ferruh Yigit Cc: dev@dpdk.org, thomas@monjalon.net Content-Type: multipart/alternative; boundary="00000000000065313d0617570845" 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 --00000000000065313d0617570845 Content-Type: text/plain; charset="UTF-8" > ... > > 1. Some options are failing for me [1], I don't know if it requires a > specific version of clang-format > I fixed these errors, and the clang-format version should be 17. I will send them after some discussions, as I've shared below. > > 2. Current options are not fully aligned with coding convention, it is > easier to see what is not compatible by running the tool on an existing > file [2]. > we need to fix them. > > There are some cases that we need to discuss. First of all, I applied the latest clang format that I created. - In default cases for clang-format, include headers are sorted alphabetically. It improves the readability of code, and it breaks the codebase. These changes do not affect code maintenance because they are only headers. - Second question about the column width. In the definition of .editorconfig, the column width is set as 100, but the previous commits violate this. Here is the sample code: struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS]; @@ -61,8 +61,7 @@ static const struct rte_eth_xstats_name_off eth_dev_stats_strings[] = { {"rx_missed_errors", offsetof(struct rte_eth_stats, imissed)}, {"rx_errors", offsetof(struct rte_eth_stats, ierrors)}, {"tx_errors", offsetof(struct rte_eth_stats, oerrors)}, - {"rx_mbuf_allocation_errors", offsetof(struct rte_eth_stats, - rx_nombuf)}, + {"rx_mbuf_allocation_errors", offsetof(struct rte_eth_stats, rx_nombuf)}, }; We could use this clang-format file only for the new patches and newly inserted lines. I am using VSCode IDE for development, and after some modification, I can select the modified lines and apply formatting. It is very useful for these cases. Otherwise, we need to handle so many things. By the way, I am still working on macros. If you have any comments on this, I would be very happy to discuss it. > ... --00000000000065313d0617570845 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

...

1. Some options are failing for me [1], I don't know if it requires a specific version of clang-format
I fixed these errors,= and the clang-format version should be 17. I will send them after some dis= cussions, as I've shared below.

2. Current options are not fully aligned with coding convention, it is
easier to see what is not compatible by running the tool on an existing
file [2].
we need to fix them.

There are some cases that we = need to discuss. First of all, I applied the latest clang format that I cre= ated.
- In default cases for clang-format, include headers are sorted al= phabetically. It improves the readability of code, and it breaks the codeba= se. These changes do not affect code maintenance because they are only head= ers.
- Second question about the column width. In the definition of .edi= torconfig, the column width is set as 100, but the previous commits violate= this. Here is the sample code:
=C2=A0struct rte_eth_dev rte_eth_devices= [RTE_MAX_ETHPORTS];
@@ -61,8 +61,7 @@ static const struct rte_eth_xstats= _name_off eth_dev_stats_strings[] =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&qu= ot;rx_missed_errors", offsetof(struct rte_eth_stats, imissed)},
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 {"rx_errors", offsetof(struct rte_eth_st= ats, ierrors)},
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {"tx_errors", offs= etof(struct rte_eth_stats, oerrors)},
- =C2=A0 =C2=A0 =C2=A0 {"rx_m= buf_allocation_errors", offsetof(struct rte_eth_stats,
- =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rx_nombuf)},
+ =C2=A0 =C2=A0 =C2= =A0 {"rx_mbuf_allocation_errors", offsetof(struct rte_eth_stats, = rx_nombuf)},
=C2=A0};

We could use this clang-format file only fo= r the new patches and newly inserted lines. I am using VSCode IDE for devel= opment, and after some modification, I can select the modified lines and ap= ply formatting. It is very useful for these cases. Otherwise, we need to ha= ndle so many things.

By the way, I am still working on ma= cros. If you have any comments on this, I would be very happy to discuss it= .


...
--00000000000065313d0617570845--