Enable running pylint on directories, too
This commit is contained in:
parent
c0ee498c5c
commit
a75f40eac2
|
@ -46,18 +46,25 @@ get_module() {
|
||||||
|
|
||||||
|
|
||||||
run_pylint() {
|
run_pylint() {
|
||||||
local new_pythonpath="${BASIC_PYTHONPATH}$(get_pythonpath "$1")"
|
if [ -d "$1" ] ; then
|
||||||
local arg="$(get_module "$1")"
|
find "$1" -type f -name \*.py | while read fname; do
|
||||||
PYTHONPATH="$new_pythonpath" pylint "$arg"
|
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
|
# If no arguments were given, check the complete (basic) package and
|
||||||
# the plugin.
|
# the plugins.
|
||||||
if [ $# -eq 0 ] ; then
|
if [ $# -eq 0 ] ; then
|
||||||
run_pylint cryptobox
|
run_pylint cryptobox
|
||||||
find "$PROJ_DIR/plugins" -type f -name \*.py -print0 | xargs -0 run_pylint
|
run_pylint "$PROJ_DIR/plugins"
|
||||||
else
|
else
|
||||||
for name in "$@" ; do
|
for name in "$@" ; do
|
||||||
run_pylint "$name"
|
run_pylint "$name"
|
||||||
|
|
Loading…
Reference in New Issue