mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-19 04:21:17 +00:00
48 lines
991 B
Bash
Executable File
48 lines
991 B
Bash
Executable File
#!/bin/bash
|
|
|
|
target=$1
|
|
|
|
compare_versions() {
|
|
if [[ $1 == $2 ]]; then
|
|
return 0
|
|
fi
|
|
|
|
local IFS=.
|
|
local i ver1=($1) ver2=($2)
|
|
|
|
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
|
|
ver1[i]=0
|
|
done
|
|
|
|
for ((i=0; i<${#ver1[@]}; i++)); do
|
|
if [[ -z ${ver2[i]} ]]; then
|
|
ver2[i]=0
|
|
fi
|
|
if ((10#${ver1[i]} > 10#${ver2[i]})); then
|
|
return 1
|
|
fi
|
|
if ((10#${ver1[i]} < 10#${ver2[i]})); then
|
|
return 2
|
|
fi
|
|
done
|
|
|
|
return 0
|
|
}
|
|
|
|
pylint_version=$(python -c 'from pylint.__pkginfo__ import version; print version')
|
|
compare_versions $pylint_version "1.3.0"
|
|
result=$?
|
|
if [ "$result" == "2" ]; then
|
|
echo "ERROR: pylint version must be at least 1.3.0; found $pylint_version"
|
|
exit 1
|
|
fi
|
|
|
|
THIS_DIR="`dirname \"$0\"`"
|
|
if [[ "$target" == "" ]]; then
|
|
pushd $THIS_DIR/.. > /dev/null
|
|
pylint --rcfile extras/pylintrc wlauto
|
|
popd > /dev/null
|
|
else
|
|
pylint --rcfile $THIS_DIR/../extras/pylintrc $target
|
|
fi
|