# HG changeset patch
# User Andrey Skvortsov <andrej.skvortzov@gmail.com>
# Date 1538644163 -10800
# Node ID 2e8bf28a890970c4d27da9bcf80cf31cfc89c70c
# Parent  dbc065a2f7a5d3ef2d8ce1766056cfca8912b350
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.

diff -r dbc065a2f7a5 -r 2e8bf28a8909 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