[PATCH aiaiai] test-patchset: add [no] options for each checker

Jacob Keller jacob.e.keller at intel.com
Wed Sep 24 11:26:15 PDT 2014


Also, enable checkpatch.pl by default unless otherwise disabled. This
fixes a compatibility regression introduced by 33c41203f0c9
("aiaiai-test-patchset: make checkpatch optional like other checkers")
as well as provides disable options for once aiaiai-test-patchset
supports a configuration file.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
 aiaiai-test-patchset             | 40 +++++++++++++++++++++++++++++++---------
 email/aiaiai-email-test-patchset |  4 ++--
 2 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset
index b3ab3f5a1702..dee9f80be2a6 100755
--- a/aiaiai-test-patchset
+++ b/aiaiai-test-patchset
@@ -64,6 +64,13 @@ By default, $PROG assumes that defconfigs are part of the
 kernel tree, unless --confdir option is specified, in which case the defconfig
 files will be searched for only in the specified directory.
 
+Several static checking utilities can be enabled to provide enhanced
+information, if desired. These include sparse, smatch, cppcheck, and
+coccinelle. In addition scripts/checkpatch.pl is run if found in the project
+tree. You can disable a checker with --no[checker] or enable it with
+--[checker]. The last provided option on the command line wins, and supersedes
+other settings.
+
 Options:
   -j, --jobs=N           allow to run N jobs simultaneously (default is 1);
   -c, --commit-id=ID     the commit id to test against (default is the head of
@@ -83,11 +90,11 @@ Options:
                          stand-alone defconfig files instead;
   -p, --preserve         preserve all the temporary files - do not clean up;
       --bisectability    test bisectability;
-      --sparse           check with sparse while building;
-      --smatch           check with smatch while building;
-      --cppcheck         check with cppcheck while building;
-      --coccinelle       check with coccinelle (spatch) while building;
-      --checkpatch       run scripts/checkpatch.pl, if found in the project;
+      --[no]sparse       check with sparse while building;
+      --[no]smatch       check with smatch while building;
+      --[no]cppcheck     check with cppcheck while building;
+      --[no]coccinelle   check with coccinelle (spatch) while building;
+      --[no]checkpatch   run scripts/checkpatch.pl, if found in the project;
   -Q  --quick-fixes=F    sometimes it is necessary to carry out-of-tree patches
                          like quick build fixes and this option allows to pass
                          an mbox file with quick fixes which will be applied
@@ -275,7 +282,7 @@ sparse=
 smatch=
 cppcheck=
 coccinelle=
-checkpatch=
+checkpatch="yes" # Keep enabled by default for backwards compatibility
 quick_fixes=
 targets="all"
 keywords=
@@ -332,6 +339,24 @@ while true; do
 		coccinelle="yes"
 		program_required "spatch" "Usually Linux distribution provide a 'spatch' or 'coccinelle' package"
 		;;
+	--checkpatch)
+		checkpatch="yes"
+		;;
+	--nosparse)
+		sparse=
+		;;
+	--nosmatch)
+		smatch=
+		;;
+	--nocppcheck)
+		cppcheck=
+		;;
+	--nococcinelle)
+		coccinelle=
+		;;
+	--nocheckpatch)
+		checkpatch=
+		;;
 	-Q|--quick-fixes)
 		quick_fixes="$(opt_check_read "$1" "$2")"
 		shift
@@ -340,9 +365,6 @@ while true; do
 		targets="$2"
 		shift
 		;;
-	--checkpatch)
-		checkpatch="yes"
-		;;
 	-K|--keywords)
 		keywords="$(opt_check_read "$1" "$2")"
 		shift
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index dba6b0c355ff..8270e04cc069 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -330,13 +330,13 @@ sparse=
 smatch=
 cppcheck=
 coccinelle=
-checkpatch=
+checkpatch= # Note, checkpatch is enabled by default
 [ "$pcfg_bisectability" != "1" ] || bisectability="--bisectability"
 [ "$pcfg_sparse" != "1" ] || sparse="--sparse"
 [ "$pcfg_smatch" != "1" ] || smatch="--smatch"
 [ "$pcfg_cppcheck" != "1" ] || cppcheck="--cppcheck"
 [ "$pcfg_coccinelle" != "1" ] || coccinelle="--coccinelle"
-[ "$pcfg_checkpatch" != "1" ] || checkpatch="--checkpatch"
+[ "$pcfg_checkpatch" = "1" ] || checkpatch="--nocheckpatch"
 
 # Create the Cc list for replies that we'll be sending
 if [ "$pcfg_reply_to_all" = "1" ]; then
-- 
2.0.1.475.g9b8d714




More information about the aiaiai mailing list