lint 634 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/bash
##
# Lint the files to make sure that the code is sensible.
#

VENV_DIR=venv
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd -P)
ROOT="$SCRIPTS/.."

# Set up and enter the Virtual env.
"$SCRIPTS/bootstrap-env" "$ROOT/${VENV_DIR}" \
                         "$ROOT/requirements.txt" \
Charles Ferguson's avatar
Charles Ferguson committed
13
                         "$SCRIPTS/requirements-lint.txt" || exit 1
14 15 16 17 18 19 20 21 22 23 24 25
cd "$ROOT"
source "${VENV_DIR}/bin/activate" || exit 1

# Run some rudimentary tests on the code
echo '>>> Running pylint tests'
if pylint --rcfile pylintrc *.py ; then
    echo '<<< Lint passed'
    exit 0
else
    echo '<<< Lint failed'
    exit 1
fi