Sha256: 00c469f326bc587a629540f8b679c59c3753e0fc325f01176b4df0beb9c91955

Contents?: true

Size: 663 Bytes

Versions: 2

Compression:

Stored size: 663 Bytes

Contents

module Pronto
  module Formatter
    class GitlabMergeRequestReviewFormatter < PullRequestFormatter
      def client_module
        Gitlab
      end

      def pretty_name
        'Gitlab'
      end

      def existing_comments(_, client, repo)
        sha = repo.head_commit_sha
        comments = client.pull_comments(sha)
        grouped_comments(comments)
      end

      def submit_comments(client, comments)
        client.create_pull_request_review(comments)
      rescue => e
        $stderr.puts "Failed to post: #{e.message}"
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pronto-0.11.1 lib/pronto/formatter/gitlab_merge_request_review_formatter.rb
pronto-0.11.0 lib/pronto/formatter/gitlab_merge_request_review_formatter.rb