Created
December 16, 2020 08:17
-
-
Save tngranados/645f9f05062be26c8f31a3976e8d276f to your computer and use it in GitHub Desktop.
Run every check before merging a PR
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
lgtm() { | |
yarn lint || { echo -e '\n\n \e[31mSomething went wrong: javascript linting\e[m \n\n' && return false } | |
rubocop -a || { echo -e '\n\n \e[31mSomething went wrong: ruby linting\e[m \n\n' && return false } | |
yarn test || { echo -e '\n\n \e[31mSomething went wrong: javascript testing\e[m \n\n' && return false } | |
rspec || { echo -e '\n\n \e[31mSomething went wrong: ruby testing\e[m \n\n' && return false } | |
if [[ -n $(git status -s) ]]; then | |
git status | |
echo -e '\n\n \e[33mAll good, but git status is dirty\e[m \n\n' | |
else | |
echo -e '\n\n \e[32mAll good, LGTM!\e[m \n\n' | |
fi | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rubocop -a
->rubocop
, so it forces failure similar to CI