Last active
November 14, 2018 16:25
-
-
Save dbarria/58207589be1a30e582f27367f3e37749 to your computer and use it in GitHub Desktop.
Precommit hook to run reek
This file contains 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
#!/bin/bash -l | |
source "$HOME/.rvm/scripts/rvm" | |
cd $HOME/arboles/camperfarm-web | |
find . -type f -name "*.rb" ! -path './vendor/*' ! -path './spec/*' | sort > current_rb_files | |
diff_command=`diff --new-line-format="" --unchanged-line-format="" current_rb_files .reek_legacy_file_list` | |
rm current_rb_files | |
if [ -z "$diff_command" ]; then | |
echo "There is no ruby files to analyze" | |
else | |
echo $diff_command | tr "\r\n" " " | xargs bundle exec reek | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment