Sha256: d7ad3d761793224503d1428af28e1fea440cb2c18a819e699cb78a81cbbd693c

Contents?: true

Size: 1.82 KB

Versions: 2

Compression:

Stored size: 1.82 KB

Contents

#!/bin/zsh

source ~/.zshrc

grep 'rack-mini-profiler' Gemfile.lock >> /dev/null
if [ $? -eq 0 ]; then
  echo 'rack-mini-profiler detected in Gemfile.lock.'
  echo 'Please remove rack-mini-profiler from your Gemfile(.local), run bundle and commit again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r 'TODO' lib spec Gemfile
if [ $? -eq 0 ]; then
  echo 'TODOs found. Please fix them and try again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r 'console.log' lib spec
if [ $? -eq 0 ]; then
  echo 'console.log found. Please fix them and try again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r '  puts ' lib spec
if [ $? -eq 0 ]; then
  echo 'puts found. Please fix them and try again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r '  puts(' lib spec
if [ $? -eq 0 ]; then
  echo 'puts found. Please fix them and try again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r '  p ' lib spec
if [ $? -eq 0 ]; then
  echo 'p found. Please fix them and try again, commit aborted'
  exit 1
fi

grep --exclude-dir="lib/renuo_bin_check/default_scripts" -i -r '  p(' lib spec
if [ $? -eq 0 ]; then
  echo 'p found. Please fix them and try again, commit aborted'
  exit 1
fi

bundle exec rubocop -D -c .rubocop.yml --fail-fast
if [ ! $? -eq 0 ]; then
  echo 'rubocop detected issues!'
  bundle exec rubocop -a -D -c .rubocop.yml
  echo 'Tried to auto correct the issues, but must be reviewed manually, commit aborted'
  exit 1
fi

bundle exec reek
if [ ! $? -eq 0 ]; then
  echo 'reek detected code smells, commit aborted'
  exit 1
fi

bundle exec rspec
if [ ! $? -eq 0 ]; then
  echo 'rspec did not run successfully, commit aborted'
  exit 1
fi

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
renuo-bin-check-0.2.1 bin/check
renuo-bin-check-0.2.0 bin/check