Sha256: 5a4f8061c36df67af1758857e824931d8ca01b577b573104ba5ef3a0b8723de8

Contents?: true

Size: 578 Bytes

Versions: 2

Compression:

Stored size: 578 Bytes

Contents

module Pronto
  module Formatter
    class CommitFormatter < GitFormatter
      def existing_comments(client, sha)
        comments = client.commit_comments(sha)
        grouped_comments(comments)
      end

      def line_number(message, _)
        message.line.new_lineno
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pronto-0.8.0 lib/pronto/formatter/commit_formatter.rb
pronto-0.7.1 lib/pronto/formatter/commit_formatter.rb