From: Michal Kalderon <michal.kalderon@marvell.com>
To: <michal.kalderon@marvell.com>, <leon@kernel.org>,
<apw@canonical.com>, <joe@perches.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] checkpatch: add test for empty line after Fixes statement
Date: Mon, 20 May 2019 15:42:38 +0300 [thread overview]
Message-ID: <20190520124238.10298-1-michal.kalderon@marvell.com> (raw)
Check that there is no empty line after a fixes statement
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
---
scripts/checkpatch.pl | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a09333fd7cef..6cbc07364d4f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -62,6 +62,7 @@ my $conststructsfile = "$D/const_structs.checkpatch";
my $typedefsfile = "";
my $color = "auto";
my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
+my $fixes = 0;
sub help {
my ($exitcode) = @_;
@@ -2792,6 +2793,18 @@ sub process {
}
}
+# Check if Fixes statement to make sure next line is not blank
+ if ($fixes) {
+ if ($line =~ /^\s*$/) {
+ WARN("EMPTY_LINE_AFTER_FIXES", "No Empty line after Fixes statement\n" . $here);
+ }
+ $fixes = 0;
+ }
+
+ if ($in_commit_log && $line =~ /Fixes/) {
+ $fixes = 1;
+ }
+
# Check for added, moved or deleted files
if (!$reported_maintainer_file && !$in_commit_log &&
($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
--
2.14.5
next reply other threads:[~2019-05-20 12:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 12:42 Michal Kalderon [this message]
2019-05-20 12:56 ` [PATCH] checkpatch: add test for empty line after Fixes statement Joe Perches
2019-05-20 13:16 ` Leon Romanovsky
2019-05-20 13:16 ` [EXT] " Michal Kalderon
2019-05-20 13:34 ` Joe Perches
2019-05-20 13:52 ` Leon Romanovsky
2019-05-21 0:07 ` 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=20190520124238.10298-1-michal.kalderon@marvell.com \
--to=michal.kalderon@marvell.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=leon@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).