From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A3B9C6FD20 for ; Fri, 24 Mar 2023 19:24:42 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 615BC406B8; Fri, 24 Mar 2023 20:24:41 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3012B4021F for ; Fri, 24 Mar 2023 20:24:39 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 772FC20FC447; Fri, 24 Mar 2023 12:24:38 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 772FC20FC447 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679685878; bh=cCIiA9ie7VQROiN/aoRIHc/QgXhBzTnJLAzb7DsyFNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F9u0WuLNPDzCYh/1sGNQ0ClZaOjauqTXgnWIiqAB45WF4INFbglvVOi6I+EOfxlLi TvSaRG953QygRLyM05NQca89HE0RoBLdBMmqkdy1TV6Ikw+uAHDvqClXIKUbPQIAFo vdyh0JhMWuGMgaDISjepf7zZZqj6d+MYyRSpDiJI= Date: Fri, 24 Mar 2023 12:24:38 -0700 From: Tyler Retzlaff To: Bruce Richardson Cc: Stephen Hemminger , dev@dpdk.org Subject: Re: [RFC 1/2] Add clang format file Message-ID: <20230324192438.GB7553@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230322170655.45166-1-stephen@networkplumber.org> <20230322170655.45166-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Fri, Mar 24, 2023 at 03:53:25PM +0000, Bruce Richardson wrote: > On Wed, Mar 22, 2023 at 10:06:54AM -0700, Stephen Hemminger wrote: > > Based off of Linux kernel style with some local modifications > > and DPDK foreach macros. > > > > A couple of open questions to be resolved befor merging. > > Is GPL license ok for config file (inherited from Linux here)? > > Do we want to have per-driver files for some drivers (like MLX5)? > > > > Signed-off-by: Stephen Hemminger > > --- > > .clang-format | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 181 insertions(+) > > create mode 100644 .clang-format > > > > diff --git a/.clang-format b/.clang-format > > new file mode 100644 > > index 000000000000..ad4d30520253 > > --- /dev/null > > +++ b/.clang-format > > @@ -0,0 +1,181 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +# > > +# clang-format configuration file. Intended for clang-format >= 11. > > +# > > +# For more information, see: > > +# > > +# Documentation/process/clang-format.rst > > +# https://clang.llvm.org/docs/ClangFormat.html > > +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html > > +# > > +--- > > +AccessModifierOffset: -4 > > +AlignAfterOpenBracket: Align > > This may be partially a matter of personal preference, but I disagree with > using this setting. This sets up line continuations with varaible widths, > and leads to: > * continuation lines being very short if the function name in a wrapped > call is long > * indentation using a mix of tabs and spaces as it tries to line up exactly > on a column with brackets +1 i find alignment to open bracket terrible. it also blows out to multiple line diffs if something like a function name is changed and there are parameters on following lines. > > I think a better option for this setting, which is also aligned with our > coding rules, is for this to be set to "DontAlign" and the > "ContinuationIndentWidth" set to 16, leading to double-tab continuations > (at least in my testing). > > /Bruce