Created
September 8, 2023 10:28
-
-
Save asaaki/00943eac929a9e65d1ce4e29484032c1 to your computer and use it in GitHub Desktop.
[ruby] rubocop, but only check git staged files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# time execution | |
time bin/rubocop -L --stderr $(git diff --name-only --cached | grep '\.rb') | |
# bare minimum | |
bin/rubocop $(git diff --name-only --cached | grep '\.rb') | |
# -L = list files (good to see which one got checked since we don't see the nested command's output | |
# --stderr = may or may not be useful to pipe output there | |
# @see <https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags> | |
# add other flags as you see fit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment