Skip to content

Instantly share code, notes, and snippets.

@zomglings
Last active August 26, 2019 20:24
Show Gist options
  • Save zomglings/ae59d06d4bf81fb72047fcd390d08903 to your computer and use it in GitHub Desktop.
Save zomglings/ae59d06d4bf81fb72047fcd390d08903 to your computer and use it in GitHub Desktop.
Pylint wrapper with scripting-friendly exit codes
#!/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