-
-
Save tannermares/6224008 to your computer and use it in GitHub Desktop.
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[31mPlease focus and remove your :focus tags before committing!\e[0m" | |
exit 1 | |
end | |
if `git diff --cached app/assets/javascripts` =~ /\+\s*console.log/ | |
puts "\e[31mPlease remove your console.logs before committing!\e[0m" | |
exit 1 | |
end | |
if `git diff --cached config/initializers` =~ /\+\s*if true/ | |
puts "\e[31mPlease don't inline resque in production, I know you did.\e[0m" | |
exit 1 | |
end | |
if !(`git diff --cached | grep Gemfile`).empty? && (`git diff --cached | grep Gemfile.next`).empty? | |
puts "*" * 80 | |
puts "\e[31mLooks like you updated your Gemfile, update Gemfile.next if needed!\e[0m" | |
puts "\e[31mBUNDLE_GEMFILE=Gemfile.next bundle install\e[0m" | |
puts "*" * 80 | |
exit 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
woot