From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BE70F2007D094 for ; Fri, 11 Aug 2017 13:50:21 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 11 Aug 2017 13:52:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,359,1498546800"; d="scan'208";a="299169962" Received: from ajblattn-mobl3.amr.corp.intel.com (HELO localhost) ([10.252.204.55]) by fmsmga004.fm.intel.com with ESMTP; 11 Aug 2017 13:52:41 -0700 MIME-Version: 1.0 To: Laszlo Ersek , edk2-devel-01 Message-ID: <150248476137.29687.1735313339866839684@jljusten-skl> From: Jordan Justen In-Reply-To: <20170811164851.9466-2-lersek@redhat.com> Cc: Ard Biesheuvel , Leif Lindholm , Michael D Kinney References: <20170811164851.9466-1-lersek@redhat.com> <20170811164851.9466-2-lersek@redhat.com> User-Agent: alot/0.5.1 Date: Fri, 11 Aug 2017 13:52:41 -0700 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 20:50:21 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2017-08-11 09:48:50, Laszlo Ersek wrote: > We currently say "stick with 80 if it's convenient, extend to 120 > otherwise". 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 fi= nd the > +beginning of the next line. They also tend to prevent users from display= ing two > +source listings side-by-side on common display devices. > + > +When the 80 columns limit doesn't leave sufficient space for a postfix s= tyle > +comment, break the line into shorter segments at logical boundaries (for > +example, between the arguments of a function call, adhering to the spaci= ng > +rules), or replace the postfix style comment with a standalone comment t= hat > +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 right= s 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=3D425= ) [CCS] clarify line breaking and indentation requirements for multi-line f= unction calls | | > +| | Limit lines to 80 columns = = | | Prompting the question as to whether the markdown for this table could reasonably be expressed in less that 173 columns? :) Reviewed-by: Jordan Justen