Last active
August 26, 2019 20:24
-
-
Save zomglings/ae59d06d4bf81fb72047fcd390d08903 to your computer and use it in GitHub Desktop.
Pylint wrapper with scripting-friendly exit codes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Wraps Pylint invocation to produce shell-friendly exit codes | |
# Because Pylint exit codes are weird: | |
# https://docs.pylint.org/en/1.6.0/run.html#exit-codes | |
PYTHON_EXECUTABLE=python | |
if [ ! -z $PYTHON_ENV ]; then | |
PYTHON_EXECUTABLE="$PYTHON_ENV/bin/python" | |
fi | |
${PYTHON_EXECUTABLE} -m pylint $@ | |
PYLINT_EXIT_CODE=$? | |
exit $(($PYLINT_EXIT_CODE % 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment