Browse Source

Enable running pylint on directories, too

master
htgoebel 11 years ago
parent
commit
a75f40eac2
  1. 19
      bin/do_pylint.sh

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

Loading…
Cancel
Save