Re: [PATCH v2] checkpatch: add double empty line check

2012-11-21 Thread Eilon Greenstein
On Wed, 2012-11-21 at 07:01 -0800, Joe Perches wrote: > checkpatch isn't a perfect tool. Given how it's constructed, > I doubt it ever could be. Joe - I completely agree, this is why I'm not to concern about the potential miss in the version I suggested. Thanks, Eilon -- To unsubscribe from t

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-21 Thread Joe Perches
On Wed, 2012-11-21 at 11:42 +0200, Eilon Greenstein wrote: > On Tue, 2012-11-20 at 15:41 -0800, Joe Perches wrote: > > On Tue, 2012-11-20 at 23:19 +, Andy Whitcroft wrote: > > > On Tue, Nov 20, 2012 at 01:58:48PM -0800, Joe Perches wrote: > > > > > > > +# check for multiple blank lines, warn o

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-21 Thread Eilon Greenstein
On Tue, 2012-11-20 at 15:41 -0800, Joe Perches wrote: > On Tue, 2012-11-20 at 23:19 +, Andy Whitcroft wrote: > > On Tue, Nov 20, 2012 at 01:58:48PM -0800, Joe Perches wrote: > > > > > +# check for multiple blank lines, warn only on the second one in a block > > > + if ($rawline =~ /^.\

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Joe Perches
On Tue, 2012-11-20 at 23:19 +, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 01:58:48PM -0800, Joe Perches wrote: > > > +# check for multiple blank lines, warn only on the second one in a block > > + if ($rawline =~ /^.\s*$/ && > > + $prevrawline =~ /^.\s*$/ && > > +

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 01:58:48PM -0800, Joe Perches wrote: > +# check for multiple blank lines, warn only on the second one in a block > + if ($rawline =~ /^.\s*$/ && > + $prevrawline =~ /^.\s*$/ && > + $linenr != $last_blank_linenr + 1) { > +

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Joe Perches
On Tue, 2012-11-20 at 11:52 +, Andy Whitcroft wrote: > On Sat, Nov 17, 2012 at 01:17:37PM +0200, Eilon Greenstein wrote: > > Changes from previous attempt: > > - Use CHK instead of WARN > > - Issue only one warning per empty lines block > > > > Signed-off-by: Eilon Greenstein > > --- > > scr

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 20:11 +, Andy Whitcroft wrote: > > > > Actually the version I sent should indeed cope with the deleted lines > > regardless of order. It was cirtainly intended to. > > ... and I think I thought of a couple more corner cases neither solution > will find. So I am going t

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 07:32:49PM +, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 09:10:35PM +0200, Eilon Greenstein wrote: > > > About the logic - true, if diff will show deleted lines after newly > > added lines, some new double line segments will be missed. However, it > > seems like fe

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 09:10:35PM +0200, Eilon Greenstein wrote: > About the logic - true, if diff will show deleted lines after newly > added lines, some new double line segments will be missed. However, it > seems like few other things will break if diff will start acting out > like that. The s

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 18:36 +0200, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 04:14:17PM +, Andy Whitcroft wrote: > > On Tue, Nov 20, 2012 at 06:06:10PM +0200, Eilon Greenstein wrote: > > > I'm only testing the nextline if the current line is newly added. If I > > > got it right, when a li

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 06:22:24PM +0200, Eilon Greenstein wrote: > On Tue, 2012-11-20 at 16:14 +, Andy Whitcroft wrote: > > On Tue, Nov 20, 2012 at 06:06:10PM +0200, Eilon Greenstein wrote: > > > I'm only testing the nextline if the current line is newly added. If I > > > got it right, when a

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 04:14:17PM +, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 06:06:10PM +0200, Eilon Greenstein wrote: > > I'm only testing the nextline if the current line is newly added. If I > > got it right, when a line is newly added, the next line can be: > > a. another new line

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 16:14 +, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 06:06:10PM +0200, Eilon Greenstein wrote: > > I'm only testing the nextline if the current line is newly added. If I > > got it right, when a line is newly added, the next line can be: > > a. another new line > > b.

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 06:06:10PM +0200, Eilon Greenstein wrote: > I'm only testing the nextline if the current line is newly added. If I > got it right, when a line is newly added, the next line can be: > a. another new line > b. existing line (provided for context) > c. Does not exist since this

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 15:44 +, Andy Whitcroft wrote: > On Tue, Nov 20, 2012 at 05:07:07PM +0200, Eilon Greenstein wrote: > > On Tue, 2012-11-20 at 14:43 +, Andy Whitcroft wrote: > > > > > > > Also this fails if the fragment > > > > > is at the top of the hunk emiting a perl warning. > > >

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 05:07:07PM +0200, Eilon Greenstein wrote: > On Tue, 2012-11-20 at 14:43 +, Andy Whitcroft wrote: > > > > > Also this fails if the fragment > > > > is at the top of the hunk emiting a perl warning. > > > > > > I did not see this warning. Can you please share this exampl

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 14:43 +, Andy Whitcroft wrote: > > > Also this fails if the fragment > > > is at the top of the hunk emiting a perl warning. > > > > I did not see this warning. Can you please share this example? I tried > > adding a couple of empty lines at the beginning of a file and i

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Tue, Nov 20, 2012 at 04:27:04PM +0200, Eilon Greenstein wrote: > On Tue, 2012-11-20 at 11:52 +, Andy Whitcroft wrote: > > Andy, thanks for reviewing this patch. > > > On Sat, Nov 17, 2012 at 01:17:37PM +0200, Eilon Greenstein wrote: > > > Changes from previous attempt: > > > - Use CHK inst

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Eilon Greenstein
On Tue, 2012-11-20 at 11:52 +, Andy Whitcroft wrote: Andy, thanks for reviewing this patch. > On Sat, Nov 17, 2012 at 01:17:37PM +0200, Eilon Greenstein wrote: > > Changes from previous attempt: > > - Use CHK instead of WARN > > - Issue only one warning per empty lines block > > > > Signed-o

Re: [PATCH v2] checkpatch: add double empty line check

2012-11-20 Thread Andy Whitcroft
On Sat, Nov 17, 2012 at 01:17:37PM +0200, Eilon Greenstein wrote: > Changes from previous attempt: > - Use CHK instead of WARN > - Issue only one warning per empty lines block > > Signed-off-by: Eilon Greenstein > --- > scripts/checkpatch.pl |8 > 1 file changed, 8 insertions(+) >

[PATCH v2] checkpatch: add double empty line check

2012-11-17 Thread Eilon Greenstein
Changes from previous attempt: - Use CHK instead of WARN - Issue only one warning per empty lines block Signed-off-by: Eilon Greenstein --- scripts/checkpatch.pl |8 1 file changed, 8 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 21a9f5d..13d264f 10