Last active
September 6, 2024 15:32
-
-
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
This file contains hidden or 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 :)" | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just what I was looking for, thanks!