Skip to content

Instantly share code, notes, and snippets.

@saulius
Created November 11, 2012 14:58
Show Gist options
  • Save saulius/4055140 to your computer and use it in GitHub Desktop.
Save saulius/4055140 to your computer and use it in GitHub Desktop.
pre-commit for present development artefacts on Rails project
#!/bin/bash
fail_words=("debugger" "console.log" "puts" "binding.pry" "focus: true" ":focus")
for fail_word in "${fail_words[@]}"
do
grep -q "$fail_word" <(git diff --cached) && echo "Fail word found: '$fail_word'" && exit 1
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment