epicyon/static_analysis

26 lines
375 B
Plaintext
Raw Normal View History

2020-04-05 09:26:04 +00:00
#!/bin/bash
if [ -f /usr/bin/flake8 ]; then
cmd="/usr/bin/flake8"
else
cmd="python3 -m flake8"
fi
echo "Starting static analysis"
for sourceFile in *.py
do
if [[ "$sourceFile" == 'tests.py' ]]; then
continue
fi
result=$($cmd "$sourceFile")
if [ "$result" ]; then
echo "$result"
exit 1
fi
done
echo "Static analysis complete"
exit 0