From: Joe Perches <joe@perches.com>
To: Jerome Forissier <jerome@forissier.org>,
Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: relax regexp for COMMIT_LOG_LONG_LINE
Date: Sat, 06 Nov 2021 00:25:01 -0700 [thread overview]
Message-ID: <a89c8bea1d0c82f3b5567f5972afdd1700cd3440.camel@perches.com> (raw)
In-Reply-To: <74572362-c45c-b10f-f825-2e8bb4e3b027@forissier.org>
On Fri, 2021-11-05 at 11:31 +0100, Jerome Forissier wrote:
> On 9/23/21 16:38, Jerome Forissier wrote:
> > One exceptions to the COMMIT_LOG_LONG_LINE rule is a file path followed
> > by :. That is typically some sort diagnostic message from a compiler or
> > a build tool, in which case we don't want to wrap the lines but keep the
> > message unmodified.
> > The regular expression used to match this pattern currently doesn't
> > accept absolute paths or + characters. This can result in false
> > positives as in the following (out-of-tree) example:
[]
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> > @@ -3147,7 +3147,7 @@ sub process {
> > length($line) > 75 &&
> > !($line =~ /^\s*[a-zA-Z0-9_\/\.]+\s+\|\s+\d+/ ||
> > # file delta changes
> > - $line =~ /^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:/ ||
> > + $line =~ /^\s*(?:[\w\.\-\+]*\/)++[\w\.\-\+]+:/ ||
> > # filename then :
I looked the number of new matches
$ git log --format=email -100000 | \
grep -P '^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:' | wc -l
21160
$ git log --format=email -100000 | \
grep -P '^\s*(?:[\w\.\-\+]*\/)++[\w\.\-]+:' | wc -l
21627
OK, so around 3% more matches.
And then looked only at these new matches
$ git log --format=email -100000 | \
grep -P '^\s*(?:[\w\.\-\+]*\/)++[\w\.\-]+:' | \
grep -P -v '^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:'
And all these new matches look OK to me to ignore for long lines.
Out of tree or not...
Acked-by: Joe Perches <joe@perches.com>
prev parent reply other threads:[~2021-11-06 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-23 14:38 Jerome Forissier
2021-11-05 10:31 ` Jerome Forissier
2021-11-06 7:25 ` Joe Perches [this message]
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=a89c8bea1d0c82f3b5567f5972afdd1700cd3440.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=jerome@forissier.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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
all inboxes | Powered by JetHome®