From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxYa-0001Hh-F0 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:38:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxYW-0005iu-FF for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:38:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxYW-0005if-9S for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:38:00 -0400 References: <1441619584-17992-1-git-send-email-pbonzini@redhat.com> <1441619584-17992-3-git-send-email-pbonzini@redhat.com> <55ED8EA0.6040400@redhat.com> <55ED9DA9.80208@redhat.com> From: Thomas Huth Message-ID: <55EDA144.8000505@redhat.com> Date: Mon, 7 Sep 2015 16:37:56 +0200 MIME-Version: 1.0 In-Reply-To: <55ED9DA9.80208@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/4] CODING_STYLE, checkpatch: update line length rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Markus Armbruster , Andreas Faerber , Eduardo Habkost On 07/09/15 16:22, Paolo Bonzini wrote: >=20 > On 07/09/2015 15:18, Thomas Huth wrote: >> On 07/09/15 11:53, Paolo Bonzini wrote: >>> Line lengths above 80 characters do exist. They are rare, but >>> they happen from time to time. An ignored rule is worse than an >>> exception to the rule, so do the latter. >>> >>> Based on remarks from the list, make the preferred line length >>> slightly lower than 80 characters, to account for extra characters >>> in unified diffs (including three-way diffs) and for email quoting. >>> >>> Checkpatch has some code to detect doc comments that doesn't apply >>> to QEMU; the usual limits apply even for doc comments in our case. >>> >>> Signed-off-by: Paolo Bonzini >>> --- >>> CODING_STYLE | 13 ++++++++++--- >>> scripts/checkpatch.pl | 21 +++++++++++++++------ >>> 2 files changed, 25 insertions(+), 9 deletions(-) >>> >>> diff --git a/CODING_STYLE b/CODING_STYLE >>> index 3c6978f..34d5526 100644 >>> --- a/CODING_STYLE >>> +++ b/CODING_STYLE >>> @@ -31,14 +31,21 @@ Do not leave whitespace dangling off the ends of = lines. >>> =20 >>> 2. Line width >>> =20 >>> -Lines are 80 characters; not longer. >>> +Lines should be 76 characters; try not to make them longer. [...] >> Sorry, this is _ugly_! First, the limit in QEMU has always been 80 >> columns in the past, thus we've got tons of code that is written with = 80 >> columns already, so you suddenly even can not even copy-n-paste / move >> around code anymore that was valid before?!? That'll be a PITA since y= ou >> have to reformat all patches that move code around - and it will also = be >> a PITA for all reviewers since checking whether old code matches new >> code becomes more difficult. [...] > Some other interesting data: >=20 > - However, only 605 files have 5 or more lines with 77+ columns, so the > odds of warnings after copy-n-paste are pretty slim. Apart from copy-n-pasting, there is also the problem that you can run "checkpatch.pl -f" on a whole file ... it would also be ugly to suddenly have (much) more warnings here. > Based on the above data, I suggest having 79 columns as the limit (with > the "BSD exception" unfortunately). This still makes it possible to > watch diffs on an 80-column terminal without wrapping. 79 sounds at least better to me than 76. So if you really want to change the limit, please go for 79 instead of 76. Thomas