mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts: checkpatch.pl
@ 2010-06-23  9:49 Raffaele Recalcati
  2010-06-23  9:49 ` Raffaele Recalcati
  0 siblings, 1 reply; 4+ messages in thread
From: Raffaele Recalcati @ 2010-06-23  9:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Raffaele Recalcati, Andy Whitcroft, Andrew Morton, Daniel Walker,
	Joe Perches

From: Raffaele Recalcati <raffaele.recalcati@bticino.it>

I've got a false positive when spaces are present
at the beginning of a line.
So I add this check, obviously outside comments.
This patch is compatible with the actual mainline,
I mean 7e27d6e778cd87b6f2415515d7127eba53fe5d02 commit.

Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
---
 scripts/checkpatch.pl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a4d7434..315a827 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1433,6 +1433,13 @@ sub process {
 			WARN("please, no space before tabs\n" . $herevet);
 		}
 
+# check for spaces at the beginning of a line.
+		if ($rawline =~ /^\+ / && $rawline !~ /\+ +\*/)  {
+			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+			WARN("please, no space for starting a line, \
+				excluding comments\n" . $herevet);
+		}
+
 # check we are in a valid C source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c)$/);
 
-- 
1.7.0.4


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

* [PATCH] scripts: checkpatch.pl
  2010-06-23  9:49 [PATCH] scripts: checkpatch.pl Raffaele Recalcati
@ 2010-06-23  9:49 ` Raffaele Recalcati
  2010-06-23 19:27   ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Raffaele Recalcati @ 2010-06-23  9:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Raffaele Recalcati, Andy Whitcroft, Andrew Morton, Daniel Walker,
	Joe Perches

From: Raffaele Recalcati <raffaele.recalcati@bticino.it>

I've got a false positive when spaces are present
at the beginning of a line.
So I add this check, obviously outside comments.
This patch is compatible with the actual mainline,
I mean 7e27d6e778cd87b6f2415515d7127eba53fe5d02 commit.

Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
---
 scripts/checkpatch.pl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a4d7434..315a827 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1433,6 +1433,13 @@ sub process {
 			WARN("please, no space before tabs\n" . $herevet);
 		}
 
+# check for spaces at the beginning of a line.
+		if ($rawline =~ /^\+ / && $rawline !~ /\+ +\*/)  {
+			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+			WARN("please, no space for starting a line, \
+				excluding comments\n" . $herevet);
+		}
+
 # check we are in a valid C source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c)$/);
 
-- 
1.7.0.4


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

* Re: [PATCH] scripts: checkpatch.pl
  2010-06-23  9:49 ` Raffaele Recalcati
@ 2010-06-23 19:27   ` Andrew Morton
       [not found]     ` <AANLkTimYibiMB0wx2LSvj8InY_SSvBcO3AiH-0jdT8OG@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2010-06-23 19:27 UTC (permalink / raw)
  To: Raffaele Recalcati
  Cc: linux-kernel, Raffaele Recalcati, Andy Whitcroft, Daniel Walker,
	Joe Perches

On Wed, 23 Jun 2010 11:49:21 +0200
Raffaele Recalcati <lamiaposta71@gmail.com> wrote:

> From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
> 
> I've got a false positive when spaces are present
> at the beginning of a line.
> So I add this check, obviously outside comments.
> This patch is compatible with the actual mainline,
> I mean 7e27d6e778cd87b6f2415515d7127eba53fe5d02 commit.

I don't really understand that.  It would help if the changelog
were to include a copy of the code which triggers this "false
positive", and a copy of the incorrect checkpatch output.

Thanks.

> Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
> ---
>  scripts/checkpatch.pl |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a4d7434..315a827 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1433,6 +1433,13 @@ sub process {
>  			WARN("please, no space before tabs\n" . $herevet);
>  		}
>  
> +# check for spaces at the beginning of a line.
> +		if ($rawline =~ /^\+ / && $rawline !~ /\+ +\*/)  {
> +			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
> +			WARN("please, no space for starting a line, \
> +				excluding comments\n" . $herevet);
> +		}
> +
>  # check we are in a valid C source file if not then ignore this hunk
>  		next if ($realfile !~ /\.(h|c)$/);


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

* Re: [PATCH] scripts: checkpatch.pl
       [not found]     ` <AANLkTimYibiMB0wx2LSvj8InY_SSvBcO3AiH-0jdT8OG@mail.gmail.com>
@ 2010-08-17 16:39       ` Andy Whitcroft
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Whitcroft @ 2010-08-17 16:39 UTC (permalink / raw)
  To: Raffaele Recalcati
  Cc: Andrew Morton, linux-kernel, Raffaele Recalcati, Daniel Walker,
	Joe Perches

On Thu, Jun 24, 2010 at 08:27:30AM +0200, Raffaele Recalcati wrote:
> 2010/6/23 Andrew Morton <akpm@linux-foundation.org>
> 
> > On Wed, 23 Jun 2010 11:49:21 +0200
> > Raffaele Recalcati <lamiaposta71@gmail.com> wrote:
> >
> > > From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
> > >
> > > I've got a false positive when spaces are present
> > > at the beginning of a line.
> > > So I add this check, obviously outside comments.
> > > This patch is compatible with the actual mainline,
> > > I mean 7e27d6e778cd87b6f2415515d7127eba53fe5d02 commit.
> >
> > I don't really understand that.  It would help if the changelog
> > were to include a copy of the code which triggers this "false
> > positive", and a copy of the incorrect checkpatch.pl output.
> >
> > Thanks.
> >
> >
> Would be nice a changelog like this?
> 
> ----start changelog-----------
> I've got a false positive when spaces are present at the beginning of a
> line.
> So I add this check, obviously excluding to check the lines in the middle of
> comments.

This check seems to be causing regressions for valid combinations.  I
have a patch to this patch which seems to fix it, I am currently fixing
the test suite and test it generally.

Andrew, will get the delta up to you shortly.

-apw

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

end of thread, other threads:[~2010-08-17 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-23  9:49 [PATCH] scripts: checkpatch.pl Raffaele Recalcati
2010-06-23  9:49 ` Raffaele Recalcati
2010-06-23 19:27   ` Andrew Morton
     [not found]     ` <AANLkTimYibiMB0wx2LSvj8InY_SSvBcO3AiH-0jdT8OG@mail.gmail.com>
2010-08-17 16:39       ` Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome