Sha256: ec71086afd42491b0d1de7976377bd19e277843e126e5ba84456cddd8957f8d8
Contents?: true
Size: 1002 Bytes
Versions: 19
Compression:
Stored size: 1002 Bytes
Contents
#!/bin/sh pass=true RED='\033[1;31m' GREEN='\033[0;32m' NC='\033[0m' echo "Running Linters:" # Run rubocop and get the output and return code rubocop=$(git status | grep -v deleted | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --parallel --force-exclusion --format simple ${suspects}) return_code=$? if [ $return_code != 0 ]; then echo "$rubocop\n" printf "\n${RED}Rubocop failed, please fix and then re-commit${NC}\n" pass=false else printf "${GREEN}Rubocop passed.${NC}\n" fi # Run reek and get the output and return code reek=$(git status | grep -v deleted | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec bundle exec reek --force-exclusion) return_code=$? if [ $return_code != 0 ]; then echo "$reek\n" printf "\n${RED}Reek failed, please fix and then re-commit.${NC}\n" pass=false else printf "${GREEN}Reek passed.${NC}\n" fi # If you reach this point, everything was cool and means you are a good player if $pass; then exit 0 fi exit 1
Version data entries
19 entries across 19 versions & 1 rubygems