Received: from eggs.gnu.org ([2001:4830:134:3::10]:58529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUW35-0001h3-65 for qemu-devel@nongnu.org; Wed, 26 Aug 2015 04:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUW30-0000K7-7c for qemu-devel@nongnu.org; Wed, 26 Aug 2015 04:27:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUW2z-0000Jo-W7 for qemu-devel@nongnu.org; Wed, 26 Aug 2015 04:27:06 -0400 From: Markus Armbruster References: <1434698944-3331-1-git-send-email-pbonzini@redhat.com> <5583CE51.3020206@suse.de> <5583D4FD.1000300@redhat.com> <876143jklh.fsf@blackfin.pond.sub.org> <55DCC064.3070502@redhat.com> Date: Wed, 26 Aug 2015 10:27:02 +0200 In-Reply-To: <55DCC064.3070502@redhat.com> (John Snow's message of "Tue, 25 Aug 2015 15:22:12 -0400") Message-ID: <87y4gyv4ix.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: update line length and mixed declaration rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: Paolo Bonzini , qemu-devel@nongnu.org, Eduardo Habkost , Andreas =?utf-8?Q?F=C3=A4rber?= John Snow writes: > On 08/25/2015 02:20 PM, Markus Armbruster wrote: >> Paolo Bonzini writes: >>=20 >>> On 19/06/2015 10:09, Andreas F=C3=A4rber wrote: >>>>>> -Lines are 80 characters; not longer. >>>>>> +Lines should be 80 characters; try not to make them longer. >>>>>> + >>>>>> +Sometimes it is hard to do, especially when dealing with QEMU subsy= stems >>>>>> +that use long function or symbol names. Even in that case, do not = make >>>>>> +lines _much_ longer than 80 characters. >>>> Anthony had always allowed sensible exceptions to that rule, so +1 for >>>> reformulating it here. >>>> >>>> However, I would suggest that in that case we should lower the >>>> recommendation/warning to 78 chars, with the rationale of not only the >>>> actual code but also two-way diffs (79 chars plus =C2=B1/space) and >>>> three-way diffs (78 chars plus 2x =C2=B1/space) fitting into standard = 80x24 >>>> windows. >>> >>> Good idea. >>=20 >> I personally prefer a slightly lower limit, to keep quoted patches in >> e-mail neatly under 80. How much writability to trade for readability >> is subjective, and I won't argue against 78. >>=20 > > As long as we don't update the checkpatch tool to whine about this, > since it might break a good amount of existing context, and this will > just inconvenience everyone and provide no real benefit. > > Maybe if you can have it warn only for NEW lines and not for context, > but if that's not possible I'm against shortening the existing limit. > > IMO: The 80 char width rule makes good sense, but forcing the margins > even smaller on today's clearly-no-longer-a-terminal devices is just a > little too much. The reason for line length limit isn't antiquated hardware or antiquated habits, it's us antiquated human beings: we tend to have trouble following long lines with our eyes (I sure do). Typographic manuals suggest to limit columns to roughly 60 characters for exactly that reason[*]. Four levels of indentation plus 60 characters of actual text yields 76. > Of course, gently prodding people to reconsider their line length if > they are reliably approaching 75+ is another issue entirely... it just > shouldn't reflect as non-success via checkpatch. I think that's what Paolo's patch does. Namely: line shorter than the soft limit: fine line between soft and hard limit: warn line longer than the hard limit: error He kept the soft limit at 80, and set the hard limit to 90. Andreas suggested to lower the soft limit a bit, and I suggested to lower it a bit more. [...] [*] https://en.wikipedia.org/wiki/Column_(typography)#Typographic_style