-
-
Save rmosolgo/28e6053c16105521f75f to your computer and use it in GitHub Desktop.
check for focus and console.log before committing
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
#!/usr/bin/env ruby | |
if `git diff --cached spec` =~ /,\s?(:focus|focus:\s?true|:focus\s?=>\s?true)/ | |
puts "\e[31mRemove your :focus tags before committing!\e[0m" | |
exit 1 | |
end | |
if `git diff --cached spec` =~ /console\.log/ | |
puts "\e[31mRemove your console.log before committing!\e[0m" | |
exit 1 | |
end | |
# put this in file: .git/hooks/pre-commit | |
# make it executable: chmod +x .git/hooks/pre-commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment