CI: Init and enforce a pylint profile in tox
[releng/builder.git] / tox.ini
diff --git a/tox.ini b/tox.ini
index 6926c2677b4d46d9c9bf56da91829f13d26aaed8..d2b17739bc08e8780546926ddff0b61fb16c3a52 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 minversion = 1.6
-envlist = docs,docs-linkcheck,jjb-version,prefix,robot,
+envlist = docs,docs-linkcheck,jjb-version,prefix,robot,pylint
 #    pre-commit
 skipsdist = true
 
@@ -74,3 +74,13 @@ commands =
         || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | \
         yum install devscripts-minimal )" >&2 && exit 1)'
     find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f  \{\} +
+
+[testenv:pylint]
+basepython = python3
+deps = pylint>=2.6.0
+whitelist_externals = find
+commands =
+# .tox folder and submodules directories global-jjb/ & packer/common-packer/ must be excluded since they are not maintained here
+    find . -name *.py -not -path "./.tox/*" -not -path "./global-jjb/*" -not -path "./packer/common-packer/*" -exec \
+    pylint --fail-under=6.50 --max-line-length=120 --disable=missing-docstring --disable=fixme --disable=duplicate-code \{\} +
+