From 04c0625903f97fc1c4dc61a7dba14fb8b2ff8098 Mon Sep 17 00:00:00 2001 From: kmmbvnr Date: Sun, 30 May 2010 18:10:26 +0700 Subject: [PATCH] Integrate pylint --- .pylintrc | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tests/run_tests.sh | 6 ++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..a0738d52 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,60 @@ +[MASTER] +persistent=yes + +[MESSAGES CONTROL] +#enable= +#disable= + +[REPORTS] +output-format=parseable + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of classes names for which member attributes should not be checked +# (useful for classes with attributes dynamically set). +ignored-classes=SQLObject + +# When zope mode is activated, add a predefined set of Zope acquired attributes +# to generated-members. +zope=no + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E0201 when accessed. +generated-members=REQUEST,acl_users,aq_parent + + +[VARIABLES] +init-import=no + + +[SIMILARITIES] +min-similarity-lines=4 +ignore-comments=yes +ignore-docstrings=yes + + +[MISCELLANEOUS] +notes=FIXME,XXX,TODO + + +[FORMAT] +max-line-length=160 +max-module-lines=500 +indent-string=' ' + + +[DESIGN] +max-args=5 +max-locals=15 +max-returns=6 +max-branchs=12 +max-statements=50 +max-parents=7 +max-attributes=7 +min-public-methods=2 +max-public-methods=20 + diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 14b71664..fa8eebbe 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -2,13 +2,13 @@ SCRIPT_DIR=`dirname $0` ROOT_DIR=`cd $SCRIPT_DIR/.. && pwd` -cd $ROOT_DIR ENVSPEC=`stat -c %Y $ROOT_DIR/tests/environment.pip` ENVTIME=`test -d $ROOT_DIR/.ve && stat -c %Y $ROOT_DIR/.ve` set -e +cd $ROOT_DIR if [ $ENVSPEC -gt 0$ENVTIME ]; then # Setup environment virtualenv --no-site-packages $ROOT_DIR/.ve @@ -19,6 +19,9 @@ else source $ROOT_DIR/.ve/bin/activate fi +# pylint +pylint --rcfile=$ROOT_DIR/.pylintrc django_fsm >> pylint.out || echo 'PyLint done' + # Run tests python <