Last active
August 29, 2018 01:28
-
-
Save kouheiszk/ed0052ada723e8bae2ece954ff548e9e to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
rules=$(bundle exec rubocop --parallel --cache true --format json | jq '[.files[].offenses | map(.cop_name)] | flatten | unique' | jq -r '.[] | .') | |
for rule in $rules; do | |
echo "Start fix auto correct: $rule" | |
bundle exec rubocop --auto-correct --cache true --only $rule | |
if [[ ! -z $(git status -s) ]]; then | |
git commit -am ":cop: auto correct $rule" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment