Skip to content

Instantly share code, notes, and snippets.

@ramonfabrega
Created September 23, 2020 20:18
Show Gist options
  • Save ramonfabrega/c460842426a097409ba19a9f9139e4aa to your computer and use it in GitHub Desktop.
Save ramonfabrega/c460842426a097409ba19a9f9139e4aa to your computer and use it in GitHub Desktop.
pre-commit hook: prevent rspec :focus tags
#!/usr/bin/env ruby
if `git diff --cached api/spec` =~ /,\s?(:focus|focus:\s?true|:focus\s?=>\s?true)/
puts "\e[31mPlease remove your :focus or focus: true tags before committing :)"
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment