def add_comment(path, position, message, severity)
      stripped_path = path.strip

      raise GergichError, "invalid position `#{position}`" unless valid_position?(position)
      position = position.to_json if position.is_a?(Hash)
      raise GergichError, "invalid severity `#{severity}`" unless SEVERITY_MAP.key?(severity)
      raise GergichError, "no message specified" unless message.is_a?(String) && !message.empty?

      db.execute "INSERT INTO comments (path, position, message, severity) VALUES (?, ?, ?, ?)",
                 [stripped_path, position, message, severity]
    end
def add_comment(path, position, message, severity)
      stripped_path = path.strip

      raise GergichError, "invalid position `#{position}`" unless valid_position?(position)
      position = position.to_json if position.is_a?(Hash)
      raise GergichError, "invalid severity `#{severity}`" unless SEVERITY_MAP.key?(severity)
      raise GergichError, "no message specified" unless message.is_a?(String) && !message.empty?

      db.execute "INSERT INTO comments (path, position, message, severity) VALUES (?, ?, ?, ?)",
                 [stripped_path, position, message, severity]
    end
Public: add an inline comment to the draft

 path     - the relative file path, e.g. "app/models/user.rb"
 position - either a Fixnum (line number) or a Hash (range). If a
            Hash, must have the following Fixnum properties:
              * start_line
              * start_character
              * end_line
              * end_character
 message  - the text of the comment
 severity - "info"|"warn"|"error" - this will automatically prefix
            the comment (e.g. "[ERROR] message here"), and the most
            severe comment will be used to determine the overall
            Code-Review score (0, -1, or -2 respectively)