Class: Pronto::Formatter::BitbucketPullRequestFormatter

Inherits:
PullRequestFormatter show all
Defined in:
lib/pronto/formatter/bitbucket_pull_request_formatter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PullRequestFormatter

#existing_comments, #submit_comments

Methods inherited from GitFormatter

#format

Methods inherited from Base

#config

Class Method Details

.nameObject



4
5
6
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 4

def self.name
  'bitbucket_pr'
end

Instance Method Details

#approve_pull_request(comments_count, additions_count, client) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 20

def approve_pull_request(comments_count, additions_count, client)
  return if config.bitbucket_auto_approve == false

  if comments_count > 0 && additions_count > 0
    client.unapprove_pull_request
  elsif comments_count == 0
    client.approve_pull_request
  end
end

#client_moduleObject



8
9
10
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 8

def client_module
  Bitbucket
end

#line_number(message, _) ⇒ Object



16
17
18
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 16

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

#pretty_nameObject



12
13
14
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 12

def pretty_name
  'BitBucket'
end