Skip to content

Instantly share code, notes, and snippets.

@fujimura
Created November 27, 2015 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujimura/6b8d1e6094387302a677 to your computer and use it in GitHub Desktop.
Save fujimura/6b8d1e6094387302a677 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
set -x
# If there are whitespace errors, print the offending file names and fail.
git diff-index --check --cached HEAD
exec git diff --cached --name-only --diff-filter=AM | grep '\.rb$' | xargs rubocop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment