Skip to content

Instantly share code, notes, and snippets.

@ifyouseewendy
Last active May 18, 2017 15:26
Show Gist options
  • Save ifyouseewendy/7b598b36137ffd025ed8e3530a9cf723 to your computer and use it in GitHub Desktop.
Save ifyouseewendy/7b598b36137ffd025ed8e3530a9cf723 to your computer and use it in GitHub Desktop.
A hook script to do code checking, linting and testing before git push. Change pre-push.sh to pre-push before use.
#!/bin/bash
# http://misc.flogisoft.com/bash/tip_colors_and_formatting
color_echo () {
echo -e "\033[1;97;44m==> $1 \033[m"
}
color_echo "yarn lint"
yarn lint
color_echo "yarn stylelint"
yarn stylelint
color_echo "yarn test"
yarn test
color_echo "yarn run flow check"
yarn run flow check
color_echo "yamllint -s config/locales/*.yml"
yamllint -s config/locales/*.yml
color_echo "rubocop -c tmp/rubocop.yml"
rubocop -c tmp/rubocop.yml
color_echo "rake"
rake
inherit_from:
- ./../.rubocop.yml
AllCops:
TargetRubyVersion: 2.3
Exclude:
- "config/spring.rb"
- "config/initializers/**/*"
- "config/environments/**/*"
- "db/schema.rb"
- "node_modules/**/*"
- "bin/**/*"
- "vendor/**/*"
- "db/migrate/**"
Metrics/BlockLength:
Exclude:
- "test/**/*"
- "lib/tasks/**"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment