Skip to content

Commit 106a1c3

Browse files
committed
: lock: Add git commit message hook.
1 parent cc4506c commit 106a1c3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.githooks/commit-msg

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ruby
2+
3+
message_file = ARGV[0]
4+
message = File.read(message_file)
5+
6+
$grammar_regex = Regexp.new('^:(memo|art|racehorse|non-potable_water|bug|fire|green_heart|white_check_mark|lock|arrow_up|arrow_down|shirt):\s[A-Z][\w\d\s]*[\w\d]\.(\s(Related to)[#\w\d\s]*[\w\d]\.)?$')
7+
8+
if !$grammar_regex.match(message)
9+
puts "Your message does not match with the rules defined in the CONTRIBUTING.md."
10+
exit 1
11+
end

0 commit comments

Comments
 (0)