pronto 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -1
  3. data/CONTRIBUTING.md +1 -0
  4. data/README.md +51 -5
  5. data/lib/pronto.rb +8 -0
  6. data/lib/pronto/bitbucket.rb +3 -14
  7. data/lib/pronto/bitbucket_server.rb +33 -0
  8. data/lib/pronto/cli.rb +15 -6
  9. data/lib/pronto/client.rb +19 -0
  10. data/lib/pronto/clients/bitbucket_client.rb +22 -24
  11. data/lib/pronto/clients/bitbucket_server_client.rb +67 -0
  12. data/lib/pronto/config.rb +10 -1
  13. data/lib/pronto/config_file.rb +8 -1
  14. data/lib/pronto/error.rb +3 -0
  15. data/lib/pronto/formatter/base.rb +13 -0
  16. data/lib/pronto/formatter/bitbucket_server_pull_request_formatter.rb +17 -0
  17. data/lib/pronto/formatter/checkstyle_formatter.rb +1 -1
  18. data/lib/pronto/formatter/commit_formatter.rb +1 -1
  19. data/lib/pronto/formatter/formatter.rb +2 -0
  20. data/lib/pronto/formatter/git_formatter.rb +5 -7
  21. data/lib/pronto/formatter/github_pull_request_review_formatter.rb +24 -0
  22. data/lib/pronto/formatter/json_formatter.rb +1 -1
  23. data/lib/pronto/formatter/null_formatter.rb +2 -3
  24. data/lib/pronto/formatter/pull_request_formatter.rb +1 -1
  25. data/lib/pronto/formatter/text_formatter.rb +6 -36
  26. data/lib/pronto/formatter/text_message_decorator.rb +46 -0
  27. data/lib/pronto/git/line.rb +6 -4
  28. data/lib/pronto/git/patches.rb +2 -2
  29. data/lib/pronto/git/repository.rb +12 -8
  30. data/lib/pronto/github.rb +20 -17
  31. data/lib/pronto/gitlab.rb +2 -9
  32. data/lib/pronto/message.rb +13 -2
  33. data/lib/pronto/runner.rb +1 -0
  34. data/lib/pronto/runners.rb +1 -2
  35. data/lib/pronto/version.rb +1 -1
  36. data/pronto.gemspec +6 -5
  37. metadata +37 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcfa0272ff5c7843fd8324ad6501712d4b44f0d2
4
- data.tar.gz: 9307ded530f2ff112a815288f26eef50d4c94980
3
+ metadata.gz: 099138cee32a88a8f83065a6fc4c270da56a7a6d
4
+ data.tar.gz: 623bb35ba84b91ba174d1d50cd89ef9fa4a808a7
5
5
  SHA512:
6
- metadata.gz: 7005406729f52f4f2e8c350be4c3cb061a1c38d3647eb006f17079f62c375149615e8d748766a310e277d0057cd67dcf6ba7bc07cd4958ce07b2231733bd47ee
7
- data.tar.gz: 43b1369e95053918c26518c41f6f2bfb310edfc7d028d8a2067c0c69ce5872c77cacbadfee602c783ef37afd39f62f0d69de461b8ea93a8e1fcc5bc60f0bc021
6
+ metadata.gz: 4aab1e003de4850796ccb246d9a19e1cd3af73672846bfb1f6aa0480c3601b975922bd12d2d8138ab2a5d3422e0493934b472a7dd6ea39837e7b03bd0c205471
7
+ data.tar.gz: 9c06c011e43bd2e0c82f685182502b7f292d8bb4954fab1fcba4a9b1ac1cd6bd55df86940d778d34f7e52e032cbd52da43bd72d8bec609fbc5fcb71e08330ccc
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### New features
6
+
7
+ * [#206](https://github.com/mmozuras/pronto/pull/216): add Bitbucket Server pull request formatter.
8
+ * [#204](https://github.com/mmozuras/pronto/pull/204): add ability configure message format for each formatter.
9
+ * [#111](https://github.com/mmozuras/pronto/issues/111): add `--staged` option for `pronto run` to analyze staged changes.
10
+ * [#217](https://github.com/mmozuras/pronto/issues/217): add GitHub pull request review formatter.
11
+
12
+ ### Changes
13
+
14
+ * [#193](https://github.com/mmozuras/pronto/issues/193): rename `pronto run --index` option to `--unstaged`.
15
+ * [#49](https://github.com/mmozuras/pronto/issues/49): handle non-existance of GitHub pull requests gracefully.
16
+ * [#217](https://github.com/mmozuras/pronto/issues/217): depend on `octokit >= 4.7.0`.
17
+ * [#224](https://github.com/mmozuras/pronto/issues/224): depend on `gitlab >= 4.0.0`.
18
+ * [#222](https://github.com/mmozuras/pronto/pull/184): prefix PULL_REQUEST_ID env variable with `PRONTO_`.
19
+
20
+ ### Bugs fixed
21
+
22
+ * [#215](https://github.com/mmozuras/pronto/pull/215): an exclusion of files for single runner led to those files being excluded for all runners.
23
+
3
24
  ## 0.8.2
4
25
 
5
26
  ### Bugs fixed
@@ -10,7 +31,7 @@
10
31
 
11
32
  ### Changes
12
33
 
13
- * Add a default GitLab API endpoint: https://gitlab.com/api/v3
34
+ * Add a default GitLab API endpoint: https://gitlab.com/api/v3.
14
35
 
15
36
  ### Bugs fixed
16
37
 
@@ -22,6 +22,7 @@ do so.
22
22
  * Use a topic/feature branch to easily amend a pull request later, if necessary.
23
23
  * Write [good commit messages][3].
24
24
  * Use the same coding conventions as the rest of the project.
25
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. You can also test your version of pronto locally with the help of `gem build` and `gem install`.
25
26
  * Commit and push until you are happy with your contribution.
26
27
  * Open a [pull request][4] that relates to *only* one subject with a clear title
27
28
  and description in grammatically correct, complete sentences.
data/README.md CHANGED
@@ -1,18 +1,21 @@
1
1
  # Pronto
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/mmozuras/pronto.svg)](https://codeclimate.com/github/mmozuras/pronto)
4
3
  [![Build Status](https://secure.travis-ci.org/mmozuras/pronto.svg)](http://travis-ci.org/mmozuras/pronto)
4
+ [![Coverage Status](https://img.shields.io/codeclimate/coverage/github/mmozuras/pronto.svg)](https://codeclimate.com/github/mmozuras/pronto)
5
+ [![Code Climate](https://codeclimate.com/github/mmozuras/pronto.svg)](https://codeclimate.com/github/mmozuras/pronto)
5
6
  [![Gem Version](https://badge.fury.io/rb/pronto.svg)](http://badge.fury.io/rb/pronto)
6
7
  [![Dependency Status](https://gemnasium.com/mmozuras/pronto.svg)](https://gemnasium.com/mmozuras/pronto)
7
8
  [![Inline docs](http://inch-ci.org/github/mmozuras/pronto.svg)](http://inch-ci.org/github/mmozuras/pronto)
8
9
 
9
10
  **Pronto** runs analysis quickly by checking only the relevant changes. Created to
10
11
  be used on [GitHub pull requests](#github-integration), but also works [locally](#local-changes) and integrates with [GitLab](#gitlab-integration) and [Bitbucket](#bitbucket-integration).
11
- Perfect if want to find out quickly if branch introduces changes that conform
12
+ Perfect if you want to find out quickly if a branch introduces changes that conform
12
13
  to your [styleguide](https://github.com/mmozuras/pronto-rubocop), [are DRY](https://github.com/mmozuras/pronto-flay), [don't introduce security holes](https://github.com/mmozuras/pronto-brakeman) and [more](#runners).
13
14
 
14
15
  ![Pronto demo](pronto.gif "")
15
16
 
17
+ _This README might be ahead of the latest release. Find the README for v0.9.0 [here](https://github.com/mmozuras/pronto/blob/v0.9.0/README.md)._
18
+
16
19
  * [Installation](#installation)
17
20
  * [Usage](#usage)
18
21
  * [Local Changes](#local-changes)
@@ -63,8 +66,11 @@ git checkout feature/branch
63
66
  # Analyze diff of committed changes on current branch and master:
64
67
  pronto run
65
68
 
69
+ # Analyze changes in git staging area
70
+ pronto run --staged
71
+
66
72
  # Analyze diff of uncommitted changes and master:
67
- pronto run --index
73
+ pronto run --unstaged
68
74
 
69
75
  # Analyze *all* changes since the *initial* commit (may take some time):
70
76
  pronto run --commit=$(git log --pretty=format:%H | tail -1)
@@ -78,7 +84,8 @@ Available Options
78
84
  |:------------------|:------------------------------------------------------------|
79
85
  | `--exit-code` | Exits with non-zero code if there were any warnings/errors. |
80
86
  | `-c/--commit` | Commit for the diff. |
81
- | `-i/--index` | Analyze changes in git index (staging area). |
87
+ | `--staged` | Analyze changes in git staging area |
88
+ | `--unstaged` | Analyze changes made, but not in git staging area |
82
89
  | `-r/--runner` | Run only the passed runners. |
83
90
  | `-f/--formatters` | Pick output formatters. |
84
91
 
@@ -114,7 +121,7 @@ It's possible to combine multiple formatters.
114
121
  To get both pull request comments and commit status summary use:
115
122
 
116
123
  ```sh
117
- $ PRONTO_GITHUB_ACCESS_TOKEN=token PULL_REQUEST_ID=id pronto run -f github_status github_pr -c origin/master
124
+ $ PRONTO_GITHUB_ACCESS_TOKEN=token PRONTO_PULL_REQUEST_ID=id pronto run -f github_status github_pr -c origin/master
118
125
  ```
119
126
 
120
127
  As an alternative, you can also set up a rake task:
@@ -207,6 +214,43 @@ via environment variables. Their names will be the upcased path to the property.
207
214
  For example: `PRONTO_GITHUB_SLUG` or `PRONTO_GITLAB_API_PRIVATE_TOKEN`. Environment variables
208
215
  will always take precedence over values in configuration file.
209
216
 
217
+ ### Message format
218
+
219
+ Pronto allows you to configure the format of the messages that are produced. You
220
+ can set a default format that will be used by all formatters, or you can
221
+ configure a separate format per formatter, if you are using several.
222
+
223
+ To change the default format:
224
+
225
+ ```yaml
226
+ format: "%{runner} %{level} %{msg}"
227
+ ```
228
+
229
+ To add the title of the Runner to the GitHub Pull Request formatter only:
230
+
231
+ ```yaml
232
+ github_pr:
233
+ format: "%{runner} - %{msg}"
234
+ ```
235
+
236
+ The available values to be interpolated into the message are:
237
+
238
+ | Key | Description |
239
+ |--------------|----------------|
240
+ | `path` | File path. |
241
+ | `line` | Line number. |
242
+ | `level` | Message level. |
243
+ | `msg` | Message. |
244
+ | `commit_sha` | SHA. |
245
+ | `runner` | Runner name. |
246
+
247
+ The following values are available only to the text formatter:
248
+
249
+ | Key | Description |
250
+ |------------------|--------------------------|
251
+ | `color_level` | Colorized message level. |
252
+ | `color_location` | Colorized location. |
253
+
210
254
  ## Runners
211
255
 
212
256
  Pronto can run various tools and libraries, as long as there's a runner for it.
@@ -228,6 +272,7 @@ Currently available:
228
272
  * [pronto-jshint](https://github.com/mmozuras/pronto-jshint)
229
273
  * [pronto-json](https://github.com/deees/pronto-json)
230
274
  * [pronto-luacheck](https://github.com/seikichi/pronto-luacheck)
275
+ * [pronto-perl_lint](https://github.com/bells17/pronto-perl_lint)
231
276
  * [pronto-phpcs](https://github.com/EllisV/pronto-phpcs)
232
277
  * [pronto-phpmd](https://github.com/EllisV/pronto-phpmd)
233
278
  * [pronto-poper](https://github.com/mmozuras/pronto-poper)
@@ -258,6 +303,7 @@ Articles to help you to get started:
258
303
  * [Automated Elixir code review with Github, Credo and Travis CI](https://medium.com/fazibear/automated-elixir-code-review-with-github-credo-and-travis-ci-986cd56b8f02)
259
304
  * [Running Rubocop before git commit](https://christoph.luppri.ch/articles/2016/11/21/running-rubocop-before-git-commit/)
260
305
  * [Pronto, Codeship and GitHub for automatic code review](http://abinoam.tl1n.com/pronto-codeship-and-github-for-automatic-code-review/)
306
+ * [How to automatically review your PRs for style violations with Pronto and RuboCop](https://christoph.luppri.ch/articles/2017/03/05/how-to-automatically-review-your-prs-for-style-violations-with-pronto-and-rubocop/)
261
307
 
262
308
  Make a Pull Request to add something you wrote or found useful.
263
309
 
@@ -5,6 +5,8 @@ require 'forwardable'
5
5
  require 'httparty'
6
6
  require 'rainbow'
7
7
 
8
+ require 'pronto/error'
9
+
8
10
  require 'pronto/gem_names'
9
11
 
10
12
  require 'pronto/logger'
@@ -12,6 +14,7 @@ require 'pronto/config_file'
12
14
  require 'pronto/config'
13
15
 
14
16
  require 'pronto/clients/bitbucket_client'
17
+ require 'pronto/clients/bitbucket_server_client'
15
18
 
16
19
  require 'pronto/git/repository'
17
20
  require 'pronto/git/patches'
@@ -24,11 +27,14 @@ require 'pronto/comment'
24
27
  require 'pronto/status'
25
28
  require 'pronto/runner'
26
29
  require 'pronto/runners'
30
+ require 'pronto/client'
27
31
  require 'pronto/github'
28
32
  require 'pronto/gitlab'
29
33
  require 'pronto/bitbucket'
34
+ require 'pronto/bitbucket_server'
30
35
 
31
36
  require 'pronto/formatter/colorizable'
37
+ require 'pronto/formatter/base'
32
38
  require 'pronto/formatter/text_formatter'
33
39
  require 'pronto/formatter/json_formatter'
34
40
  require 'pronto/formatter/git_formatter'
@@ -37,9 +43,11 @@ require 'pronto/formatter/pull_request_formatter'
37
43
  require 'pronto/formatter/github_formatter'
38
44
  require 'pronto/formatter/github_status_formatter'
39
45
  require 'pronto/formatter/github_pull_request_formatter'
46
+ require 'pronto/formatter/github_pull_request_review_formatter'
40
47
  require 'pronto/formatter/gitlab_formatter'
41
48
  require 'pronto/formatter/bitbucket_formatter'
42
49
  require 'pronto/formatter/bitbucket_pull_request_formatter'
50
+ require 'pronto/formatter/bitbucket_server_pull_request_formatter'
43
51
  require 'pronto/formatter/checkstyle_formatter'
44
52
  require 'pronto/formatter/null_formatter'
45
53
  require 'pronto/formatter/formatter'
@@ -1,12 +1,5 @@
1
1
  module Pronto
2
- class Bitbucket
3
- def initialize(repo)
4
- @repo = repo
5
- @config = Config.new
6
- @comment_cache = {}
7
- @pull_id_cache = {}
8
- end
9
-
2
+ class Bitbucket < Client
10
3
  def pull_comments(sha)
11
4
  @comment_cache["#{pull_id}/#{sha}"] ||= begin
12
5
  client.pull_comments(slug, pull_id).map do |comment|
@@ -58,16 +51,12 @@ module Pronto
58
51
  end
59
52
 
60
53
  def pull_id
61
- pull ? pull.id.to_i : env_pull_id.to_i
62
- end
63
-
64
- def env_pull_id
65
- ENV['PULL_REQUEST_ID']
54
+ pull ? pull.id.to_i : env_pull_id
66
55
  end
67
56
 
68
57
  def pull
69
58
  @pull ||= if env_pull_id
70
- pull_requests.find { |pr| pr.id.to_i == env_pull_id.to_i }
59
+ pull_requests.find { |pr| pr.id.to_i == env_pull_id }
71
60
  elsif @repo.branch
72
61
  pull_requests.find do |pr|
73
62
  pr.source['branch']['name'] == @repo.branch
@@ -0,0 +1,33 @@
1
+ module Pronto
2
+ class BitbucketServer < Bitbucket
3
+ def pull_comments(sha)
4
+ @comment_cache["#{pull_id}/#{sha}"] ||= begin
5
+ client.pull_comments(slug, pull_id).map do |comment|
6
+ anchor = comment['commentAnchor']
7
+ if anchor
8
+ Comment.new(sha, comment['comment']['text'],
9
+ anchor['path'], anchor['line'])
10
+ end
11
+ end.compact
12
+ end
13
+ end
14
+
15
+ private
16
+
17
+ def client
18
+ @client ||= BitbucketServerClient.new(@config.bitbucket_username,
19
+ @config.bitbucket_password,
20
+ @config.bitbucket_api_endpoint)
21
+ end
22
+
23
+ def pull
24
+ @pull ||= if env_pull_id
25
+ pull_requests.find { |pr| pr.id.to_i == env_pull_id }
26
+ elsif @repo.branch
27
+ pull_requests.find do |pr|
28
+ pr['fromRef']['displayId'] == @repo.branch
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -24,10 +24,14 @@ module Pronto
24
24
  aliases: '-c',
25
25
  desc: 'Commit for the diff'
26
26
 
27
- method_option :index,
27
+ method_option :unstaged,
28
28
  type: :boolean,
29
- aliases: '-i',
30
- desc: 'Analyze changes in git index (staging area)'
29
+ aliases: ['-i', '--index'],
30
+ desc: 'Analyze changes made, but not in git staging area'
31
+
32
+ method_option :staged,
33
+ type: :boolean,
34
+ desc: 'Analyze changes in git staging area'
31
35
 
32
36
  method_option :runner,
33
37
  type: :array,
@@ -48,7 +52,10 @@ module Pronto
48
52
  end
49
53
 
50
54
  formatters = ::Pronto::Formatter.get(options[:formatters])
51
- commit = options[:index] ? :index : options[:commit]
55
+
56
+ commit_options = %i[staged unstaged index]
57
+ commit = commit_options.find { |o| options[o] } || options[:commit]
58
+
52
59
  repo_workdir = ::Rugged::Repository.discover('.').workdir
53
60
  messages = Dir.chdir(repo_workdir) do
54
61
  ::Pronto.run(commit, '.', formatters, path)
@@ -59,6 +66,8 @@ module Pronto
59
66
  end
60
67
  rescue Rugged::RepositoryError
61
68
  puts '"pronto" should be run from a git repository'
69
+ rescue Pronto::Error => e
70
+ $stderr.puts "Pronto errored: #{e.message}"
62
71
  end
63
72
 
64
73
  desc 'list', 'Lists pronto runners that are available to be used'
@@ -68,14 +77,14 @@ module Pronto
68
77
  end
69
78
 
70
79
  desc 'version', 'Display version'
71
- map %w(-v --version) => :version
80
+ map %w[-v --version] => :version
72
81
 
73
82
  def version
74
83
  puts Version::STRING
75
84
  end
76
85
 
77
86
  desc 'verbose-version', 'Display verbose version'
78
- map %w(-V --verbose-version) => :verbose_version
87
+ map %w[-V --verbose-version] => :verbose_version
79
88
 
80
89
  def verbose_version
81
90
  puts Version.verbose
@@ -0,0 +1,19 @@
1
+ module Pronto
2
+ class Client
3
+ def initialize(repo)
4
+ @repo = repo
5
+ @config = Config.new
6
+ @comment_cache = {}
7
+ @pull_id_cache = {}
8
+ end
9
+
10
+ def env_pull_id
11
+ if (pull_request = ENV['PULL_REQUEST_ID'])
12
+ warn "[DEPRECATION] `PULL_REQUEST_ID` is deprecated. Please use `PRONTO_PULL_REQUEST_ID` instead."
13
+ end
14
+
15
+ pull_request ||= ENV['PRONTO_PULL_REQUEST_ID']
16
+ pull_request.to_i if pull_request
17
+ end
18
+ end
19
+ end
@@ -3,41 +3,40 @@ class BitbucketClient
3
3
  base_uri 'https://api.bitbucket.org/1.0/repositories'
4
4
 
5
5
  def initialize(username, password)
6
- credentials = { username: username, password: password }
7
- @headers = { basic_auth: credentials }
6
+ self.class.basic_auth(username, password)
8
7
  end
9
8
 
10
9
  def commit_comments(slug, sha)
11
- response = self.class.get("/#{slug}/changesets/#{sha}/comments", @headers)
12
- openstruct(response.parsed_response)
10
+ response = get("/#{slug}/changesets/#{sha}/comments")
11
+ openstruct(response)
13
12
  end
14
13
 
15
14
  def create_commit_comment(slug, sha, body, path, position)
16
- options = {
17
- body: {
18
- content: body,
19
- line_to: position,
20
- filename: path
21
- }
22
- }
23
- options.merge!(@headers)
24
- self.class.post("/#{slug}/changesets/#{sha}/comments", options)
15
+ post("/#{slug}/changesets/#{sha}/comments", body, path, position)
25
16
  end
26
17
 
27
- def pull_comments(slug, pr_id)
28
- url = "/#{slug}/pullrequests/#{pr_id}/comments"
29
- response = self.class.get(url, @headers)
30
- openstruct(response.parsed_response)
18
+ def pull_comments(slug, pull_id)
19
+ response = get("/#{slug}/pullrequests/#{pull_id}/comments")
20
+ openstruct(response)
31
21
  end
32
22
 
33
23
  def pull_requests(slug)
34
24
  base = 'https://api.bitbucket.org/2.0/repositories'
35
- url = "#{base}/#{slug}/pullrequests?state=OPEN"
36
- response = self.class.get(url, @headers)
37
- openstruct(response.parsed_response['values'])
25
+ response = get("#{base}/#{slug}/pullrequests?state=OPEN")
26
+ openstruct(response['values'])
38
27
  end
39
28
 
40
29
  def create_pull_comment(slug, pull_id, body, path, position)
30
+ post("/#{slug}/pullrequests/#{pull_id}/comments", body, path, position)
31
+ end
32
+
33
+ private
34
+
35
+ def openstruct(response)
36
+ response.map { |r| OpenStruct.new(r) }
37
+ end
38
+
39
+ def post(url, body, path, position)
41
40
  options = {
42
41
  body: {
43
42
  content: body,
@@ -45,11 +44,10 @@ class BitbucketClient
45
44
  filename: path
46
45
  }
47
46
  }
48
- options.merge!(@headers)
49
- self.class.post("/#{slug}/pullrequests/#{pull_id}/comments", options)
47
+ self.class.post(url, options)
50
48
  end
51
49
 
52
- def openstruct(response)
53
- response.map { |r| OpenStruct.new(r) }
50
+ def get(url)
51
+ self.class.get(url).parsed_response
54
52
  end
55
53
  end
@@ -0,0 +1,67 @@
1
+ class BitbucketServerClient
2
+ include HTTParty
3
+
4
+ def initialize(username, password, endpoint)
5
+ self.class.base_uri(endpoint)
6
+ self.class.basic_auth(username, password)
7
+ @headers = { 'Content-Type' => 'application/json' }
8
+ end
9
+
10
+ def pull_comments(slug, pull_id)
11
+ url = "#{pull_requests_url(slug)}/#{pull_id}/activities"
12
+ response = paged_request(url)
13
+ response.select { |activity| activity.action == 'COMMENTED' }
14
+ end
15
+
16
+ def pull_requests(slug)
17
+ paged_request(pull_requests_url(slug), state: 'OPEN')
18
+ end
19
+
20
+ def create_pull_comment(slug, pull_id, body, path, position)
21
+ url = "#{pull_requests_url(slug)}/#{pull_id}/comments"
22
+ post(url, body, path, position)
23
+ end
24
+
25
+ private
26
+
27
+ def pull_requests_url(slug)
28
+ project_key, repository_key = slug.split('/')
29
+ "/projects/#{project_key}/repos/#{repository_key}/pull-requests"
30
+ end
31
+
32
+ def openstruct(response)
33
+ response.map { |r| OpenStruct.new(r) }
34
+ end
35
+
36
+ def paged_request(url, query = {})
37
+ Enumerator.new do |yielder|
38
+ next_page_start = 0
39
+ loop do
40
+ response = get(url, query.merge(start: next_page_start))
41
+ break if response['values'].nil?
42
+
43
+ response['values'].each { |item| yielder << OpenStruct.new(item) }
44
+
45
+ next_page_start = response['nextPageStart']
46
+ break unless next_page_start
47
+ end
48
+ end
49
+ end
50
+
51
+ def post(url, body, path, position)
52
+ body = {
53
+ text: body,
54
+ anchor: {
55
+ line: position,
56
+ lineType: 'ADDED',
57
+ path: path,
58
+ srcPath: path
59
+ }
60
+ }
61
+ self.class.post(url, body: body.to_json, headers: @headers)
62
+ end
63
+
64
+ def get(url, query)
65
+ self.class.get(url, query).parsed_response
66
+ end
67
+ end
@@ -4,7 +4,7 @@ module Pronto
4
4
  @config_hash = config_hash
5
5
  end
6
6
 
7
- %w(github gitlab bitbucket).each do |service|
7
+ %w[github gitlab bitbucket].each do |service|
8
8
  ConfigFile::EMPTY[service].each do |key, _|
9
9
  name = "#{service}_#{key}"
10
10
  define_method(name) { ENV["PRONTO_#{name.upcase}"] || @config_hash[service][key] }
@@ -43,6 +43,15 @@ module Pronto
43
43
  ENV['PRONTO_MAX_WARNINGS'] || @config_hash['max_warnings']
44
44
  end
45
45
 
46
+ def message_format(formatter)
47
+ formatter_config = @config_hash[formatter]
48
+ if formatter_config && formatter_config.key?('format')
49
+ formatter_config['format']
50
+ else
51
+ ENV['PRONTO_FORMAT'] || @config_hash['format']
52
+ end
53
+ end
54
+
46
55
  def logger
47
56
  @logger ||= begin
48
57
  verbose = ENV['PRONTO_VERBOSE'] || @config_hash['verbose']
@@ -1,5 +1,7 @@
1
1
  module Pronto
2
2
  class ConfigFile
3
+ DEFAULT_MESSAGE_FORMAT = '%{msg}'.freeze
4
+
3
5
  EMPTY = {
4
6
  'all' => {
5
7
  'exclude' => [],
@@ -20,12 +22,17 @@ module Pronto
20
22
  'slug' => nil,
21
23
  'username' => nil,
22
24
  'password' => nil,
25
+ 'api_endpoint' => nil,
23
26
  'web_endpoint' => 'https://bitbucket.org/'
24
27
  },
28
+ 'text' => {
29
+ 'format' => '%{color_location} %{color_level}: %{msg}'
30
+ },
25
31
  'runners' => [],
26
32
  'formatters' => [],
27
33
  'max_warnings' => nil,
28
- 'verbose' => false
34
+ 'verbose' => false,
35
+ 'format' => DEFAULT_MESSAGE_FORMAT
29
36
  }.freeze
30
37
 
31
38
  def initialize(path = '.pronto.yml')
@@ -0,0 +1,3 @@
1
+ module Pronto
2
+ class Error < StandardError; end
3
+ end
@@ -0,0 +1,13 @@
1
+ module Pronto
2
+ module Formatter
3
+ class Base
4
+ def self.name
5
+ Formatter::FORMATTERS.invert[self]
6
+ end
7
+
8
+ def config
9
+ @config ||= Config.new
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module Pronto
2
+ module Formatter
3
+ class BitbucketServerPullRequestFormatter < PullRequestFormatter
4
+ def client_module
5
+ BitbucketServer
6
+ end
7
+
8
+ def pretty_name
9
+ 'BitBucket Server'
10
+ end
11
+
12
+ def line_number(message, _)
13
+ message.line.line.new_lineno if message.line
14
+ end
15
+ end
16
+ end
17
+ end
@@ -2,7 +2,7 @@ require 'rexml/document'
2
2
 
3
3
  module Pronto
4
4
  module Formatter
5
- class CheckstyleFormatter
5
+ class CheckstyleFormatter < Base
6
6
  def initialize
7
7
  @output = ''
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Pronto
2
2
  module Formatter
3
3
  class CommitFormatter < GitFormatter
4
- def existing_comments(messages, client, repo)
4
+ def existing_comments(messages, client, _)
5
5
  shas = messages.map(&:commit_sha)
6
6
  comments = shas.flat_map { |sha| client.commit_comments(sha) }
7
7
  grouped_comments(comments)
@@ -14,9 +14,11 @@ module Pronto
14
14
  'github' => GithubFormatter,
15
15
  'github_status' => GithubStatusFormatter,
16
16
  'github_pr' => GithubPullRequestFormatter,
17
+ 'github_pr_review' => GithubPullRequestReviewFormatter,
17
18
  'gitlab' => GitlabFormatter,
18
19
  'bitbucket' => BitbucketFormatter,
19
20
  'bitbucket_pr' => BitbucketPullRequestFormatter,
21
+ 'bitbucket_server_pr' => BitbucketServerPullRequestFormatter,
20
22
  'json' => JsonFormatter,
21
23
  'checkstyle' => CheckstyleFormatter,
22
24
  'text' => TextFormatter,
@@ -1,6 +1,6 @@
1
1
  module Pronto
2
2
  module Formatter
3
- class GitFormatter
3
+ class GitFormatter < Base
4
4
  def format(messages, repo, patches)
5
5
  client = client_module.new(repo)
6
6
  existing = existing_comments(messages, client, repo)
@@ -39,10 +39,6 @@ module Pronto
39
39
  comments.group_by { |comment| [comment.path, comment.position] }
40
40
  end
41
41
 
42
- def config
43
- @config ||= Config.new
44
- end
45
-
46
42
  def consolidate_comments(comments)
47
43
  comment = comments.first
48
44
  if comments.length > 1
@@ -55,7 +51,7 @@ module Pronto
55
51
 
56
52
  def dedupe_comments(existing, comments)
57
53
  body = existing.map(&:body).join(' ')
58
- comments.select { |comment| !body.include?(comment.body) }
54
+ comments.reject { |comment| body.include?(comment.body) }
59
55
  end
60
56
 
61
57
  def join_comments(comments)
@@ -65,7 +61,9 @@ module Pronto
65
61
  def new_comment(message, patches)
66
62
  config.logger.log("Creating a comment from message: #{message.inspect}")
67
63
  sha = message.commit_sha
68
- body = message.msg
64
+
65
+ body = config.message_format(self.class.name) % message.to_h
66
+
69
67
  path = message.path
70
68
  lineno = line_number(message, patches) if message.line
71
69
  Comment.new(sha, body, path, lineno)
@@ -0,0 +1,24 @@
1
+ module Pronto
2
+ module Formatter
3
+ class GithubPullRequestReviewFormatter < PullRequestFormatter
4
+ def client_module
5
+ Github
6
+ end
7
+
8
+ def pretty_name
9
+ 'GitHub'
10
+ end
11
+
12
+ def submit_comments(client, comments)
13
+ client.create_pull_request_review(comments)
14
+ rescue Octokit::UnprocessableEntity, HTTParty::Error => e
15
+ $stderr.puts "Failed to post: #{e.message}"
16
+ end
17
+
18
+ def line_number(message, patches)
19
+ line = patches.find_line(message.full_path, message.line.new_lineno)
20
+ line.position
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,7 +2,7 @@ require 'json'
2
2
 
3
3
  module Pronto
4
4
  module Formatter
5
- class JsonFormatter
5
+ class JsonFormatter < Base
6
6
  def format(messages, _, _)
7
7
  messages.map do |message|
8
8
  lineno = message.line.new_lineno if message.line
@@ -1,8 +1,7 @@
1
1
  module Pronto
2
2
  module Formatter
3
- class NullFormatter
4
- def format(_, _, _)
5
- end
3
+ class NullFormatter < Base
4
+ def format(_, _, _); end
6
5
  end
7
6
  end
8
7
  end
@@ -1,7 +1,7 @@
1
1
  module Pronto
2
2
  module Formatter
3
3
  class PullRequestFormatter < GitFormatter
4
- def existing_comments(messages, client, repo)
4
+ def existing_comments(_, client, repo)
5
5
  sha = repo.head_commit_sha
6
6
  comments = client.pull_comments(sha)
7
7
  grouped_comments(comments)
@@ -1,45 +1,15 @@
1
+ require 'pronto/formatter/text_message_decorator'
2
+
1
3
  module Pronto
2
4
  module Formatter
3
- class TextFormatter
4
- include Colorizable
5
-
6
- LOCATION_COLOR = :cyan
7
-
8
- LEVEL_COLORS = {
9
- info: :yellow,
10
- warning: :magenta,
11
- error: :red,
12
- fatal: :red
13
- }.freeze
14
-
5
+ class TextFormatter < Base
15
6
  def format(messages, _, _)
16
7
  messages.map do |message|
17
- "#{format_location(message)} #{format_level(message)}: #{message.msg}".strip
18
- end
19
- end
20
-
21
- private
22
-
23
- def format_location(message)
24
- line = message.line
25
- lineno = line.new_lineno if line
26
- path = message.path
27
- commit_sha = message.commit_sha
28
-
29
- if path || lineno
30
- path = colorize(path, LOCATION_COLOR) if path
31
- "#{path}:#{lineno}"
32
- elsif commit_sha
33
- colorize(commit_sha[0..6], LOCATION_COLOR)
8
+ message_format = config.message_format(self.class.name)
9
+ message_data = TextMessageDecorator.new(message).to_h
10
+ (message_format % message_data).strip
34
11
  end
35
12
  end
36
-
37
- def format_level(message)
38
- level = message.level
39
- color = LEVEL_COLORS.fetch(level)
40
-
41
- colorize(level[0].upcase, color)
42
- end
43
13
  end
44
14
  end
45
15
  end
@@ -0,0 +1,46 @@
1
+ module Pronto
2
+ module Formatter
3
+ class TextMessageDecorator < SimpleDelegator
4
+ include Colorizable
5
+
6
+ LOCATION_COLOR = :cyan
7
+
8
+ LEVEL_COLORS = {
9
+ info: :yellow,
10
+ warning: :magenta,
11
+ error: :red,
12
+ fatal: :red
13
+ }.freeze
14
+
15
+ def to_h
16
+ original = __getobj__.to_h
17
+ original[:color_level] = format_level(__getobj__)
18
+ original[:color_location] = format_location(__getobj__)
19
+ original
20
+ end
21
+
22
+ private
23
+
24
+ def format_location(message)
25
+ line = message.line
26
+ lineno = line.new_lineno if line
27
+ path = message.path
28
+ commit_sha = message.commit_sha
29
+
30
+ if path || lineno
31
+ path = colorize(path, LOCATION_COLOR) if path
32
+ "#{path}:#{lineno}"
33
+ elsif commit_sha
34
+ colorize(commit_sha[0..6], LOCATION_COLOR)
35
+ end
36
+ end
37
+
38
+ def format_level(message)
39
+ level = message.level
40
+ color = LEVEL_COLORS.fetch(level)
41
+
42
+ colorize(level[0].upcase, color)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -6,6 +6,9 @@ module Pronto
6
6
  def_delegators :line, :addition?, :deletion?, :content, :new_lineno,
7
7
  :old_lineno, :line_origin
8
8
 
9
+ COMPARISON_ATTRIBUTES = %i[content line_origin
10
+ old_lineno new_lineno].freeze
11
+
9
12
  def position
10
13
  hunk_index = patch.hunks.find_index { |h| h.header == hunk.header }
11
14
  line_index = patch.lines.find_index(line)
@@ -31,10 +34,9 @@ module Pronto
31
34
  return false if other.nil?
32
35
  return true if line.nil? && other.line.nil?
33
36
 
34
- content == other.content &&
35
- line_origin == other.line_origin &&
36
- old_lineno == other.old_lineno &&
37
- new_lineno == other.new_lineno
37
+ COMPARISON_ATTRIBUTES.all? do |attribute|
38
+ send(attribute) == other.send(attribute)
39
+ end
38
40
  end
39
41
 
40
42
  private
@@ -15,8 +15,8 @@ module Pronto
15
15
  @patches.each(&block)
16
16
  end
17
17
 
18
- def reject!(&block)
19
- @patches.reject!(&block)
18
+ def reject(&block)
19
+ Pronto::Git::Patches.new(repo, commit, @patches.reject(&block))
20
20
  end
21
21
 
22
22
  def find_line(path, line)
@@ -8,14 +8,18 @@ module Pronto
8
8
  end
9
9
 
10
10
  def diff(commit, options = nil)
11
- if commit == :index
12
- patches = @repo.index.diff(options)
13
- Patches.new(self, head, patches)
14
- else
15
- merge_base = merge_base(commit)
16
- patches = @repo.diff(merge_base, head, options)
17
- Patches.new(self, merge_base, patches)
18
- end
11
+ target, patches = case commit
12
+ when :unstaged, :index
13
+ [head, @repo.index.diff(options)]
14
+ when :staged
15
+ [head, @repo.head.target.diff(@repo.index, options)]
16
+ else
17
+ merge_base = merge_base(commit)
18
+ patches = @repo.diff(merge_base, head, options)
19
+ [merge_base, patches]
20
+ end
21
+
22
+ Patches.new(self, target, patches)
19
23
  end
20
24
 
21
25
  def show_commit(sha)
@@ -1,12 +1,5 @@
1
1
  module Pronto
2
- class Github
3
- def initialize(repo)
4
- @repo = repo
5
- @config = Config.new
6
- @comment_cache = {}
7
- @pull_id_cache = {}
8
- end
9
-
2
+ class Github < Client
10
3
  def pull_comments(sha)
11
4
  @comment_cache["#{pull_id}/#{sha}"] ||= begin
12
5
  client.pull_comments(slug, pull_id).map do |comment|
@@ -14,6 +7,10 @@ module Pronto
14
7
  comment.position || comment.original_position)
15
8
  end
16
9
  end
10
+ rescue Octokit::NotFound => e
11
+ @config.logger.log("Error raised and rescued: #{e}")
12
+ msg = "Pull request for sha #{sha} with id #{pull_id} was not found."
13
+ raise Pronto::Error, msg
17
14
  end
18
15
 
19
16
  def commit_comments(sha)
@@ -41,12 +38,22 @@ module Pronto
41
38
  end
42
39
  end
43
40
 
41
+ def create_pull_request_review(comments)
42
+ options = {
43
+ event: 'COMMENT',
44
+ comments: comments.map do |c|
45
+ { path: c.path, position: c.position, body: c.body }
46
+ end
47
+ }
48
+ client.create_pull_request_review(slug, pull_id, options)
49
+ end
50
+
44
51
  def create_commit_status(status)
45
52
  sha = pull_sha || status.sha
46
53
  @config.logger.log("Creating comment status on #{sha}")
47
- client.create_status(slug,
48
- sha,
49
- status.state, context: status.context, description: status.description)
54
+ client.create_status(slug, sha, status.state,
55
+ context: status.context,
56
+ description: status.description)
50
57
  end
51
58
 
52
59
  private
@@ -70,11 +77,7 @@ module Pronto
70
77
  end
71
78
 
72
79
  def pull_id
73
- pull ? pull[:number].to_i : env_pull_id.to_i
74
- end
75
-
76
- def env_pull_id
77
- ENV['PULL_REQUEST_ID']
80
+ pull ? pull[:number].to_i : env_pull_id
78
81
  end
79
82
 
80
83
  def pull_sha
@@ -83,7 +86,7 @@ module Pronto
83
86
 
84
87
  def pull
85
88
  @pull ||= if env_pull_id
86
- pull_requests.find { |pr| pr[:number].to_i == env_pull_id.to_i }
89
+ pull_requests.find { |pr| pr[:number].to_i == env_pull_id }
87
90
  elsif @repo.branch
88
91
  pull_requests.find { |pr| pr[:head][:ref] == @repo.branch }
89
92
  end
@@ -1,11 +1,5 @@
1
1
  module Pronto
2
- class Gitlab
3
- def initialize(repo)
4
- @repo = repo
5
- @config = Config.new
6
- @comment_cache = {}
7
- end
8
-
2
+ class Gitlab < Client
9
3
  def commit_comments(sha)
10
4
  @comment_cache[sha.to_s] ||= begin
11
5
  client.commit_comments(slug, sha, per_page: 500).map do |comment|
@@ -26,11 +20,10 @@ module Pronto
26
20
  def slug
27
21
  return @config.gitlab_slug if @config.gitlab_slug
28
22
  @slug ||= begin
29
- slug = @repo.remote_urls.map do |url|
23
+ @repo.remote_urls.map do |url|
30
24
  match = slug_regex(url).match(url)
31
25
  match[:slug] if match
32
26
  end.compact.first
33
- URI.escape(slug, '/') if slug
34
27
  end
35
28
  end
36
29
 
@@ -2,7 +2,7 @@ module Pronto
2
2
  class Message
3
3
  attr_reader :path, :line, :level, :msg, :commit_sha, :runner
4
4
 
5
- LEVELS = [:info, :warning, :error, :fatal].freeze
5
+ LEVELS = %i[info warning error fatal].freeze
6
6
 
7
7
  def initialize(path, line, level, msg, commit_sha = nil, runner = nil)
8
8
  unless LEVELS.include?(level)
@@ -40,10 +40,21 @@ module Pronto
40
40
  end
41
41
  end
42
42
 
43
+ def to_h
44
+ {
45
+ path: path,
46
+ line: line,
47
+ level: level,
48
+ msg: msg,
49
+ commit_sha: commit_sha,
50
+ runner: @runner && @runner.title
51
+ }
52
+ end
53
+
43
54
  private
44
55
 
45
56
  def comparison_attributes
46
- line ? [:path, :msg, :level, :line] : [:path, :msg, :level, :commit_sha]
57
+ line ? %i[path msg level line] : %i[path msg level commit_sha]
47
58
  end
48
59
  end
49
60
  end
@@ -5,6 +5,7 @@ module Pronto
5
5
  def initialize(patches, commit = nil)
6
6
  @patches = patches
7
7
  @commit = commit
8
+ @config = Config.new
8
9
  end
9
10
 
10
11
  def self.runners
@@ -28,10 +28,9 @@ module Pronto
28
28
  def reject_excluded(excluded_files, patches)
29
29
  return patches unless excluded_files.any?
30
30
 
31
- patches.reject! do |patch|
31
+ patches.reject do |patch|
32
32
  excluded_files.include?(patch.new_file_full_path.to_s)
33
33
  end
34
- patches
35
34
  end
36
35
 
37
36
  def exceeds_max?(warnings)
@@ -1,6 +1,6 @@
1
1
  module Pronto
2
2
  module Version
3
- STRING = '0.8.2'.freeze
3
+ STRING = '0.9.0'.freeze
4
4
 
5
5
  MSG = '%s (running on %s %s %s)'.freeze
6
6
 
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.author = 'Mindaugas Mozūras'
12
12
  s.email = 'mindaugas.mozuras@gmail.com'
13
- s.homepage = 'http://github.com/mmozuras/pronto'
13
+ s.homepage = 'https://github.com/mmozuras/pronto'
14
14
  s.summary = 'Pronto runs analysis by checking only the introduced changes'
15
15
  s.description = <<-EOF
16
16
  Pronto runs analysis quickly by checking only the relevant changes. Created
@@ -42,16 +42,17 @@ Gem::Specification.new do |s|
42
42
 
43
43
  s.add_runtime_dependency('rugged', '~> 0.24', '>= 0.23.0')
44
44
  s.add_runtime_dependency('thor', '~> 0.19.0')
45
- s.add_runtime_dependency('octokit', '~> 4.3', '>= 4.1.0')
46
- s.add_runtime_dependency('gitlab', '~> 3.6', '>= 3.4.0')
45
+ s.add_runtime_dependency('octokit', '~> 4.7', '>= 4.7.0')
46
+ s.add_runtime_dependency('gitlab', '~> 4.0', '>= 4.0.0')
47
47
  s.add_runtime_dependency('httparty', '>= 0.13.7', '< 0.15')
48
48
  s.add_runtime_dependency('rainbow', '~> 2.1')
49
- s.add_development_dependency('rake', '~> 11.0')
49
+ s.add_development_dependency('rake', '~> 12.0')
50
50
  s.add_development_dependency('rspec', '~> 3.4')
51
51
  s.add_development_dependency('rspec-its', '~> 1.2')
52
52
  s.add_development_dependency('rspec-expectations', '~> 3.4')
53
53
  s.add_development_dependency('bundler', '~> 1.3')
54
- s.add_development_dependency('simplecov', '~> 0.11')
54
+ s.add_development_dependency('simplecov', '~> 0.14')
55
55
  s.add_development_dependency('rubocop', '~> 0.47')
56
56
  s.add_development_dependency('pronto-rubocop', '~> 0.8.0')
57
+ s.add_development_dependency('codeclimate-test-reporter', '~> 1.0')
57
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-03 00:00:00.000000000 Z
11
+ date: 2017-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -50,40 +50,40 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '4.3'
53
+ version: '4.7'
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 4.1.0
56
+ version: 4.7.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '4.3'
63
+ version: '4.7'
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 4.1.0
66
+ version: 4.7.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: gitlab
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '3.6'
73
+ version: '4.0'
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 3.4.0
76
+ version: 4.0.0
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '3.6'
83
+ version: '4.0'
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 3.4.0
86
+ version: 4.0.0
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: httparty
89
89
  requirement: !ruby/object:Gem::Requirement
@@ -124,14 +124,14 @@ dependencies:
124
124
  requirements:
125
125
  - - "~>"
126
126
  - !ruby/object:Gem::Version
127
- version: '11.0'
127
+ version: '12.0'
128
128
  type: :development
129
129
  prerelease: false
130
130
  version_requirements: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - "~>"
133
133
  - !ruby/object:Gem::Version
134
- version: '11.0'
134
+ version: '12.0'
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: rspec
137
137
  requirement: !ruby/object:Gem::Requirement
@@ -194,14 +194,14 @@ dependencies:
194
194
  requirements:
195
195
  - - "~>"
196
196
  - !ruby/object:Gem::Version
197
- version: '0.11'
197
+ version: '0.14'
198
198
  type: :development
199
199
  prerelease: false
200
200
  version_requirements: !ruby/object:Gem::Requirement
201
201
  requirements:
202
202
  - - "~>"
203
203
  - !ruby/object:Gem::Version
204
- version: '0.11'
204
+ version: '0.14'
205
205
  - !ruby/object:Gem::Dependency
206
206
  name: rubocop
207
207
  requirement: !ruby/object:Gem::Requirement
@@ -230,6 +230,20 @@ dependencies:
230
230
  - - "~>"
231
231
  - !ruby/object:Gem::Version
232
232
  version: 0.8.0
233
+ - !ruby/object:Gem::Dependency
234
+ name: codeclimate-test-reporter
235
+ requirement: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - "~>"
238
+ - !ruby/object:Gem::Version
239
+ version: '1.0'
240
+ type: :development
241
+ prerelease: false
242
+ version_requirements: !ruby/object:Gem::Requirement
243
+ requirements:
244
+ - - "~>"
245
+ - !ruby/object:Gem::Version
246
+ version: '1.0'
233
247
  description: |2
234
248
  Pronto runs analysis quickly by checking only the relevant changes. Created
235
249
  to be used on pull requests, but suited for other scenarios as well. Perfect
@@ -250,13 +264,19 @@ files:
250
264
  - bin/pronto
251
265
  - lib/pronto.rb
252
266
  - lib/pronto/bitbucket.rb
267
+ - lib/pronto/bitbucket_server.rb
253
268
  - lib/pronto/cli.rb
269
+ - lib/pronto/client.rb
254
270
  - lib/pronto/clients/bitbucket_client.rb
271
+ - lib/pronto/clients/bitbucket_server_client.rb
255
272
  - lib/pronto/comment.rb
256
273
  - lib/pronto/config.rb
257
274
  - lib/pronto/config_file.rb
275
+ - lib/pronto/error.rb
276
+ - lib/pronto/formatter/base.rb
258
277
  - lib/pronto/formatter/bitbucket_formatter.rb
259
278
  - lib/pronto/formatter/bitbucket_pull_request_formatter.rb
279
+ - lib/pronto/formatter/bitbucket_server_pull_request_formatter.rb
260
280
  - lib/pronto/formatter/checkstyle_formatter.rb
261
281
  - lib/pronto/formatter/colorizable.rb
262
282
  - lib/pronto/formatter/commit_formatter.rb
@@ -264,6 +284,7 @@ files:
264
284
  - lib/pronto/formatter/git_formatter.rb
265
285
  - lib/pronto/formatter/github_formatter.rb
266
286
  - lib/pronto/formatter/github_pull_request_formatter.rb
287
+ - lib/pronto/formatter/github_pull_request_review_formatter.rb
267
288
  - lib/pronto/formatter/github_status_formatter.rb
268
289
  - lib/pronto/formatter/github_status_formatter/sentence.rb
269
290
  - lib/pronto/formatter/github_status_formatter/status_builder.rb
@@ -272,6 +293,7 @@ files:
272
293
  - lib/pronto/formatter/null_formatter.rb
273
294
  - lib/pronto/formatter/pull_request_formatter.rb
274
295
  - lib/pronto/formatter/text_formatter.rb
296
+ - lib/pronto/formatter/text_message_decorator.rb
275
297
  - lib/pronto/gem_names.rb
276
298
  - lib/pronto/git/line.rb
277
299
  - lib/pronto/git/patch.rb
@@ -288,7 +310,7 @@ files:
288
310
  - lib/pronto/status.rb
289
311
  - lib/pronto/version.rb
290
312
  - pronto.gemspec
291
- homepage: http://github.com/mmozuras/pronto
313
+ homepage: https://github.com/mmozuras/pronto
292
314
  licenses:
293
315
  - MIT
294
316
  metadata: {}