Skip to content

Instantly share code, notes, and snippets.

@martinratinaud
Last active August 29, 2015 14:17
Show Gist options
  • Save martinratinaud/a2fa314bffa3617968a8 to your computer and use it in GitHub Desktop.
Save martinratinaud/a2fa314bffa3617968a8 to your computer and use it in GitHub Desktop.
git alias to display changed file on branch and see if they pass your linter
...
[alias]
changed = "!BASE_REV=`git merge-base master $(git rev-parse --abbrev-ref HEAD)`;git diff --diff-filter=ACMR --name-only $BASE_REV HEAD"
check-lint = "!for file in `git changed | grep -e '\\.js$'`;do node_modules/.bin/eslint --config .eslintrc $file;done;"
ch = "!git changed"
cl = "!git check-lint"
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment