Skip to content

Instantly share code, notes, and snippets.

@lucascaton
Forked from jonasschmidt/pre-commit
Created December 9, 2015 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucascaton/2f4555747c29d8766e73 to your computer and use it in GitHub Desktop.
Save lucascaton/2f4555747c29d8766e73 to your computer and use it in GitHub Desktop.
git pre-commit hook checking for RSpec :focus tags that were unintentionally left in the specs
#!/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 :)"
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment