Skip to content

Instantly share code, notes, and snippets.

@league55
Created December 19, 2019 09:34
Show Gist options
  • Save league55/1d3fc95a4b96bb249848d7147675516c to your computer and use it in GitHub Desktop.
Save league55/1d3fc95a4b96bb249848d7147675516c to your computer and use it in GitHub Desktop.
Flake8 in a virtualenv
PROJECT_DIR=$1
# Creating temporary directory and new virtual environment not to mess things
TMP_DIR=$(mktemp -d)
virtualenv -p python3 ${TMP_DIR} >> /dev/null
source ${TMP_DIR}/bin/activate >> /dev/null
# installing flake
pip install flake8 >> /dev/null
flake8 ${PROJECT_DIR}
deactivate
rm -rf ${TMP_DIR}
echo "Linting OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment