Last active
October 19, 2017 09:38
-
-
Save slitayem/a4b5986bbc72f51142d538c0948dfd22 to your computer and use it in GitHub Desktop.
pylint all folder python files except virtualenv folder (venv) located in the project directory.
This file contains hidden or 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 bash | |
# Author Saloua Litayem | |
# For more details about pylint check https://docs.pylint.org/en/1.6.0/index.html | |
if [ "$#" -lt 1 ] | |
then | |
echo "Usage: $0 folder_path [pylintrc file] [venv_folder(default: venv)]" | |
exit 1 | |
fi | |
CMD="find $1 -name '*.py'" | |
if [[ ! -z "$3" ]] | |
then | |
CMD=$CMD" -not -path \"$3/*\"" | |
else | |
CMD=$CMD" -not -path \"./venv/*\"" | |
fi | |
CMD=$CMD"| xargs pylint --reports=y" | |
if [ -z "$2" ] | |
then | |
eval $CMD | |
else | |
eval $CMD" --rcfile=$2" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment