Skip to content

Instantly share code, notes, and snippets.

@knaveofdiamonds
Created October 22, 2015 15:17
Show Gist options
  • Save knaveofdiamonds/8342b16fd07a10636e99 to your computer and use it in GitHub Desktop.
Save knaveofdiamonds/8342b16fd07a10636e99 to your computer and use it in GitHub Desktop.
# with this function defined...
__git_branch ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)"
if [ -n "$b" ]; then
printf "%s" "${b##refs/heads/}"
fi
}
# this gives you warnings for files changed in your branch
flake8 $(git diff --name-only $(__git_branch) $(git merge-base $(__git_branch) master))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment