Skip to content

Instantly share code, notes, and snippets.

@slitayem
Last active October 19, 2017 09:38
Show Gist options
  • Save slitayem/a4b5986bbc72f51142d538c0948dfd22 to your computer and use it in GitHub Desktop.
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.
#!/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