From 6a871101331b9b6ea19958946cfd4f5845505d38 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 28 Jun 2020 22:24:19 +0200 Subject: Implement python 2 compatibility checks We have been stuck on pylint <2 for a long time now because it dropped some of the python 2 lints we rely on. We maintain compatibility with python 2.6+ and 3.5+ and a lack of lints makes especially the former much harder. Incompatibilities had already snuck in in the form of implicit format specs. By implementing a custom checker we can make sure this doesn't happen again. --- .pylintrc | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.pylintrc') diff --git a/.pylintrc b/.pylintrc index b42432ca..3fdcbaa8 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,3 +1,7 @@ +[MASTER] +init-hook='import sys; sys.path.append("tests/pylint")' +load-plugins=py2_compat + [BASIC] good-names=i,j,k,n,x,y,ex,Run,_,fm,ui,fg,bg bad-names=foo,baz,toto,tutu,tata @@ -8,6 +12,7 @@ max-branches=16 [FORMAT] max-line-length = 99 +enable=no-absolute-import,old-division disable=cyclic-import,duplicate-code,fixme,import-outside-toplevel,locally-disabled,locally-enabled,missing-docstring,no-else-break,no-else-continue,no-else-raise,no-else-return,redefined-variable-type,stop-iteration-return,useless-object-inheritance [TYPECHECK] -- cgit 1.4.1-2-gfad0