2020-11-06 21:13:13 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
if ! which flake8 &>/dev/null; then
|
|
|
|
echo "Flake8 is required to lint this project"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-11-06 02:44:24 -04:00
|
|
|
# We ignore the following errors:
|
|
|
|
# * W503 (line break before binary operator): Black moves these to new lines
|
2021-11-06 02:51:14 -04:00
|
|
|
# * E501 (line too long): Long lines are a fact of life in comment blocks; Black handles active instances of this
|
2020-11-06 21:13:13 -05:00
|
|
|
flake8 \
|
2021-11-06 02:44:24 -04:00
|
|
|
--ignore=W503,E501 \
|
2021-11-06 02:51:14 -04:00
|
|
|
--exclude=debian,api-daemon/migrations/versions,api-daemon/provisioner/examples \
|
|
|
|
--max-line-length=88
|
2020-11-07 15:15:21 -05:00
|
|
|
ret=$?
|
|
|
|
if [[ $ret -eq 0 ]]; then
|
|
|
|
echo "No linting issues found!"
|
|
|
|
fi
|
|
|
|
exit $ret
|