PTU5KAS/scripts/checkcode.sh
Paul Barker f8067a449b checkcode.sh: Abort if no path is provided
This ensures we don't try to check all python files in '/' if the
argument to the checkcode.sh script is missed by accident.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-06-17 08:00:04 +02:00

20 lines
416 B
Bash
Executable File

#!/bin/sh
ERROR=0
if [ $# != 1 ]; then
echo "Error: Please provide a path as the argument to this script!"
exit 1
fi
echo "Checking with pycodestyle"
pycodestyle --ignore=W503,W606 $1/*.py $1/*/*.py || ERROR=$(expr $ERROR + 1)
echo "Checking with flake8"
flake8 $1 || ERROR=$(expr $ERROR + 2)
echo "Checking with doc8"
doc8 $1/docs --ignore-path $1/docs/_build || ERROR=$(expr $ERROR + 4)
exit $ERROR