Re: [PATCH] checkpatch: Fix line number reporting
On Tue, Oct 16, 2007 at 01:59:49PM -0400, Erez Zadok wrote: > In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > > On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: > > > In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > > > > On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: > > > > > Fix line number reporting when checking source files (as opposed to > > > > > patches) > > > > > > > > > > Signed-off-by: Mike D. Day <[EMAIL PROTECTED]> > > > > > > > > Sorry you've had to fix this about 4 times, mostly because of ongoing > > > > changes, and slow replication getting in the way. I've applied this > > > > and you should find it in -next when replication hits. md5sum is > > > > below of the version with it in, so you can make sure you've got > > > > the right one. > > > > > > > > 54f053c50265e44a6041e3147dc66a69 checkpatch.pl > > > > > > > > -apw > > > > > > Andy, I've tested the --emacs feature in the above latest > > > checkpatch.pl-next. Below is a patch that completes the functionality of > > > the --emacs option: it ensures that only the cc-style error messages are > > > printed, no extra context lines or caret lines, no extra newlines, etc. > > > Although this patch changes every call to a message-producing function, it > > > is a trivial change, and I believe it's the cleanest way to handle the > > > separation between the terse cc-style messages and the verbose default > > > messages. With this patch, I can finally test a single source file as > > > follows: > > > > > > $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file > > > > Ok I don't understand why the rest of the lines are a problem? At least > > with emacs the extra context lines are just ignored right? Are you > > trying to use this as a summary? > > Andy, > > I'm trying to minimize excess stuff that's not necessarily useful for > everyone, and to match what is done elsewhere. For example, I don't need > those extra newlines and find them a distraction. And if get an error > message such as "put a space after a comma", I don't really need a caret > sign to point to the exact char in the line where it is. > > When g/cc prints out errors from a compile, the errors are one per line, w/o > any additional context lines, caret markers, newlines, etc. grep -n does > the same (also useful inside emacs). So I'm just asking for a way to have > the same terse format. > > If you feel that the extra info is still useful for some people, then can > you please provide a way for some people like me to turn off the extra lines > (pass a third -q, or a --terse option)? Ahh, ok so this isn't quite the same as the --emacs madness. Will see what we can do. I saw your patch changing every caller, and perhaps we can avoid that. -apw - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
On Tue, Oct 16, 2007 at 01:59:49PM -0400, Erez Zadok wrote: In message [EMAIL PROTECTED], Andy Whitcroft writes: On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: In message [EMAIL PROTECTED], Andy Whitcroft writes: On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: Fix line number reporting when checking source files (as opposed to patches) Signed-off-by: Mike D. Day [EMAIL PROTECTED] Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw Andy, I've tested the --emacs feature in the above latest checkpatch.pl-next. Below is a patch that completes the functionality of the --emacs option: it ensures that only the cc-style error messages are printed, no extra context lines or caret lines, no extra newlines, etc. Although this patch changes every call to a message-producing function, it is a trivial change, and I believe it's the cleanest way to handle the separation between the terse cc-style messages and the verbose default messages. With this patch, I can finally test a single source file as follows: $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file Ok I don't understand why the rest of the lines are a problem? At least with emacs the extra context lines are just ignored right? Are you trying to use this as a summary? Andy, I'm trying to minimize excess stuff that's not necessarily useful for everyone, and to match what is done elsewhere. For example, I don't need those extra newlines and find them a distraction. And if get an error message such as put a space after a comma, I don't really need a caret sign to point to the exact char in the line where it is. When g/cc prints out errors from a compile, the errors are one per line, w/o any additional context lines, caret markers, newlines, etc. grep -n does the same (also useful inside emacs). So I'm just asking for a way to have the same terse format. If you feel that the extra info is still useful for some people, then can you please provide a way for some people like me to turn off the extra lines (pass a third -q, or a --terse option)? Ahh, ok so this isn't quite the same as the --emacs madness. Will see what we can do. I saw your patch changing every caller, and perhaps we can avoid that. -apw - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: > > In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > > > On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: > > > > Fix line number reporting when checking source files (as opposed to > > > > patches) > > > > > > > > Signed-off-by: Mike D. Day <[EMAIL PROTECTED]> > > > > > > Sorry you've had to fix this about 4 times, mostly because of ongoing > > > changes, and slow replication getting in the way. I've applied this > > > and you should find it in -next when replication hits. md5sum is > > > below of the version with it in, so you can make sure you've got > > > the right one. > > > > > > 54f053c50265e44a6041e3147dc66a69 checkpatch.pl > > > > > > -apw > > > > Andy, I've tested the --emacs feature in the above latest > > checkpatch.pl-next. Below is a patch that completes the functionality of > > the --emacs option: it ensures that only the cc-style error messages are > > printed, no extra context lines or caret lines, no extra newlines, etc. > > Although this patch changes every call to a message-producing function, it > > is a trivial change, and I believe it's the cleanest way to handle the > > separation between the terse cc-style messages and the verbose default > > messages. With this patch, I can finally test a single source file as > > follows: > > > > $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file > > Ok I don't understand why the rest of the lines are a problem? At least > with emacs the extra context lines are just ignored right? Are you > trying to use this as a summary? Andy, I'm trying to minimize excess stuff that's not necessarily useful for everyone, and to match what is done elsewhere. For example, I don't need those extra newlines and find them a distraction. And if get an error message such as "put a space after a comma", I don't really need a caret sign to point to the exact char in the line where it is. When g/cc prints out errors from a compile, the errors are one per line, w/o any additional context lines, caret markers, newlines, etc. grep -n does the same (also useful inside emacs). So I'm just asking for a way to have the same terse format. If you feel that the extra info is still useful for some people, then can you please provide a way for some people like me to turn off the extra lines (pass a third -q, or a --terse option)? > -apw Thanks, Erez. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
In message [EMAIL PROTECTED], Andy Whitcroft writes: On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: In message [EMAIL PROTECTED], Andy Whitcroft writes: On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: Fix line number reporting when checking source files (as opposed to patches) Signed-off-by: Mike D. Day [EMAIL PROTECTED] Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw Andy, I've tested the --emacs feature in the above latest checkpatch.pl-next. Below is a patch that completes the functionality of the --emacs option: it ensures that only the cc-style error messages are printed, no extra context lines or caret lines, no extra newlines, etc. Although this patch changes every call to a message-producing function, it is a trivial change, and I believe it's the cleanest way to handle the separation between the terse cc-style messages and the verbose default messages. With this patch, I can finally test a single source file as follows: $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file Ok I don't understand why the rest of the lines are a problem? At least with emacs the extra context lines are just ignored right? Are you trying to use this as a summary? Andy, I'm trying to minimize excess stuff that's not necessarily useful for everyone, and to match what is done elsewhere. For example, I don't need those extra newlines and find them a distraction. And if get an error message such as put a space after a comma, I don't really need a caret sign to point to the exact char in the line where it is. When g/cc prints out errors from a compile, the errors are one per line, w/o any additional context lines, caret markers, newlines, etc. grep -n does the same (also useful inside emacs). So I'm just asking for a way to have the same terse format. If you feel that the extra info is still useful for some people, then can you please provide a way for some people like me to turn off the extra lines (pass a third -q, or a --terse option)? -apw Thanks, Erez. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: > In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > > On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: > > > Fix line number reporting when checking source files (as opposed to > > > patches) > > > > > > Signed-off-by: Mike D. Day <[EMAIL PROTECTED]> > > > > Sorry you've had to fix this about 4 times, mostly because of ongoing > > changes, and slow replication getting in the way. I've applied this > > and you should find it in -next when replication hits. md5sum is > > below of the version with it in, so you can make sure you've got > > the right one. > > > > 54f053c50265e44a6041e3147dc66a69 checkpatch.pl > > > > -apw > > Andy, I've tested the --emacs feature in the above latest > checkpatch.pl-next. Below is a patch that completes the functionality of > the --emacs option: it ensures that only the cc-style error messages are > printed, no extra context lines or caret lines, no extra newlines, etc. > Although this patch changes every call to a message-producing function, it > is a trivial change, and I believe it's the cleanest way to handle the > separation between the terse cc-style messages and the verbose default > messages. With this patch, I can finally test a single source file as > follows: > > $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file Ok I don't understand why the rest of the lines are a problem? At least with emacs the extra context lines are just ignored right? Are you trying to use this as a summary? -apw - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
On Sat, Oct 13, 2007 at 02:35:12PM -0400, Erez Zadok wrote: In message [EMAIL PROTECTED], Andy Whitcroft writes: On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: Fix line number reporting when checking source files (as opposed to patches) Signed-off-by: Mike D. Day [EMAIL PROTECTED] Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw Andy, I've tested the --emacs feature in the above latest checkpatch.pl-next. Below is a patch that completes the functionality of the --emacs option: it ensures that only the cc-style error messages are printed, no extra context lines or caret lines, no extra newlines, etc. Although this patch changes every call to a message-producing function, it is a trivial change, and I believe it's the cleanest way to handle the separation between the terse cc-style messages and the verbose default messages. With this patch, I can finally test a single source file as follows: $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file Ok I don't understand why the rest of the lines are a problem? At least with emacs the extra context lines are just ignored right? Are you trying to use this as a summary? -apw - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
In message <[EMAIL PROTECTED]>, Andy Whitcroft writes: > On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: > > Fix line number reporting when checking source files (as opposed to > > patches) > > > > Signed-off-by: Mike D. Day <[EMAIL PROTECTED]> > > Sorry you've had to fix this about 4 times, mostly because of ongoing > changes, and slow replication getting in the way. I've applied this > and you should find it in -next when replication hits. md5sum is > below of the version with it in, so you can make sure you've got > the right one. > > 54f053c50265e44a6041e3147dc66a69 checkpatch.pl > > -apw Andy, I've tested the --emacs feature in the above latest checkpatch.pl-next. Below is a patch that completes the functionality of the --emacs option: it ensures that only the cc-style error messages are printed, no extra context lines or caret lines, no extra newlines, etc. Although this patch changes every call to a message-producing function, it is a trivial change, and I believe it's the cleanest way to handle the separation between the terse cc-style messages and the verbose default messages. With this patch, I can finally test a single source file as follows: $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file (Yes, I need two -q). Cheers, Erez. diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 13de0e2..051b354 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -511,18 +511,21 @@ sub report_dump { @report; } sub ERROR { - report("ERROR: $_[0]\n"); + report("ERROR: $_[0]"); + report("$_[1]\n") if (!$emacs); our $clean = 0; our $cnt_error++; } sub WARN { - report("WARNING: $_[0]\n"); + report("WARNING: $_[0]"); + report("$_[1]\n") if (!$emacs); our $clean = 0; our $cnt_warn++; } sub CHK { if ($check) { - report("CHECK: $_[0]\n"); + report("CHECK: $_[0]"); + report("$_[1]\n") if (!$emacs); our $clean = 0; our $cnt_chk++; } @@ -663,18 +666,18 @@ sub process { # This is a signoff, if ugly, so do not double report. $signoff++; if (!($line =~ /^\s*Signed-off-by:/)) { - WARN("Signed-off-by: is the preferred form\n" . + WARN("Signed-off-by: is the preferred form\n", $herecurr); } if ($line =~ /^\s*signed-off-by:\S/i) { - WARN("need space after Signed-off-by:\n" . + WARN("need space after Signed-off-by:\n", $herecurr); } } # Check for wrappage within a valid hunk of the file if ($realcnt != 0 && $line !~ m{^(?:\+|-| |$)}) { - ERROR("patch seems to be corrupt (line wrapped?)\n" . + ERROR("patch seems to be corrupt (line wrapped?)\n", $herecurr) if (!$emitted_corrupt++); } @@ -690,7 +693,7 @@ sub process { | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$/x )) { - ERROR("Invalid UTF-8\n" . $herecurr); + ERROR("Invalid UTF-8\n", $herecurr); } #ignore lines being removed @@ -702,15 +705,15 @@ sub process { #trailing whitespace if ($line =~ /^\+.*\015/) { my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("DOS line endings\n" . $herevet); + ERROR("DOS line endings\n", $herevet); } elsif ($line =~ /^\+.*\S\s+$/ || $line =~ /^\+\s+$/) { my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("trailing whitespace\n" . $herevet); + ERROR("trailing whitespace\n", $herevet); } #80 column limit if ($line =~ /^\+/ && !($prevline=~/\/\*\*/) && $length > 80) { - WARN("line over 80 characters\n" . $herecurr); + WARN("line over 80 characters\n", $herecurr); } # check we are in a valid source file *.[hc] if not then ignore this hunk @@ -720,7 +723,7 @@ sub process { # more than 8 must use tabs. if ($line=~/^\+\s* \t\s*\S/ or $line=~/^\+\s*\s*/) { my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("use tabs not spaces\n" . $herevet); + ERROR("use tabs not spaces\n", $herevet); } # Remove comments from the line before processing. @@ -786,7
Re: [PATCH] checkpatch: Fix line number reporting
In message [EMAIL PROTECTED], Andy Whitcroft writes: On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: Fix line number reporting when checking source files (as opposed to patches) Signed-off-by: Mike D. Day [EMAIL PROTECTED] Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw Andy, I've tested the --emacs feature in the above latest checkpatch.pl-next. Below is a patch that completes the functionality of the --emacs option: it ensures that only the cc-style error messages are printed, no extra context lines or caret lines, no extra newlines, etc. Although this patch changes every call to a message-producing function, it is a trivial change, and I believe it's the cleanest way to handle the separation between the terse cc-style messages and the verbose default messages. With this patch, I can finally test a single source file as follows: $ ./scripts/checkpatch.pl -q -q --emacs --file path/name/to/file (Yes, I need two -q). Cheers, Erez. diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 13de0e2..051b354 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -511,18 +511,21 @@ sub report_dump { @report; } sub ERROR { - report(ERROR: $_[0]\n); + report(ERROR: $_[0]); + report($_[1]\n) if (!$emacs); our $clean = 0; our $cnt_error++; } sub WARN { - report(WARNING: $_[0]\n); + report(WARNING: $_[0]); + report($_[1]\n) if (!$emacs); our $clean = 0; our $cnt_warn++; } sub CHK { if ($check) { - report(CHECK: $_[0]\n); + report(CHECK: $_[0]); + report($_[1]\n) if (!$emacs); our $clean = 0; our $cnt_chk++; } @@ -663,18 +666,18 @@ sub process { # This is a signoff, if ugly, so do not double report. $signoff++; if (!($line =~ /^\s*Signed-off-by:/)) { - WARN(Signed-off-by: is the preferred form\n . + WARN(Signed-off-by: is the preferred form\n, $herecurr); } if ($line =~ /^\s*signed-off-by:\S/i) { - WARN(need space after Signed-off-by:\n . + WARN(need space after Signed-off-by:\n, $herecurr); } } # Check for wrappage within a valid hunk of the file if ($realcnt != 0 $line !~ m{^(?:\+|-| |$)}) { - ERROR(patch seems to be corrupt (line wrapped?)\n . + ERROR(patch seems to be corrupt (line wrapped?)\n, $herecurr) if (!$emitted_corrupt++); } @@ -690,7 +693,7 @@ sub process { | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$/x )) { - ERROR(Invalid UTF-8\n . $herecurr); + ERROR(Invalid UTF-8\n, $herecurr); } #ignore lines being removed @@ -702,15 +705,15 @@ sub process { #trailing whitespace if ($line =~ /^\+.*\015/) { my $herevet = $here\n . cat_vet($line) . \n; - ERROR(DOS line endings\n . $herevet); + ERROR(DOS line endings\n, $herevet); } elsif ($line =~ /^\+.*\S\s+$/ || $line =~ /^\+\s+$/) { my $herevet = $here\n . cat_vet($line) . \n; - ERROR(trailing whitespace\n . $herevet); + ERROR(trailing whitespace\n, $herevet); } #80 column limit if ($line =~ /^\+/ !($prevline=~/\/\*\*/) $length 80) { - WARN(line over 80 characters\n . $herecurr); + WARN(line over 80 characters\n, $herecurr); } # check we are in a valid source file *.[hc] if not then ignore this hunk @@ -720,7 +723,7 @@ sub process { # more than 8 must use tabs. if ($line=~/^\+\s* \t\s*\S/ or $line=~/^\+\s*\s*/) { my $herevet = $here\n . cat_vet($line) . \n; - ERROR(use tabs not spaces\n . $herevet); + ERROR(use tabs not spaces\n, $herevet); } # Remove comments from the line before processing. @@ -786,7 +789,7 @@ sub process { } }
Re: [PATCH] checkpatch: Fix line number reporting
On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: > Fix line number reporting when checking source files (as opposed to > patches) > > Signed-off-by: Mike D. Day <[EMAIL PROTECTED]> Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: Fix line number reporting
On Fri, Oct 12, 2007 at 03:26:54PM -0400, Mike D. Day wrote: Fix line number reporting when checking source files (as opposed to patches) Signed-off-by: Mike D. Day [EMAIL PROTECTED] Sorry you've had to fix this about 4 times, mostly because of ongoing changes, and slow replication getting in the way. I've applied this and you should find it in -next when replication hits. md5sum is below of the version with it in, so you can make sure you've got the right one. 54f053c50265e44a6041e3147dc66a69 checkpatch.pl -apw - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/