Created
October 3, 2016 04:53
-
-
Save fujimura/855b58449a7b45176df085907f171b78 to your computer and use it in GitHub Desktop.
Script to make a pull request with the result from rubocop --auto-correct
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
bundle exec rubocop --auto-correct $(git ls-files | grep -E -v "^(db|bin)" | grep "\.rb$") || true | |
git diff --exit-code && exit 0 | |
git add . | |
timestamp=`date +'%Y%m%d%H%M'` | |
commit_comment="rubocop --auto-correct $timestamp" | |
git commit -m "$commit_comment" | |
git checkout -b rubocop-auto-correct-$timestamp | |
branch_name=`git name-rev --name-only HEAD` | |
git push -u origin $branch_name | |
hub pull-request -m "$commit_comment" -h proper-inc:$branch_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment