Skip to content

Commit 2570054

Browse files
jawshooahsds
authored andcommitted
Allow message regex to omit 'line' group
1 parent c45df61 commit 2570054

File tree

1 file changed

+1
-1
lines changed
  • lib/overcommit/hook/pre_commit

1 file changed

+1
-1
lines changed

lib/overcommit/hook/pre_commit/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def extract_messages(output_messages, regex, type_categorizer = nil)
3232
end
3333

3434
file = extract_file(match, message)
35-
line = extract_line(match, message) unless match[:line].nil?
35+
line = extract_line(match, message) if match.names.include?('line') && match[:line]
3636
type = extract_type(match, message, type_categorizer)
3737

3838
Overcommit::Hook::Message.new(type, file, line, message)

0 commit comments

Comments
 (0)