Skip to content

Instantly share code, notes, and snippets.

@sanketsudake
Last active January 3, 2017 18:22
Show Gist options
  • Save sanketsudake/a39bb8d508cde1a2ceb50bcb1d1cd7f4 to your computer and use it in GitHub Desktop.
Save sanketsudake/a39bb8d508cde1a2ceb50bcb1d1cd7f4 to your computer and use it in GitHub Desktop.
Python Coding Style Lint and Auto fixing
set -x
if [ $1 ] ; then
DIR=$1
else
DIR=.
fi
find $DIR -name '*.py' | grep -v "static\|migrations\|media" > cscope.files
cat cscope.files | xargs isort
cat cscope.files | xargs yapf -i -p
cat cscope.files | xargs flake8 2>&1 > warnings.txt
cat warnings.txt | cut -d'/' -f 2 | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment