Skip to content

Instantly share code, notes, and snippets.

@elias19r
Created July 25, 2023 21:02
Show Gist options
  • Save elias19r/8ce2018557e18bb410cce8f9d9b427a3 to your computer and use it in GitHub Desktop.
Save elias19r/8ce2018557e18bb410cce8f9d9b427a3 to your computer and use it in GitHub Desktop.
mbecop: Run rubocop only on modified files
function mbecop() {
{
git diff-tree -r --no-commit-id --name-only HEAD main;
git ls-files -m
} | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment