linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	David Laight <David.Laight@aculab.com>,
	Casey Schaufler <casey@schaufler-ca.com>,
	David Howells <dhowells@redhat.com>,
	Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Ian Kent <raven@themaw.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LSM List <linux-security-module@vger.kernel.org>,
	NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] checkpatch/coding-style: Allow 100 column lines
Date: Sat, 30 May 2020 16:14:01 -0600	[thread overview]
Message-ID: <F5AE90A2-1661-4B8E-A884-C3CBAB0F603F@dilger.ca> (raw)
In-Reply-To: <9c360bfa43580ce7726dd3d9d247f1216a690ef0.camel@perches.com>

[-- Attachment #1: Type: text/plain, Size: 4648 bytes --]

On May 29, 2020, at 5:12 PM, Joe Perches <joe@perches.com> wrote:
> 
> Change the maximum allowed line length to 100 from 80.

What is the benefit/motivation for changing this?  The vast majority
of files are wrapped at 80 columns, and if some files start being
wrapped at 100 columns they will either display poorly on 80-column
terminals, or a lot of dead space will show in 100-column terminals.

> Miscellanea:
> 
> o to avoid unnecessary whitespace changes in files,
>  checkpatch will no longer emit a warning about line length
>  when scanning files unless --strict is also used
> o Add a bit to coding-style about alignment to open parenthesis
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> Documentation/process/coding-style.rst | 25 ++++++++++++++++---------
> scripts/checkpatch.pl                  | 14 +++++++++-----
> 2 files changed, 25 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index acb2f1b36350..55b148e9c6b8 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -84,15 +84,22 @@ Get a decent editor and don't leave whitespace at the end of lines.
> Coding style is all about readability and maintainability using commonly
> available tools.
> 
> -The limit on the length of lines is 80 columns and this is a strongly
> -preferred limit.
> -
> -Statements longer than 80 columns will be broken into sensible chunks, unless
> -exceeding 80 columns significantly increases readability and does not hide
> -information. Descendants are always substantially shorter than the parent and
> -are placed substantially to the right. The same applies to function headers
> -with a long argument list. However, never break user-visible strings such as
> -printk messages, because that breaks the ability to grep for them.
> +The preferred limit on the length of a single line is 80 columns.
> +
> +Statements longer than 80 columns should be broken into sensible chunks,
> +unless exceeding 80 columns significantly increases readability and does
> +not hide information.
> +
> +Statements may be up to 100 columns when appropriate.
> +
> +Descendants are always substantially shorter than the parent and are
> +are placed substantially to the right.  A very commonly used style
> +is to align descendants to a function open parenthesis.
> +
> +These same rules are applied to function headers with a long argument list.
> +
> +However, never break user-visible strings such as printk messages because
> +that breaks the ability to grep for them.
> 
> 
> 3) Placing Braces and Spaces
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index dd750241958b..5f00df2c3f59 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -53,7 +53,7 @@ my %ignore_type = ();
> my @ignore = ();
> my $help = 0;
> my $configuration_file = ".checkpatch.conf";
> -my $max_line_length = 80;
> +my $max_line_length = 100;
> my $ignore_perl_version = 0;
> my $minimum_perl_version = 5.10.0;
> my $min_conf_desc_length = 4;
> @@ -99,9 +99,11 @@ Options:
>   --types TYPE(,TYPE2...)    show only these comma separated message types
>   --ignore TYPE(,TYPE2...)   ignore various comma separated message types
>   --show-types               show the specific message type in the output
> -  --max-line-length=n        set the maximum line length, if exceeded, warn
> +  --max-line-length=n        set the maximum line length, (default $max_line_length)
> +                             if exceeded, warn on patches
> +                             requires --strict for use with --file
>   --min-conf-desc-length=n   set the min description length, if shorter, warn
> -  --tab-size=n               set the number of spaces for tab (default 8)
> +  --tab-size=n               set the number of spaces for tab (default $tabsize)
>   --root=PATH                PATH to the kernel tree root
>   --no-summary               suppress the per-file summary
>   --mailback                 only produce a report in case of warnings/errors
> @@ -3282,8 +3284,10 @@ sub process {
> 
> 			if ($msg_type ne "" &&
> 			    (show_type("LONG_LINE") || show_type($msg_type))) {
> -				WARN($msg_type,
> -				     "line over $max_line_length characters\n" . $herecurr);
> +				my $msg_level = \&WARN;
> +				$msg_level = \&CHK if ($file);
> +				&{$msg_level}($msg_type,
> +					      "line length of $length exceeds $max_line_length columns\n" . $herecurr);
> 			}
> 		}
> 
> 


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

  reply	other threads:[~2020-05-30 22:14 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  5:40 clean up kernel_{read,write} & friends v2 Christoph Hellwig
2020-05-28  5:40 ` [PATCH 01/14] cachefiles: switch to kernel_write Christoph Hellwig
2020-05-28  5:40 ` [PATCH 02/14] autofs: " Christoph Hellwig
2020-05-28  5:40 ` [PATCH 03/14] bpfilter: " Christoph Hellwig
2020-05-28  5:40 ` [PATCH 04/14] fs: unexport __kernel_write Christoph Hellwig
2020-05-28  5:40 ` [PATCH 05/14] fs: check FMODE_WRITE in __kernel_write Christoph Hellwig
2020-05-28  5:40 ` [PATCH 06/14] fs: remove the call_{read,write}_iter functions Christoph Hellwig
2020-05-28 18:56   ` Al Viro
2020-05-29  5:51     ` Christoph Hellwig
2020-05-28  5:40 ` [PATCH 07/14] fs: implement kernel_write using __kernel_write Christoph Hellwig
2020-05-28  5:40 ` [PATCH 08/14] fs: remove __vfs_write Christoph Hellwig
2020-05-28  5:40 ` [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write Christoph Hellwig
2020-05-28 18:43   ` Linus Torvalds
2020-05-29 12:32     ` Christoph Hellwig
2020-05-31 23:59       ` Logan Gunthorpe
2020-05-28 19:00   ` Al Viro
2020-05-29  5:57     ` Christoph Hellwig
2020-05-29 13:37       ` Christoph Hellwig
2020-05-28  5:40 ` [PATCH 10/14] fs: add a __kernel_read helper Christoph Hellwig
2020-05-28  5:40 ` [PATCH 11/14] integrity/ima: switch to using __kernel_read Christoph Hellwig
2020-05-28  5:40 ` [PATCH 12/14] fs: implement kernel_read " Christoph Hellwig
2020-05-28  5:40 ` [PATCH 13/14] fs: remove __vfs_read Christoph Hellwig
2020-05-28  5:40 ` [PATCH 14/14] fs: don't change the address limit for ->read_iter in __kernel_read Christoph Hellwig
2020-05-28 19:03   ` Al Viro
2020-05-28 18:51 ` clean up kernel_{read,write} & friends v2 Linus Torvalds
2020-05-28 18:57   ` Sedat Dilek
2020-05-28 19:22   ` Joe Perches
2020-05-28 19:33     ` Al Viro
2020-05-28 19:44       ` Matthew Wilcox
2020-05-28 20:06         ` Al Viro
2020-05-28 20:14           ` Deucher, Alexander
2020-05-28 20:18         ` Joe Perches
2020-05-28 20:29       ` Dave Airlie
2020-05-28 21:03     ` Joe Perches
2020-05-28 20:17 ` David Howells
2020-05-28 21:20   ` Casey Schaufler
2020-05-29 13:08     ` David Laight
2020-05-29 19:19       ` Linus Torvalds
2020-05-29 22:02         ` Casey Schaufler
2020-05-29 23:12         ` [PATCH] checkpatch/coding-style: Allow 100 column lines Joe Perches
2020-05-30 22:14           ` Andreas Dilger [this message]
2020-05-30 23:15             ` Joe Perches
2020-06-05  6:36         ` clean up kernel_{read,write} & friends v2 Philippe Mathieu-Daudé
2020-06-05 15:00           ` Nicolas Pitre
2020-05-30 11:40 [PATCH] checkpatch/coding-style: Allow 100 column lines Markus Elfring

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=F5AE90A2-1661-4B8E-A884-C3CBAB0F603F@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=David.Laight@aculab.com \
    --cc=casey@schaufler-ca.com \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=joe@perches.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).