Created
September 17, 2018 18:34
-
-
Save garybernhardt/c2fceef67bcba989b2742dad88c9170b to your computer and use it in GitHub Desktop.
Automatically fix rubocop errors, with one commit per error
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
rubocop | egrep ' (W|C): ' | cut -d ' ' -f 3 | sort -u | sed 's/:$//' | while read cop; do | |
git checkout . | |
rubocop -a --only "$cop"; | |
if [[ $(git diff --stat) != '' ]]; then | |
git add --all | |
git commit -m "fix rubocop cop $cop" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment