Class: Pronto::Formatter::GitlabMergeRequestReviewFormatter
- Inherits:
-
PullRequestFormatter
- Object
- Base
- GitFormatter
- PullRequestFormatter
- Pronto::Formatter::GitlabMergeRequestReviewFormatter
- Defined in:
- lib/pronto/formatter/gitlab_merge_request_review_formatter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #client_module ⇒ Object
- #existing_comments(_, client, repo) ⇒ Object
- #line_number(message, _) ⇒ Object
- #pretty_name ⇒ Object
- #submit_comments(client, comments) ⇒ Object
Methods inherited from GitFormatter
Methods inherited from Base
Class Method Details
.name ⇒ Object
4 5 6 |
# File 'lib/pronto/formatter/gitlab_merge_request_review_formatter.rb', line 4 def self.name 'gitlab_mr' end |
Instance Method Details
#client_module ⇒ Object
8 9 10 |
# File 'lib/pronto/formatter/gitlab_merge_request_review_formatter.rb', line 8 def client_module Gitlab end |
#existing_comments(_, client, repo) ⇒ Object
16 17 18 19 20 |
# 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, _) ⇒ Object
28 29 30 |
# File 'lib/pronto/formatter/gitlab_merge_request_review_formatter.rb', line 28 def line_number(, _) .line.line.new_lineno if .line end |
#pretty_name ⇒ Object
12 13 14 |
# File 'lib/pronto/formatter/gitlab_merge_request_review_formatter.rb', line 12 def pretty_name 'Gitlab' end |
#submit_comments(client, comments) ⇒ Object
22 23 24 25 26 |
# 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.}" end |