Last active
August 29, 2015 14:26
-
-
Save newgene/9c1ba415a18821b00977 to your computer and use it in GitHub Desktop.
My handy shell aliases for checking all changed Python files under a git or mercurial repo before commit.
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
# Just a short-hand to type less | |
alias f8='flake8' | |
# run "hgf" anywhere in a mercurial repo, it will check all changed *.py with flake8 | |
alias hgf='tmp_cwd=`pwd` ; cd `hg root`; hgs -nmd |grep "\.py$" |xargs flake8; cd $tmp_cwd; unset tmp_cwd' | |
# run "gf" anywhere in a git repo, it will check all changed *.py with flake8 | |
alias gf='tmp_cwd=`pwd` ; cd `git rev-parse --show-toplevel`; git diff --name-only |grep "\.py$" |xargs flake8; cd $tmp_cwd; unset tmp_cwd' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment