Skip to content

Instantly share code, notes, and snippets.

@rgould
Last active August 17, 2016 17:18
Show Gist options
  • Save rgould/9e7900486296cbee2e16c6b3c9823a7b to your computer and use it in GitHub Desktop.
Save rgould/9e7900486296cbee2e16c6b3c9823a7b to your computer and use it in GitHub Desktop.
Don't allow rspec's `:focus` to be committed
#!/usr/bin/env ruby
# Copy this to your project's `.git/pre-commit` file.
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