Files
swift-mirror/utils/python-lint
Michael Gottesman e9baa29d3c [pylint] If an argument is passed into python-lint, propagate it to flake8.
This does not change the common usage, but provides additional flexibility if
necessary.
2016-07-28 09:43:21 -07:00

17 lines
415 B
Bash
Executable File

#!/bin/bash
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
python -c 'import flake8; import flake8_import_order' 2>/dev/null
if [[ $? != 0 ]]; then
echo "Missing modules flake8 or flake8-import-order. Please be sure to install these python packages before linting."
exit 1
fi
cd "$SCRIPT_DIR/.."
if [[ $? != 0 ]]; then
echo "Could not change directory to '$SCRIPT_DIR/..'."
exit 1
fi
flake8 $@