From 6312d48c004fa38e0a2508e114349e131e89d8c4 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 20 Oct 2015 11:28:27 +0200 Subject: [PATCH] Add pylint running capability --- .gitignore | 1 + .pylintrc | 8 ++++++++ Makefile | 14 +++++++++++++- dev-requirements.txt | 3 +++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .pylintrc diff --git a/.gitignore b/.gitignore index e5a44d3..35fca94 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /htmlcov/ /test_failures.txt /test_rerun.txt +/pylint/ diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..4feb649 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,8 @@ +[MASTER] + +load-plugins=pylint_django + +[REPORTS] + +files-output=yes + diff --git a/Makefile b/Makefile index bf6897a..e98b5ed 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,20 @@ APPENDCOV = $(shell test -s test_rerun.txt && echo "-a") +MODULES = duckbook booking api accounts test: coverage run $(APPENDCOV) \ - --source "duckbook,booking,api,accounts" \ + --source `echo $(MODULES) | sed 's/ /,/g'` \ manage.py test `cat test_rerun.txt` coverage html coverage report + @echo "Coverage data is available in HTML format under the htmlcov directory" + +lint: + rm -rf pylint + pylint --rcfile=.pylintrc $(MODULES) || true + mkdir pylint + sh -c 'for file in pylint_*; do \ + o="$${file#pylint_}"; \ + mv "$$file" pylint/$$o; \ + done' + @echo "lint data is available in TXT format under the pylint directory" diff --git a/dev-requirements.txt b/dev-requirements.txt index 28bbced..543a20e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,3 +2,6 @@ coverage==4.0.1 django-coverage-plugin==1.0 django-juno-testrunner==0.3.1 +pylint==1.4.4 +pylint-django==0.6.1 +