[Linux-Biella] Aiuto script output checkpatch.pl
Paolo Ciarrocchi
paolo.ciarrocchi a gmail.com
Dom 13 Gen 2008 02:44:57 CET
Ciao a tutti,
da qualche tempo nei sorgenti del kernel si trova:
./script/checkpatch.pl
Uno script per verificare violazione del codind style di patch e file.
Ho fatto una piccola modifica:
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 579f50f..5083a3e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1580,6 +1580,7 @@ sub process {
print report_dump();
if ($summary) {
+ print "filename: $filename \n";
print "total: $cnt_error errors, $cnt_warn warnings, " .
(($check)? "$cnt_chk checks, " : "") .
"$cnt_lines lines checked\n";
al fine di cercare di usarlo anche a fine statistico, ora ottengo quanto segue:
paolo a paolo-desktop:~/linux-2.6/arch/x86$ find . -name *.c |xargs
../../scripts/checkpatch.pl --file |grep -B 1 total
filename: ./mach-rdc321x/gpio.c
total: 0 errors, 0 warnings, 91 lines checked
--
filename: ./mach-rdc321x/platform.c
total: 0 errors, 0 warnings, 68 lines checked
--
filename: ./mach-rdc321x/wdt.c
total: 0 errors, 3 warnings, 275 lines checked
--
filename: ./boot/a20.c
total: 0 errors, 0 warnings, 161 lines checked
--
filename: ./boot/apm.c
total: 0 errors, 0 warnings, 95 lines checked
--
filename: ./boot/cmdline.c
total: 0 errors, 0 warnings, 97 lines checked
Ora mi piacerebbe fare:
- Visualizzare il totale (somma di tutti ) errors, warning e lines
- Visualizzare i 10 file che hanno piu' errori (o ordinare tutto per errors)
Idee?
Qualche esperto di awk/perl?
Ciao,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/
Maggiori informazioni sulla lista
Linux