Use multiple processes to speed up pylint
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 04 Oct 2018 12:09:23 +0300
changeset 2433 2e8bf28a8909
parent 2432 dbc065a2f7a5
child 2434 07f48018b6f5
Use multiple processes to speed up pylint

0 will auto-detect the number of processors available to use.
version 1.6.5 (Debian 9.5) hangs for some reason in multi-process mode.
tests/tools/check_source.sh
--- a/tests/tools/check_source.sh	Thu Oct 04 12:07:16 2018 +0300
+++ b/tests/tools/check_source.sh	Thu Oct 04 12:09:23 2018 +0300
@@ -31,6 +31,11 @@
     fi
 }
 
+version_gt()
+{
+    test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
+}
+
 
 compile_checks()
 {
@@ -237,6 +242,7 @@
 }
 
 pylint_checks()
+
 {
     echo "Check for problems using pylint ..."
 
@@ -354,6 +360,12 @@
     # enable=
 
     options=
+
+    ver=$(pylint --version 2>&1 | grep pylint  | awk '{ print $2 }')
+    if version_gt $ver '1.6.8'; then
+	echo "Use multiple threads for pylint"
+	options="$options --jobs=0 "
+    fi
     options="$options --rcfile=.pylint"
     # options="$options --py3k"   # report errors for Python 3 porting