make lint: use config file and plugin for pylint

Our custom implementation of pylint checker is often broken by
incompatible change on pylint side. Using supported solutions (config
file, pylint plugins) should avoid this issue.

The plugin adds missing (dynamic) member to classes in abstract syntax
tree generated for pylint, instead of just ignoring missing members and
all sub-members. This should improve pylint detection of typos and
missing members in api. env and test config.

make-lint python script has been removed, to run pylint execute 'make
lint'

https://fedorahosted.org/freeipa/ticket/5615

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti
2016-02-11 11:06:39 +01:00
parent 5ac3a3cee5
commit 2ce8921fe6
6 changed files with 312 additions and 354 deletions
+11 -3
View File
@@ -54,7 +54,9 @@ LIBDIR ?= /usr/lib
DEVELOPER_MODE ?= 0
ifneq ($(DEVELOPER_MODE),0)
LINT_OPTIONS=--no-fail
LINT_IGNORE_FAIL=true
else
LINT_IGNORE_FAIL=false
endif
PYTHON ?= $(shell rpm -E %__python || echo /usr/bin/python2)
@@ -127,8 +129,14 @@ client-dirs:
fi
lint: bootstrap-autogen
./make-lint $(LINT_OPTIONS)
$(MAKE) -C install/po validate-src-strings
# find all python modules and executable python files outside modules for pylint check
FILES=`find . \
-type d -exec test -e '{}/__init__.py' \; -print -prune -o \
-name \*.py -print -o \
-type f \! -path '*/.*' \! -name '*~' -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \
echo "Pylint is running, please wait ..."; \
PYTHONPATH=. pylint --rcfile=pylintrc $(PYLINTFLAGS) $$FILES || $(LINT_IGNORE_FAIL)
$(MAKE) -C install/po validate-src-strings || $(LINT_IGNORE_FAIL)
test: