sds/overcommit · error · Overcommit::Exceptions::MessageProcessingError
Unexpected output: invalid line number found in '#{message}'
Error message
Unexpected output: invalid line number found in '#{message}' What it means
Error "Unexpected output: invalid line number found in '#{message}'" thrown in sds/overcommit.
Source
Thrown at lib/overcommit/utils/messages_utils.rb:58
private
def extract_file(match, message)
return unless match.names.include?('file')
if match[:file].to_s.empty?
raise Overcommit::Exceptions::MessageProcessingError,
"Unexpected output: no file found in '#{message}'"
end
match[:file]
end
def extract_line(match, message)
return unless match.names.include?('line')
Integer(match[:line])
rescue ArgumentError, TypeError
raise Overcommit::Exceptions::MessageProcessingError,
"Unexpected output: invalid line number found in '#{message}'"
end
def extract_type(match, message, type_categorizer)
if type_categorizer
type_match = match.names.include?('type') ? match[:type] : nil
type = type_categorizer.call(type_match)
unless Overcommit::Hook::MESSAGE_TYPES.include?(type)
raise Overcommit::Exceptions::MessageProcessingError,
"Invalid message type '#{type}' for '#{message}': must " \
"be one of #{Overcommit::Hook::MESSAGE_TYPES.inspect}"
end
type
else
:error # Assume error since no categorizer was defined
end
end
endView on GitHub (pinned to fee0cd74b2)
Solutions
- Ensure the line-number field of each tool output line is a valid integer.
- Adjust the tool's output format or the hook's parsing regex so line numbers are extracted as numeric values.
When it happens
Trigger: Thrown at lib/overcommit/utils/messages_utils.rb:58 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sds/overcommit@fee0cd74b2 (2026-08-23).
Data as JSON: /api/errors/60ec5700416a717d.
Report an issue: GitHub.