Enable running pylint on directories, too

This commit is contained in:
htgoebel 2011-06-12 12:25:39 +00:00
parent c0ee498c5c
commit a75f40eac2
1 changed files with 13 additions and 6 deletions

View File

@ -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"