Skip to content

Instantly share code, notes, and snippets.

@jonasschmidt
Last active August 17, 2018 06:55
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jonasschmidt/5944410 to your computer and use it in GitHub Desktop.
Save jonasschmidt/5944410 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
@adonaldson
Copy link

This is just what I was looking for, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment