Skip to content

Instantly share code, notes, and snippets.

@evanlouden
Created December 10, 2020 14:03
Show Gist options
  • Save evanlouden/bad53ee619dbff3be4d40a317e54ceae to your computer and use it in GitHub Desktop.
Save evanlouden/bad53ee619dbff3be4d40a317e54ceae to your computer and use it in GitHub Desktop.
Standard RB pre-commit hook
FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.rb"| sed 's| |\\ |g')
[ -z "$FILES" ]
echo "$FILES" | xargs bundle exec standardrb --fix
echo "$FILES" | xargs git add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment