linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Elliott <elliott@hpe.com>
To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com,
	lukas.bulwahn@gmail.com
Cc: linux-kernel@vger.kernel.org, Robert Elliott <elliott@hpe.com>
Subject: [PATCH v2 2/5] checkpatch: don't sanitise quotes in Kconfig files
Date: Tue, 22 Nov 2022 19:11:59 -0600	[thread overview]
Message-ID: <20221123011202.939319-3-elliott@hpe.com> (raw)
In-Reply-To: <20221123011202.939319-1-elliott@hpe.com>

If Kconfig help text contains a single quote (e.g., can't),
checkpatch replaces all characters with X until another quote
appears in some later help text. This interferes with processing
keywords.

Don't sanitise lines if the file is a Kconfig file.

Signed-off-by: Robert Elliott <elliott@hpe.com>
---
 scripts/checkpatch.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1d9e563e768a..c907d5cf0ac8 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2715,9 +2715,15 @@ sub process {
 			sanitise_line_reset($in_comment);
 
 		} elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) {
-			# Standardise the strings and chars within the input to
-			# simplify matching -- only bother with positive lines.
-			$line = sanitise_line($rawline);
+			if (($realfile =~ /Kconfig/) ||
+			    (!$is_patch && $filename =~ /Kconfig/)) {
+				# Kconfig help text is free to use unmatched quotes
+				$line = $rawline;
+			} else {
+				# Standardise the strings and chars within the input to
+				# simplify matching -- only bother with positive lines.
+				$line = sanitise_line($rawline);
+			}
 		}
 		push(@lines, $line);
 
-- 
2.38.1


  parent reply	other threads:[~2022-11-23  1:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15  4:15 [PATCH 0/3] checkpatch: enhance Kconfig parsing Robert Elliott
2022-08-15  4:15 ` [PATCH 1/3] checkpatch: improve Kconfig help text patch parsing Robert Elliott
2022-08-15  4:15 ` [PATCH 2/3] checkpatch: don't sanitise quotes in Kconfig files Robert Elliott
2022-08-15  4:15 ` [PATCH 3/3] checkpatch: check line length in Kconfig help text Robert Elliott
2022-11-23  1:11 ` [PATCH v2 0/5] checkpatch: enhance Kconfig parsing Robert Elliott
2022-11-23  1:11   ` [PATCH v2 1/5] checkpatch: improve Kconfig help text patch parsing Robert Elliott
2022-11-24  1:09     ` Joe Perches
2022-11-23  1:11   ` Robert Elliott [this message]
2022-11-23  1:12   ` [PATCH v2 3/5] checkpatch: check line length in Kconfig help text Robert Elliott
2022-11-24  1:04     ` Joe Perches
2022-11-23  1:12   ` [PATCH v2 4/5] checkpatch: discard processed lines Robert Elliott
2022-11-24  1:07     ` Joe Perches
2022-11-23  1:12   ` [PATCH v2 5/5] checkpatch: ignore a file named b Robert Elliott
2022-11-24  1:08     ` Joe Perches

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=20221123011202.939319-3-elliott@hpe.com \
    --to=elliott@hpe.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --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;
as well as URLs for NNTP newsgroup(s).