linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: add test for empty line after Fixes statement
@ 2019-05-20 12:42 Michal Kalderon
  2019-05-20 12:56 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Kalderon @ 2019-05-20 12:42 UTC (permalink / raw)
  To: michal.kalderon, leon, apw, joe; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 12:42 [PATCH] checkpatch: add test for empty line after Fixes statement Michal Kalderon
@ 2019-05-20 12:56 ` Joe Perches
  2019-05-20 13:16   ` Leon Romanovsky
  2019-05-20 13:16   ` [EXT] " Michal Kalderon
  0 siblings, 2 replies; 7+ messages in thread
From: Joe Perches @ 2019-05-20 12:56 UTC (permalink / raw)
  To: Michal Kalderon, leon, apw; +Cc: linux-kernel

On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> Check that there is no empty line after a fixes statement

why?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 12:56 ` Joe Perches
@ 2019-05-20 13:16   ` Leon Romanovsky
  2019-05-20 13:16   ` [EXT] " Michal Kalderon
  1 sibling, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2019-05-20 13:16 UTC (permalink / raw)
  To: Joe Perches; +Cc: Michal Kalderon, apw, linux-kernel

On Mon, May 20, 2019 at 05:56:36AM -0700, Joe Perches wrote:
> On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> > Check that there is no empty line after a fixes statement
>
> why?

It is common mistake for Gerrit users, they are removing
their ChangeID crap with some wrong sed command which leaves
empty line.

You can argue that this should be fixed on the client side and I agree,
nut because the checkpatch check is so easy, it is worth to add it and
save reviewers time.

Thanks

>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 12:56 ` Joe Perches
  2019-05-20 13:16   ` Leon Romanovsky
@ 2019-05-20 13:16   ` Michal Kalderon
  2019-05-20 13:34     ` Joe Perches
  1 sibling, 1 reply; 7+ messages in thread
From: Michal Kalderon @ 2019-05-20 13:16 UTC (permalink / raw)
  To: Joe Perches, leon, apw; +Cc: linux-kernel, David Miller

> From: Joe Perches <joe@perches.com>
> Sent: Monday, May 20, 2019 3:57 PM
> Subject: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes
> statement
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> > Check that there is no empty line after a fixes statement
> 
> why?
> 
This comment is given a lot on the netdev and rdma mailing lists when patches are submitted with
an empty line between Fixes: tag and SOB tags. Since "Fixes:" is just another tag and should be kept
together with the other ones.
thanks,
Michal

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 13:16   ` [EXT] " Michal Kalderon
@ 2019-05-20 13:34     ` Joe Perches
  2019-05-20 13:52       ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2019-05-20 13:34 UTC (permalink / raw)
  To: Michal Kalderon, leon, apw; +Cc: linux-kernel, David Miller

On Mon, 2019-05-20 at 13:16 +0000, Michal Kalderon wrote:
> > From: Joe Perches <joe@perches.com>
> > Sent: Monday, May 20, 2019 3:57 PM
> > Subject: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes
> > statement
> > 
> > External Email
> > 
> > ----------------------------------------------------------------------
> > On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> > > Check that there is no empty line after a fixes statement
> > 
> > why?
> > 
> This comment is given a lot on the netdev and rdma mailing lists when patches are submitted with
> an empty line between Fixes: tag and SOB tags. Since "Fixes:" is just another tag and should be kept
> together with the other ones.

So test that all signature blocks and Fixes do not have
blank lines between them instead of just the "Fixes:" line.

And if there is some specific ordering required, perhaps a
test for that ordering should be added as well.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 13:34     ` Joe Perches
@ 2019-05-20 13:52       ` Leon Romanovsky
  2019-05-21  0:07         ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2019-05-20 13:52 UTC (permalink / raw)
  To: Joe Perches; +Cc: Michal Kalderon, apw, linux-kernel, David Miller

On Mon, May 20, 2019 at 06:34:49AM -0700, Joe Perches wrote:
> On Mon, 2019-05-20 at 13:16 +0000, Michal Kalderon wrote:
> > > From: Joe Perches <joe@perches.com>
> > > Sent: Monday, May 20, 2019 3:57 PM
> > > Subject: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes
> > > statement
> > >
> > > External Email
> > >
> > > ----------------------------------------------------------------------
> > > On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> > > > Check that there is no empty line after a fixes statement
> > >
> > > why?
> > >
> > This comment is given a lot on the netdev and rdma mailing lists when patches are submitted with
> > an empty line between Fixes: tag and SOB tags. Since "Fixes:" is just another tag and should be kept
> > together with the other ones.
>
> So test that all signature blocks and Fixes do not have
> blank lines between them instead of just the "Fixes:" line.
>
> And if there is some specific ordering required, perhaps a
> test for that ordering should be added as well.

I'm aware of only one request - Fixes above SOB.

Thanks

>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes statement
  2019-05-20 13:52       ` Leon Romanovsky
@ 2019-05-21  0:07         ` Joe Perches
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2019-05-21  0:07 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Michal Kalderon, apw, linux-kernel, David Miller

On Mon, 2019-05-20 at 16:52 +0300, Leon Romanovsky wrote:
> On Mon, May 20, 2019 at 06:34:49AM -0700, Joe Perches wrote:
> > On Mon, 2019-05-20 at 13:16 +0000, Michal Kalderon wrote:
> > > > From: Joe Perches <joe@perches.com>
> > > > Sent: Monday, May 20, 2019 3:57 PM
> > > > Subject: [EXT] Re: [PATCH] checkpatch: add test for empty line after Fixes
> > > > statement
> > > > 
> > > > External Email
> > > > 
> > > > ----------------------------------------------------------------------
> > > > On Mon, 2019-05-20 at 15:42 +0300, Michal Kalderon wrote:
> > > > > Check that there is no empty line after a fixes statement
> > > > 
> > > > why?
> > > > 
> > > This comment is given a lot on the netdev and rdma mailing lists when patches are submitted with
> > > an empty line between Fixes: tag and SOB tags. Since "Fixes:" is just another tag and should be kept
> > > together with the other ones.
> > 
> > So test that all signature blocks and Fixes do not have
> > blank lines between them instead of just the "Fixes:" line.
> > 
> > And if there is some specific ordering required, perhaps a
> > test for that ordering should be added as well.
> 
> I'm aware of only one request - Fixes above SOB.

Well, nack for the suggested patch.

If there are signature blocks, then there should not be blank lines
between entries and there should be a blank line before the
signature block.

The current documentation in Documentation/process/submitting-patches.rst
doesn't state anything about blank lines above or below Fixes: lines.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-21  0:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20 12:42 [PATCH] checkpatch: add test for empty line after Fixes statement Michal Kalderon
2019-05-20 12:56 ` 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

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).