From a75f40eac2533e18694c531b588805de9b4668cf Mon Sep 17 00:00:00 2001 From: htgoebel <> Date: Sun, 12 Jun 2011 12:25:39 +0000 Subject: [PATCH] Enable running pylint on directories, too --- bin/do_pylint.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/do_pylint.sh b/bin/do_pylint.sh index b14d667..4095380 100755 --- a/bin/do_pylint.sh +++ b/bin/do_pylint.sh @@ -46,18 +46,25 @@ get_module() { run_pylint() { - local new_pythonpath="${BASIC_PYTHONPATH}$(get_pythonpath "$1")" - local arg="$(get_module "$1")" - PYTHONPATH="$new_pythonpath" pylint "$arg" + if [ -d "$1" ] ; then + find "$1" -type f -name \*.py | while read fname; do + run_pylint "$fname" + done + else + local new_pythonpath="${BASIC_PYTHONPATH}$(get_pythonpath "$1")" + local arg="$(get_module "$1")" + set +e + PYTHONPATH="$new_pythonpath" pylint "$arg" + set -e + fi } - # If no arguments were given, check the complete (basic) package and -# the plugin. +# the plugins. if [ $# -eq 0 ] ; then run_pylint cryptobox - find "$PROJ_DIR/plugins" -type f -name \*.py -print0 | xargs -0 run_pylint + run_pylint "$PROJ_DIR/plugins" else for name in "$@" ; do run_pylint "$name"