Static analysis script

main
Bob Mottram 2020-04-05 10:26:04 +01:00
parent b34f29d15a
commit 7c7e8242ed
1 changed files with 25 additions and 0 deletions

25
static_analysis 100755
View File

@ -0,0 +1,25 @@
#!/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