From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C20BA04FD; Wed, 10 Jun 2020 10:48:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3343D2B83; Wed, 10 Jun 2020 10:48:07 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 964442A5D for ; Wed, 10 Jun 2020 10:48:05 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id q8so1261518iow.7 for ; Wed, 10 Jun 2020 01:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mVXw9y/Et2DYnDLpsXVqp3TeEJI0Hsds4y9nOsegldY=; b=feKZnQTd8hvQAbmXIMygOeaENmisK+yYeqNEXfCrXmyq7C2lwfWP6s2LjGkwIHi0lb ZMzmJ+Gz91fwq0jgzXJ+V3h1dqdCJlBkE7aiYVUayG4n/8LjE0R/V0709lafHj4FAGX6 57bXeDWAvLYNSAvUycwFalesMUscWCgCFlfJK6JpkxJpNInr48xq57rueArTEJ+Lxz+s 8SUuAjdGmr8X8aIbPtAn4k89CaLqPaFBE8I1nhmNNxG9Yi5IWgHqnBuuSoYoiYsrO+Zr ioTkruIidh+Y6cTEiVl3YpCyzgTm84sfu7KeF+GjSNpb++EWfC9kSxYInJ2KmZPQImPe jfbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mVXw9y/Et2DYnDLpsXVqp3TeEJI0Hsds4y9nOsegldY=; b=kqmgiQYNmlbp0f8oTjvDyhOYWj6RH60zzYvN1uM+WHrD85OL5Fan5OWoa91ZfuuKTh wj837mqb0jOgLzkhTIyHu21DSInRZD3xlcq/NX4jcN1grPhpdz6/Jc6KApZFlSxwjbX6 JKsACASJfrMEnpCeiZwWCSWh+O2vLUG50IPCJw6hG5+kspMljYyOUVysYpCR3OV/VLX6 cEdQlVUzBijypSI2O3BO9nSaNo6sz01ObYfWDfEeja6M8n9IPIcNmf0MzC37JjgCUpVN vqg5+4YgRDLJxD7Xlspmx+cabSlRVXOkDOgAODyfVVdpUYvO8KLEwGJ9gnZd1sFu9fPd h+gA== X-Gm-Message-State: AOAM532tuetzxN7Rv+V956Qz3N/H23CZ2JI8rxs/fAKCrsXNCcafgKIH P1gjVkWhqsN3oKy2naMT9Kz1iWS7CfzFjVqepg8= X-Google-Smtp-Source: ABdhPJxJZUEiTmGZED77HKG4Wsj5sL3Z/RGfmHwmAROYz8W/tAs/EWSdhNFq+cl9n6VYjU7BLuS2xE5l6AGVVXZ4t28= X-Received: by 2002:a02:a91a:: with SMTP id n26mr2148096jam.104.1591778884585; Wed, 10 Jun 2020 01:48:04 -0700 (PDT) MIME-Version: 1.0 References: <20200608164640.189755-1-bruce.richardson@intel.com> <20200608121723.7a042105@hermes.lan> <20200609092949.GA1565@bricha3-MOBL.ger.corp.intel.com> <5710188e-4bba-c909-34cb-1bb67cbc3af0@solarflare.com> <20200609135717.GA1583@bricha3-MOBL.ger.corp.intel.com> <4e577242-6e2e-03ba-b299-297c5cdf05d5@solarflare.com> In-Reply-To: <4e577242-6e2e-03ba-b299-297c5cdf05d5@solarflare.com> From: Jerin Jacob Date: Wed, 10 Jun 2020 14:17:48 +0530 Message-ID: To: Andrew Rybchenko Cc: Bruce Richardson , "Ananyev, Konstantin" , Stephen Hemminger , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH RFC] devtools: increase default line length to 100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 10, 2020 at 1:57 PM Andrew Rybchenko wrote: > > On 6/10/20 8:22 AM, Jerin Jacob wrote: > > On Tue, Jun 9, 2020 at 7:27 PM Bruce Richardson > > wrote: > >> > >> On Tue, Jun 09, 2020 at 04:40:28PM +0300, Andrew Rybchenko wrote: > >>> On 6/9/20 1:00 PM, Ananyev, Konstantin wrote: > >>>> > >>>>> > >>>>> On Mon, Jun 08, 2020 at 12:17:23PM -0700, Stephen Hemminger wrote: > >>>>>> On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson > >>>>>> wrote: > >>>>>> > >>>>>>> Rather than continuing to recommend an 80-char line limit, let's > >>>>>>> take a hint from the Linux kernel[1] and aim for an 100-char > >>>>>>> recommended limit instead. > >>>>>>> > >>>>>>> [1] > >>>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144 > >>>>>>> > >>>>>>> Signed-off-by: Bruce Richardson --- > >>>>>>> devtools/checkpatches.sh | 2 +- > >>>>>>> doc/guides/contributing/coding_style.rst | 2 +- 2 files changed, 2 > >>>>>>> insertions(+), 2 deletions(-) > >>>>>>> > >>>>>>> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh > >>>>>>> index 158087f1c..4970ed830 100755 --- a/devtools/checkpatches.sh +++ > >>>>>>> b/devtools/checkpatches.sh @@ -15,7 +15,7 @@ > >>>>>>> VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh > >>>>>>> # Codespell can also be enabled by setting DPDK_CHECKPATCH_CODESPELL > >>>>>>> to a valid path # to a dictionary.txt file if dictionary.txt is not > >>>>>>> in the default location. > >>>>>>> codespell=${DPDK_CHECKPATCH_CODESPELL:-enable} > >>>>>>> -length=${DPDK_CHECKPATCH_LINE_LENGTH:-80} > >>>>>>> +length=${DPDK_CHECKPATCH_LINE_LENGTH:-100} > >>>>>>> > >>>>>>> # override default Linux options options="--no-tree" diff --git > >>>>>>> a/doc/guides/contributing/coding_style.rst > >>>>>>> b/doc/guides/contributing/coding_style.rst index > >>>>>>> 4efde93f6..1db3a7bbe 100644 --- > >>>>>>> a/doc/guides/contributing/coding_style.rst +++ > >>>>>>> b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The > >>>>>>> rules and guidelines given in this document cannot cover every > >>>>>>> situation, so * In the case of creating new files, the style should > >>>>>>> be consistent within each file in a given directory or module. * > >>>>>>> The primary reason for coding standards is to increase code > >>>>>>> readability and comprehensibility, therefore always use whatever > >>>>>>> option > >>>>> will make the code easiest to read. > >>>>>>> > >>>>>>> -Line length is recommended to be not more than 80 characters, > >>>>>>> including comments. +Line length is recommended to be not more than > >>>>>>> 100 characters, including comments. [Tab stop size should be > >>>>>>> assumed to be 8-characters wide]. > >>>>>>> > >>>>>>> .. note:: > >>>>>> > >>>>>> I would even support going to 120 characters. > >>>>>> > >>>>>> Acked-by: Stephen Hemminger > >>>>> > >>>>> I think 100 is enough. > >>>>> > >>>>> In my case, I have a 1080p 24" monitor, and with two terminals > >>>>> side-by-side 100 characters just fits inside each vim window. Going to > >>>>> 120 would be fine for single terminal at a time, but I would find > >>>>> awkward for e.g. side-by-side diff comparison in meld etc. > >>>> > >>>> My preference would be to keep things as it is - 80 chars per line. > >>>> Having multiple different formatting styles in one source file looks > >>>> really awkward and make it hard to follow. > >>> > >>> +1 > >>> > >> I wouldn't personally consider increasing the max line length as a style > >> change, but even if you consider it such I'd worry about rejecting style > >> changes on the basis that it may be different to what is there before. That > >> logic means that we can never, ever change any element of DPDK coding style. > >> > >> I can see the issue with changes that require us to rework the style of > >> code in order to comply with the new style, but changing the max length > >> from 80 to 100 does not make 80-char lines incorrect and needing changes. > > > > Another point is: Other projects derived from the Linux kernel coding > > standard also > > getting migrated to the new coding standard. This change would be useful for: > > a) People works on multiple Linux coding standard derived projects > > Valid point, but not really strong. > I think that .editorconfig solves it. Yes, For adding the code. I meaning, Viewing the code there will be a disparity. > > > b) Some of the code such as 'base' and 'common' code for HW drivers > > are shared between multiple projects. > > Such code needs adjustment/change when pulling to the DPDK code base > > it it still follows 80 chars per line. > > Base and common code are not required to follow DPDK coding > style even now. I see, I dont think it is expressed in devtools/checkpatches.sh. I.e CI tools still flag as checkpatch issues. Coming to original concern:(code disparity with existing code) Another option is, It is possible to change existing code to 100 lines with clang-format in an automatic fashion. But it will have a lot of changes. "C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, IndentWidth: 8, TabWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 100, AllowShortFunctionsOnASingleLine: false, AlwaysBreakAfterReturnType: AllDefinitions, ColumnLimit: 100, ConstructorInitializerAllOnOneLineOrOnePerLine: true, ConstructorInitializerIndentWidth: 8, ContinuationIndentWidth: 8, BreakBeforeBraces: Linux, AllowShortBlocksOnASingleLine: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Right, AlignConsecutiveMacros : true, MaxEmptyLinesToKeep : 1, Cpp11BracedListStyle : true, AlignTrailingComments : true, ForEachMacros: ['TAILQ_FOREACH_SAFE', STAILQ_FOREACH', 'rte_graph_foreach_node', 'TAILQ_FOREACH', 'RTE_ETH_FOREACH_DEV']}",