chiark / gitweb /
update outdated pylint setup
authorHans-Christoph Steiner <hans@eds.org>
Thu, 13 Apr 2017 09:57:02 +0000 (11:57 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 23 May 2017 20:34:16 +0000 (22:34 +0200)
The logilab-astng lib is dead, replaced by python-astroid.  The crazy astng
plugin is no longer needed also.

#281

.pylint-plugins/astng_hashlib.py [deleted file]
.pylint-rcfile [new file with mode: 0644]
tests/complete-ci-tests

diff --git a/.pylint-plugins/astng_hashlib.py b/.pylint-plugins/astng_hashlib.py
deleted file mode 100644 (file)
index f4b7871..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# started from http://www.logilab.org/blogentry/78354
-#
-
-from logilab.astng import MANAGER
-from logilab.astng.builder import ASTNGBuilder
-
-def hashlib_transform(module):
-    if module.name == 'hashlib':
-        fake = ASTNGBuilder(MANAGER).string_build('''
-
-class fakehash(object):
-  digest_size = -1
-  def __init__(self, value): pass
-  def digest(self):
-    return u''
-  def hexdigest(self):
-    return u''
-  def update(self, value): pass
-
-class md5(fakehash):
-  pass
-
-class sha1(fakehash):
-  pass
-
-class sha256(fakehash):
-  pass
-
-''')
-        for hashfunc in ('sha256', 'sha1', 'md5'):
-            module.locals[hashfunc] = fake.locals[hashfunc]
-
-def register(linter):
-    """called when loaded by pylint --load-plugins, register our tranformation
-    function here
-    """
-    MANAGER.register_transformer(hashlib_transform)
-
diff --git a/.pylint-rcfile b/.pylint-rcfile
new file mode 100644 (file)
index 0000000..4685d7f
--- /dev/null
@@ -0,0 +1,45 @@
+[MASTER]
+
+# Use multiple processes to speed up Pylint.
+jobs=4
+
+# Allow loading of arbitrary C extensions. Extensions are imported into the
+# active Python interpreter and may run arbitrary code.
+unsafe-load-any-extension=no
+
+
+[MESSAGES CONTROL]
+
+# Only show warnings with the listed confidence levels. Leave empty to show
+# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
+confidence=HIGH,INFERENCE
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once).You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use"--disable=all --enable=classes
+# --disable=W"
+disable=invalid-name,missing-docstring,no-member
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+[BASIC]
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,ex,Run,_,e,f,fp
+
+
+[ELIF]
+
+# Maximum number of nested blocks for function / method body
+max-nested-blocks=5
+
index 558427e3bb870f926230b80a266855ac81da7f38..b09e111dd3a06d91d82a46bf97ccc6304cb479d7 100755 (executable)
@@ -87,19 +87,14 @@ sh hooks/pre-commit
 #------------------------------------------------------------------------------#
 # run pylint
 
-cd $WORKSPACE
-set +e
-# use the pyvenv so pylint checks against its installed libs
-    PYTHONPATH=$WORKSPACE/.pylint-plugins python3 /usr/bin/pylint \
-        --output-format=parseable --reports=n \
-        --load-plugins astng_hashlib \
-        fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable
-
-# to only tell jenkins there was an error if we got ERROR or FATAL, uncomment these:
-# running pylint in the pyvenv/virtualenv is causing this FATAL error, which is a bug:
-# https://bitbucket.org/logilab/pylint/issue/73/pylint-is-unable-to-import
-[ $(($? & 1)) = "1" ] && echo "FATALs found"
-[ $(($? & 2)) = "2" ] && exit 2
-[ $(($? & 4)) = "4" ] && exit 4
-set -e
-
+# only run it where it will work, for example, the pyvenvs above don't have pylint
+if which pylint3 && python3 -c "import pylint" 2> /dev/null; then
+    cd $WORKSPACE
+    pylint3 --rcfile=.pylint-rcfile --output-format=colorized --reports=n \
+            fdroid \
+            makebuildserver \
+            setup.py \
+            fdroidserver/*.py \
+            tests/*.py \
+            tests/*.TestCase
+fi