[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0382efac23a4fb18f31974b80f25558cada7243.camel@perches.com>
Date: Thu, 10 Dec 2020 10:13:40 -0800
From: Joe Perches <joe@...ches.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
apw@...onical.com, gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Fix "Missing a blank line after
declarations" test on patches
On Thu, 2020-12-10 at 18:52 +0100, Christophe JAILLET wrote:
> "Missing a blank line after declarations" is not triggered on patches.
That's not true.
It does work on any patch that does a new function addition.
There are some patch context complications here when lines are
added and removed such that '+' add, '-' delete, and ' ' context
testing isn't always obvious.
So, the code was intentionally limited to just new functions.
If there are simple ways to avoid false positives, great, but I
believe it's not trivial.
> Tweak the regex to match such cases.
Please send multiple patch examples of different forms where it
does not work.
> This patch is mostly a PoC. I don't know enough about checkpatch.pl to be
> sure that the fix is the right thing to do.
> At least, it works for me :)
Always a starting point...
>
> The [\+ ] is taken from the test just above.
>
> I also wonder if there is a missing ^ in the last test:
> (($prevline =~ /[\+ ](\s+)\S/) && $sline =~ /^[\+ ]$1\S/))
> ^
> |___ here
Powered by blists - more mailing lists