From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7835F2095DFE9 for ; Fri, 11 Aug 2017 15:50:24 -0700 (PDT) Received: by mail-it0-x22a.google.com with SMTP id 76so1408216ith.0 for ; Fri, 11 Aug 2017 15:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KmGxyMNiuKdNtZmKB5C/cZAMlh0bAYgKOYS4qSVdN+k=; b=PKOAFR3i/lcFP4n9AvI5v87/pE25PydmDdUS1y6JBQglBAgOIc93uI9mXN7lXDNKRs aFGPsMtcxm5XPhyaPpMS+9ltaAzFyNXwqQC7xbJW5yva3bqBOxVEfDyxRP8IuKJPbHKt 125FCdNH45DutuAWfj4aIpLFcLh879qMiM99I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KmGxyMNiuKdNtZmKB5C/cZAMlh0bAYgKOYS4qSVdN+k=; b=aqV+SW3wzeGQfhLJIOYyNLhX7YMdZN3VWW0hcnsQhx923ussF8lXTi4CUotZCUoMF4 /8LgXpuvcn+puCXEJvuRhkEw9wrzKe3KjB7V7UW9Sh45XrF5V05zLTjN21a4e//7jGe4 hWjnBKHZB4gmsSgIu6+0/3LSduW6sfQ56iR+eF7HoHrczCoi3tkhAMlgfH9LwTTz34XD 4nkTqjtYLB8GTtlSooKowfb366JHbaMfJEivvipmytA8uH4IqFpwIDoaWe3zahsjL2ai 9revZ3ExTn/LvEmLxFLLQgAZNn+g8WqDqgFgCEzgzE6A69GYwNzzQ6JtuRvzItazn9n8 3Zdg== X-Gm-Message-State: AHYfb5g030JI5crNE0sHragrE5RwbQVDZLOkwCr5EXheaq2Sk6OpDtYx phmVu7A/RZm8NRPx1nDYPVuWA6gdbBpP X-Received: by 10.36.175.76 with SMTP id l12mr229776iti.167.1502491964693; Fri, 11 Aug 2017 15:52:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.162.1 with HTTP; Fri, 11 Aug 2017 15:52:44 -0700 (PDT) In-Reply-To: <20170811164851.9466-2-lersek@redhat.com> References: <20170811164851.9466-1-lersek@redhat.com> <20170811164851.9466-2-lersek@redhat.com> From: Ard Biesheuvel Date: Fri, 11 Aug 2017 23:52:44 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Jordan Justen , Leif Lindholm , Michael D Kinney Subject: Re: [edk2-CCodingStandardsSpecification PATCH 1/2] Source Files / General Rules: limit line lengths to 80 columns X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2017 22:50:24 -0000 Content-Type: text/plain; charset="UTF-8" On 11 August 2017 at 17:48, Laszlo Ersek wrote: > We currently say "stick with 80 if it's convenient, extend to 120 > otherwise". It doesn't say that. It says you can make an exception for postfix comments, which is not unreasonable imo. This means most of the code in MdePkg/MdeModulePkg (afaik) already violates the old coding styile, so what good is it going to do to further restrict it? > This is too lax; much new edk2 code ignores the 80 columns > recommendation, resulting in source files that are hard to read for some > contributors. Remove the 120 columns excuse and make 80 columns a > requirement. > > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Leif Lindholm > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > 5_source_files/README.md | 17 ++++++++++++----- > README.md | 1 + > 2 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/5_source_files/README.md b/5_source_files/README.md > index a93492db4f0f..546d44d94fcb 100644 > --- a/5_source_files/README.md > +++ b/5_source_files/README.md > @@ -33,12 +33,19 @@ > > ## 5.1 General Rules > > -### 5.1.1 Lines shall be 120 columns, or less > +### 5.1.1 Lines shall be 80 columns, or less > > -Preferably, limit line lengths to 80 columns or less. When this doesn't leave > -sufficient space for a good postfix style comment, extend the line to a total > -of 120 columns. Having some level of uniformity in the expected width of the > -source is useful for viewing and printing the code. > +Limit line lengths to 80 columns. > + > +Lines longer than 80 columns make it more difficult for the reader to find the > +beginning of the next line. They also tend to prevent users from displaying two > +source listings side-by-side on common display devices. > + > +When the 80 columns limit doesn't leave sufficient space for a postfix style > +comment, break the line into shorter segments at logical boundaries (for > +example, between the arguments of a function call, adhering to the spacing > +rules), or replace the postfix style comment with a standalone comment that > +precedes the statement. > > ### 5.1.2 Do not use tab characters > > diff --git a/README.md b/README.md > index 8b9675b94937..8fad5a327b8c 100644 > --- a/README.md > +++ b/README.md > @@ -112,3 +112,4 @@ Copyright (c) 2006-2017, Intel Corporation. All rights reserved. > | 2.1 | DRAFT for REFORMAT | 10/30/2015 | > | 2.2 | Convert to Gitbook | June 2017 | > | | [#425](https://bugzilla.tianocore.org/show_bug.cgi?id=425) [CCS] clarify line breaking and indentation requirements for multi-line function calls | | > +| | Limit lines to 80 columns | | > -- > 2.13.1.3.g8be5a757fa67 > >