def error_messages(yard_coverage, error_text)
      first_message = "You have a #{yard_coverage}% yard documentation coverage. "\
                      "#{config['min_coverage_percentage']}% is the minimum required."

      # Add the undocumented objects text as error messages
      messages = [Overcommit::Hook::Message.new(:error, nil, nil, first_message)]

      errors = error_text.strip.split("\n")
      errors.each do |undocumented_object|
        undocumented_object_message, file_info = undocumented_object.split(/:?\s+/)
        file_info_match = file_info.match(/^\(([^:]+):(\d+)\)/)

        # In case any compacted error does not follow the format, ignore it
        if file_info_match
          file = file_info_match.captures[0]
          line = file_info_match.captures[1]
          messages << Overcommit::Hook::Message.new(
            :error, file, line, "#{file}:#{line}: #{undocumented_object_message}"
          )
        end
      end
      messages
    end
def error_messages(yard_coverage, error_text)
      first_message = "You have a #{yard_coverage}% yard documentation coverage. "\
                      "#{config['min_coverage_percentage']}% is the minimum required."

      # Add the undocumented objects text as error messages
      messages = [Overcommit::Hook::Message.new(:error, nil, nil, first_message)]

      errors = error_text.strip.split("\n")
      errors.each do |undocumented_object|
        undocumented_object_message, file_info = undocumented_object.split(/:?\s+/)
        file_info_match = file_info.match(/^\(([^:]+):(\d+)\)/)

        # In case any compacted error does not follow the format, ignore it
        if file_info_match
          file = file_info_match.captures[0]
          line = file_info_match.captures[1]
          messages << Overcommit::Hook::Message.new(
            :error, file, line, "#{file}:#{line}: #{undocumented_object_message}"
          )
        end
      end
      messages
    end
Create the error messages