From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: update line length and mixed declaration rules
Date: Fri, 19 Jun 2015 10:09:53 +0200 [thread overview]
Message-ID: <5583CE51.3020206@suse.de> (raw)
In-Reply-To: <1434698944-3331-1-git-send-email-pbonzini@redhat.com>
Am 19.06.2015 um 09:29 schrieb Paolo Bonzini:
> 1) 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.
>
> 2) Mixed declarations also do exist at the top of #ifdef blocks.
> Remark on this particular usage and suggest an alternative.
>
> Cc: Andreas Faerber <afaerber@suse.de>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> CODING_STYLE | 21 ++++++++++++++++-----
> scripts/checkpatch.pl | 9 ++++++---
> 2 files changed, 22 insertions(+), 8 deletions(-)
>
> diff --git a/CODING_STYLE b/CODING_STYLE
> index d46cfa5..d013cb8 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -31,7 +31,11 @@ Do not leave whitespace dangling off the ends of lines.
>
> 2. Line width
>
> -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 subsystems
> +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 +/-/space) and
three-way diffs (78 chars plus 2x +/-/space) fitting into standard 80x24
windows.
Either way, can you please decouple the two changes?
Regards,
Andreas
>
> Rationale:
> - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
> @@ -39,6 +43,8 @@ Rationale:
> let them keep doing it.
> - Code and especially patches is much more readable if limited to a sane
> line length. Eighty is traditional.
> + - The four-space indentation makes the most common excuse ("But look
> + at all that white space on the left!") moot.
> - It is the QEMU coding style.
>
> 3. Naming
[snip]
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-06-19 8:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 7:29 [Qemu-devel] [PATCH] CODING_STYLE: update line length and mixed declaration rules Paolo Bonzini
2015-06-19 7:53 ` Thomas Huth
2015-06-19 7:55 ` Paolo Bonzini
2015-06-19 8:09 ` Andreas Färber [this message]
2015-06-19 8:38 ` Paolo Bonzini
2015-08-25 18:20 ` Markus Armbruster
2015-08-25 19:22 ` John Snow
2015-08-26 8:27 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5583CE51.3020206@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).