Skip to contentSkip to conversation

CHECKPATCH:fix misleading output on spaces/tabs error

PATCH In review Daolong Wang 2 participants 3 messages Mar 19, 2008 – Mar 20, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CHECKPATCH:fix misleading output on spaces/tabs error

I got confused by this line:

"ERROR: use tabs not spaces"

It literally means "use tabs but not spaces is WRONG", which
is WRONG.

"ERROR: do not use spaces when tabs expected"

sounds more appropriate.

---

checkpatch.pl renamed from checkpatch.pl.org +1 -1
@@ -1064,7 +1064,7 @@ sub process {
 		if ($rawline =~ /^\+\s* \t\s*\S/ ||
 		    $rawline =~ /^\+\s*        \s*/) {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-			ERROR("use tabs not spaces\n" . $herevet);
+			ERROR("do not use spaces when tabs expected\n" . $herevet);
 		}
 
 # check for RCS/CVS revision markers
#1 lore raw
Quoted 10 lines · Daolong Wang

I got confused by this line:

"ERROR: use tabs not spaces"

It literally means "use tabs but not spaces is WRONG", which
is WRONG.

"ERROR: do not use spaces when tabs expected"

sounds more appropriate.

Except that it says "use tabs not spaces when you should use tabs" and doesn't actually tell us what the error was, nor how to correct it. So its not really any better than the original (which is also useless in this regard).

How about:

"code indent should use tabs where possible"

checkpatch.pl sub process { · line 1070

Quoted 13 lines

---

checkpatch.pl renamed from checkpatch.pl.org +1 -1
@@ -1064,7 +1064,7 @@ sub process {
 		if ($rawline =~ /^\+\s* \t\s*\S/ ||
 		    $rawline =~ /^\+\s*        \s*/) {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-			ERROR("use tabs not spaces\n" . $herevet);
+			ERROR("do not use spaces when tabs expected\n" . $herevet);
 		}
 
 # check for RCS/CVS revision markers

-apw

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 11 lines

Except that it says "use tabs not spaces when you should use tabs" and doesn't actually tell us what the error was, nor how to correct it. So its not really any better than the original (which is also useless in this regard).

How about:

"code indent should use tabs where possible"

My point is the original isn't good.

And about the replacement, that was just my suggestion. We can choose one that'll please everyone.
In fact, either mine or yours is much better.

Add cc, Sorry for repeating.