Skip to content

Instantly share code, notes, and snippets.

@marcosgz
Created May 2, 2022 21:04
Show Gist options
  • Save marcosgz/2cf7b77dcb92734f689b5b6efbde4300 to your computer and use it in GitHub Desktop.
Save marcosgz/2cf7b77dcb92734f689b5b6efbde4300 to your computer and use it in GitHub Desktop.
Execute Rubocop Autocorrect on all modified files comparing current branch with staging
git diff --name-only HEAD..staging | grep -E -i 'rake|*.rb|*.erb' | perl -ne 'chomp(); if (-e $_) {print "$_\n"}' | xargs rubocop -A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment