class Pronto::Formatter::GitlabMergeRequestReviewFormatter

Public Class Methods

name() click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 4
def self.name
  'gitlab_mr'
end

Public Instance Methods

client_module() click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 8
def client_module
  Gitlab
end
existing_comments(_, client, repo) click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 16
def existing_comments(_, client, repo)
  sha = repo.head_commit_sha
  comments = client.pull_comments(sha)
  grouped_comments(comments)
end
line_number(message, _) click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 28
def line_number(message, _)
  message.line.line.new_lineno if message.line
end
pretty_name() click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 12
def pretty_name
  'Gitlab'
end
submit_comments(client, comments) click to toggle source
# File lib/pronto/formatter/gitlab_merge_request_review_formatter.rb, line 22
def submit_comments(client, comments)
  client.create_pull_request_review(comments)
rescue => e
  $stderr.puts "Failed to post: #{e.message}"
end