This repository was archived by the owner on Jun 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,12 +9,6 @@ CLEAR_LINE='\r\033[K'
99
1010REPO_BASE_DIR=" $( git rev-parse --show-toplevel) "
1111
12- if ! command -v rubocop > /dev/null; then
13- printf " ${CLEAR_LINE} 💀${RED} Install Rubocop and be sure it is available on your PATH.${NO_COLOR} \n"
14- printf " ℹ️ Try 'gem install rubocop'\n"
15- exit 1
16- fi
17-
1812pushd " ${REPO_BASE_DIR} "
1913 INNOCENTS=" $( git diff --name-only --diff-filter=AMC | grep -i ' .*\.rb' | sort) "
2014 SUSPECTS=" $( git diff --cached --name-only --diff-filter=AMC | grep -i ' .*\.rb' | sort) "
@@ -24,14 +18,14 @@ pushd "${REPO_BASE_DIR}"
2418
2519 printf " \n🚔 Linting with Rubocop...\n"
2620
27- if rubocop --parallel --cache=true --format autogenconf ${SUSPECTS} ; then
21+ if bundle exec rubocop --parallel --cache=true --format autogenconf ${SUSPECTS} ; then
2822 printf " ${CLEAR_LINE} 🎉${GREEN} Rubocop is appeased.${NO_COLOR} \n"
2923 exit 0
3024 fi
3125
3226 printf " \n${CLEAR_LINE}${RED} 💀 Rubocop found some issues. Let's see if it can autocorrect the files you're trying to commit...${NO_COLOR} \n"
3327
34- if ! rubocop --auto-correct --cache=true ${SUSPECTS} ; then
28+ if ! bundle exec rubocop --auto-correct --cache=true ${SUSPECTS} ; then
3529 printf " \n${CLEAR_LINE}${RED} 💀 Rubocop couldn't autocorrect everything! 😭 ${NO_COLOR} \n"
3630 exit 1
3731 fi
You can’t perform that action at this time.
0 commit comments