diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100755 index 0000000..f966c3c --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +message_file = ARGV[0] +message = File.read(message_file) + +$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]\.)?$') + +if !$grammar_regex.match(message) + puts "Your message does not match with the rules defined in the CONTRIBUTING.md." + exit 1 +end \ No newline at end of file