mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jia He <hejianet@gmail.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Jia He <hejianet@gmail.com>,
	Jia He <jia.he@hxt-semitech.com>
Subject: [PATCH] checkpatch: relax check for revert commit
Date: Mon,  2 Apr 2018 07:28:59 -0700	[thread overview]
Message-ID: <1522679339-19067-2-git-send-email-hejianet@gmail.com> (raw)
In-Reply-To: <1522679339-19067-1-git-send-email-hejianet@gmail.com>

For revert commit, it might has two double quotation marks in its
commit log.

Relax the check condition for revert commit to avoid checkpatch
errors.

Signed-off-by: Jia He <jia.he@hxt-semitech.com>
---
 scripts/checkpatch.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3d40403..96138d6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2643,20 +2643,20 @@ sub process {
 			$long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i);
 			$space = 0 if ($line =~ /\bcommit [0-9a-f]/i);
 			$case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/);
-			if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) {
+			if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*)"\)/i) {
 				$orig_desc = $1;
 				$hasparens = 1;
 			} elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i &&
 				 defined $rawlines[$linenr] &&
-				 $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) {
+				 $rawlines[$linenr] =~ /^\s*\("(.*)"\)/) {
 				$orig_desc = $1;
 				$hasparens = 1;
-			} elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i &&
-				 defined $rawlines[$linenr] &&
-				 $rawlines[$linenr] =~ /^\s*[^"]+"\)/) {
-				$line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i;
+		       } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\(".*$/i &&
+				defined $rawlines[$linenr] &&
+				$rawlines[$linenr] =~ /^\s*.*"\)/) {
+				$line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*)$/i;
 				$orig_desc = $1;
-				$rawlines[$linenr] =~ /^\s*([^"]+)"\)/;
+				$rawlines[$linenr] =~ /^\s*(.*)"\)/;
 				$orig_desc .= " " . $1;
 				$hasparens = 1;
 			}
-- 
2.7.4

  reply	other threads:[~2018-04-02 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 14:28 [PATCH] relax check regex " Jia He
2018-04-02 14:28 ` Jia He [this message]
2018-04-08  2:12   ` [PATCH] checkpatch: relax check " Jia He
2018-04-08 17:07     ` Joe Perches
2018-04-09  6:37       ` Jia He
2018-04-09 10:50         ` Joe Perches
2018-04-10  2:42           ` Jia He

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=1522679339-19067-2-git-send-email-hejianet@gmail.com \
    --to=hejianet@gmail.com \
    --cc=apw@canonical.com \
    --cc=jia.he@hxt-semitech.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®