class Pronto::Formatter::PullRequestFormatter

Public Instance Methods

existing_comments(_, client, repo) click to toggle source
# File lib/pronto/formatter/pull_request_formatter.rb, line 4
def existing_comments(_, client, repo)
  sha = repo.head_commit_sha
  comments = client.pull_comments(sha)
  grouped_comments(comments)
end
submit_comments(client, comments) click to toggle source
# File lib/pronto/formatter/pull_request_formatter.rb, line 10
def submit_comments(client, comments)
  comments.each { |comment| client.create_pull_comment(comment) }
rescue Octokit::UnprocessableEntity, HTTParty::Error => e
  $stderr.puts "Failed to post: #{e.message}"
end