class Pronto::Formatter::CommitFormatter

Public Instance Methods

existing_comments(messages, client, _) click to toggle source
# File lib/pronto/formatter/commit_formatter.rb, line 4
def existing_comments(messages, client, _)
  shas = messages.map(&:commit_sha)
  comments = shas.flat_map { |sha| client.commit_comments(sha) }
  grouped_comments(comments)
end
submit_comments(client, comments) click to toggle source
# File lib/pronto/formatter/commit_formatter.rb, line 10
def submit_comments(client, comments)
  comments.each { |comment| client.create_commit_comment(comment) }
rescue Octokit::UnprocessableEntity, HTTParty::Error => e
  $stderr.puts "Failed to post: #{e.message}"
  $stderr.puts e.inspect
end