1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-04-20 09:40:50 +01:00

dev_scripts: pylint fixes

- Add "set -e" to abort on error
- Update the required version
- Fix path for the "default" runs
This commit is contained in:
Sergei Trofimov 2018-07-06 10:19:36 +01:00 committed by Marc Bonnici
parent 03eafe6b33
commit 109daa7f8c

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
DEFAULT_DIRS=( DEFAULT_DIRS=(
wa wa
@ -33,11 +34,11 @@ compare_versions() {
return 0 return 0
} }
pylint_version=$(python -c 'from pylint.__pkginfo__ import version; print version') pylint_version=$(python3 -c 'from pylint.__pkginfo__ import version; print(version)')
compare_versions $pylint_version "1.5.1" compare_versions $pylint_version "1.9.2"
result=$? result=$?
if [ "$result" == "2" ]; then if [ "$result" == "2" ]; then
echo "ERROR: pylint version must be at least 1.5.1; found $pylint_version" echo "ERROR: pylint version must be at least 1.9.2; found $pylint_version"
exit 1 exit 1
fi fi
@ -46,7 +47,7 @@ CWD=$PWD
pushd $THIS_DIR > /dev/null pushd $THIS_DIR > /dev/null
if [[ "$target" == "" ]]; then if [[ "$target" == "" ]]; then
for dir in "${DEFAULT_DIRS[@]}"; do for dir in "${DEFAULT_DIRS[@]}"; do
PYTHONPATH=. pylint --rcfile ../extras/pylintrc --load-plugins pylint_plugins $CWD/$dir PYTHONPATH=. pylint --rcfile ../extras/pylintrc --load-plugins pylint_plugins $THIS_DIR/../$dir
done done
else else
PYTHONPATH=. pylint --rcfile ../extras/pylintrc --load-plugins pylint_plugins $CWD/$target PYTHONPATH=. pylint --rcfile ../extras/pylintrc --load-plugins pylint_plugins $CWD/$target