Patchwork checkpatch.pl: don't complain about old lines with tabs

login
register
mail settings
Submitter Blue Swirl
Date Feb. 3, 2011, 5:55 p.m.
Message ID <AANLkTimcaCvEM_87PfFhR39h139CyeU=kJ4SYtqx_V4C@mail.gmail.com>
Download mbox | patch
Permalink /patch/81693/
State New
Headers show

Comments

Blue Swirl - Feb. 3, 2011, 5:55 p.m.
Don't complain when the patch includes lines with tabs
only in the hunk's untouched context.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 scripts/checkpatch.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jan Kiszka - Feb. 3, 2011, 9:50 p.m.
On 2011-02-03 18:55, Blue Swirl wrote:
> Don't complain when the patch includes lines with tabs
> only in the hunk's untouched context.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
>  scripts/checkpatch.pl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4fa06c0..075b614 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1495,7 +1495,7 @@ sub process {
>  		next if ($realfile !~ /\.(h|c|pl)$/);
> 
>  # in QEMU, no tabs are allowed
> -		if ($rawline =~ /\t/) {
> +		if ($rawline =~ /^\+.*\t/) {
>  			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
>  			ERROR("code indent should never use tabs\n" . $herevet);
>  			$rpt_cleaners = 1;
> -- 1.6.2.4

Works perfectly now.

Thanks,
Jan

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4fa06c0..075b614 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1495,7 +1495,7 @@  sub process {
 		next if ($realfile !~ /\.(h|c|pl)$/);

 # in QEMU, no tabs are allowed
-		if ($rawline =~ /\t/) {
+		if ($rawline =~ /^\+.*\t/) {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			ERROR("code indent should never use tabs\n" . $herevet);
 			$rpt_cleaners = 1;