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

Version Path
steppy-1.0.8 hooks/pre-commit
steppy-1.0.7 hooks/pre-commit
steppy-1.0.6 hooks/pre-commit
steppy-1.0.5 hooks/pre-commit
steppy-1.0.4 hooks/pre-commit
steppy-1.0.3 hooks/pre-commit
steppy-1.0.2 hooks/pre-commit
steppy-1.0.1 hooks/pre-commit
steppy-1.0.0 hooks/pre-commit
steppy-0.8.0 hooks/pre-commit
steppy-0.7.0 hooks/pre-commit
steppy-0.6.0 hooks/pre-commit
steppy-0.5.4 hooks/pre-commit
steppy-0.5.3 hooks/pre-commit
steppy-0.5.2 hooks/pre-commit
steppy-0.5.1 hooks/pre-commit
steppy-0.5.0 hooks/pre-commit
steppy-0.1.0 hooks/pre-commit
steppy-0.0.1 hooks/pre-commit