Class: Pronto::Formatter::BitbucketPullRequestFormatter

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

Instance Method Summary collapse

Methods inherited from PullRequestFormatter

#existing_comments, #submit_comments

Methods inherited from GitFormatter

#format

Methods inherited from Base

#config, name

Instance Method Details

#approve_pull_request(comments_count, additions_count, client) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/pronto/formatter/bitbucket_pull_request_formatter.rb', line 16

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



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

def client_module
  Bitbucket
end

#line_number(message, _) ⇒ Object



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

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

#pretty_nameObject



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

def pretty_name
  'BitBucket'
end