pronto 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +8 -3
- data/lib/pronto/bitbucket.rb +7 -3
- data/lib/pronto/config_file.rb +1 -1
- data/lib/pronto/formatter/bitbucket_formatter.rb +1 -1
- data/lib/pronto/formatter/bitbucket_pull_request_formatter.rb +4 -0
- data/lib/pronto/formatter/commit_formatter.rb +3 -6
- data/lib/pronto/formatter/git_formatter.rb +8 -8
- data/lib/pronto/formatter/gitlab_formatter.rb +1 -1
- data/lib/pronto/formatter/pull_request_formatter.rb +2 -5
- data/lib/pronto/github.rb +8 -4
- data/lib/pronto/version.rb +1 -1
- data/pronto.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaeb87265191eb83028cbb2472b1420ee19377d9
|
4
|
+
data.tar.gz: 19c3d10ff59f8a50f1d179023579ccfda4a4284c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b10a90fd0bd0d9289bb1989b91e61eb1d0ed0026860bd4056729247fddea2bea9631ca645492e40f67434be185afff16f579888410ce00cebe14e2891cdc5f7e
|
7
|
+
data.tar.gz: bdfb4bc6140b8d65b7dfddbe70b663410adb9476eec31d566256811b2b128ac1f0864790298ce7ebe941f22ff34c542a6b21407c458d1b41536d489a7055c317
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.8.1
|
4
|
+
|
5
|
+
### Changes
|
6
|
+
|
7
|
+
* Add a default GitLab API endpoint: https://gitlab.com/api/v3
|
8
|
+
|
9
|
+
### Bugs fixed
|
10
|
+
|
11
|
+
* [#125](https://github.com/mmozuras/pronto/issues/125): check whether message has a line before posting to GitLab.
|
12
|
+
* Post on commit comments on correct commit: use message.commit_sha to set comment.sha instead of head.
|
13
|
+
* [#201](https://github.com/mmozuras/pronto/issues/201): allow messages without line positions or paths.
|
14
|
+
|
3
15
|
## 0.8.0
|
4
16
|
|
5
17
|
### New features
|
data/README.md
CHANGED
@@ -137,14 +137,14 @@ on GitLab commits using `GitlabFormatter`.
|
|
137
137
|
|
138
138
|
Set the `PRONTO_GITLAB_API_ENDPOINT` environment variable or value in `.pronto.yml` to
|
139
139
|
your API endpoint URL. If you are using Gitlab.com's hosted service your
|
140
|
-
endpoint will be
|
140
|
+
endpoint will be set by default.
|
141
141
|
Set the `PRONTO_GITLAB_API_PRIVATE_TOKEN` environment variable or value in `.pronto.yml
|
142
142
|
to your Gitlab private token which you can find in your account settings.
|
143
143
|
|
144
144
|
Then just run it:
|
145
145
|
|
146
146
|
```sh
|
147
|
-
$
|
147
|
+
$ PRONTO_GITLAB_API_PRIVATE_TOKEN=token pronto run -f gitlab -c origin/master
|
148
148
|
```
|
149
149
|
|
150
150
|
### Bitbucket Integration
|
@@ -214,7 +214,10 @@ Currently available:
|
|
214
214
|
|
215
215
|
* [pronto-brakeman](https://github.com/mmozuras/pronto-brakeman)
|
216
216
|
* [pronto-coffeelint](https://github.com/siebertm/pronto-coffeelint)
|
217
|
+
* [pronto-clippy](https://github.com/hauleth/pronto-clippy)
|
217
218
|
* [pronto-credo](https://github.com/carakan/pronto-credo)
|
219
|
+
* [pronto-dialyzer](https://github.com/iurifq/pronto-dialyzer)
|
220
|
+
* [pronto-dogma](https://github.com/iurifq/pronto-dogma)
|
218
221
|
* [pronto-eslint](https://github.com/mmozuras/pronto-eslint) (uses [eslintrb](https://github.com/zendesk/eslintrb))
|
219
222
|
* [pronto-eslint_npm](https://github.com/doits/pronto-eslint_npm) (uses eslint installed from npm)
|
220
223
|
* [pronto-fasterer](https://github.com/mmozuras/pronto-fasterer)
|
@@ -235,10 +238,12 @@ Currently available:
|
|
235
238
|
* [pronto-scss](https://github.com/mmozuras/pronto-scss)
|
236
239
|
* [pronto-shellcheck](https://github.com/pclalv/pronto-shellcheck)
|
237
240
|
* [pronto-slim](https://github.com/nysthee/pronto-slim)
|
241
|
+
* [pronto-slim_lint](https://github.com/ibrahima/pronto-slim_lint)
|
238
242
|
* [pronto-spell](https://github.com/mmozuras/pronto-spell)
|
239
243
|
* [pronto-stylelint](https://github.com/kevinjalbert/pronto-stylelint)
|
240
244
|
* [pronto-swiftlint](https://github.com/ajanauskas/pronto-swiftlint)
|
241
245
|
* [pronto-tailor](https://github.com/ajanauskas/pronto-tailor)
|
246
|
+
* [pronto-textlint](https://github.com/seikichi/pronto-textlint)
|
242
247
|
|
243
248
|
## Articles
|
244
249
|
|
@@ -261,4 +266,4 @@ Make a Pull Request to add something you wrote or found useful.
|
|
261
266
|
|
262
267
|
## Copyright
|
263
268
|
|
264
|
-
Copyright (c) 2013-
|
269
|
+
Copyright (c) 2013-2017 Mindaugas Mozūras. See [LICENSE](LICENSE) for further details.
|
data/lib/pronto/bitbucket.rb
CHANGED
@@ -30,9 +30,13 @@ module Pronto
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def create_pull_comment(comment)
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
if comment.path && comment.position
|
34
|
+
@config.logger.log("Creating pull request comment on #{pull_id}")
|
35
|
+
client.create_pull_comment(slug, pull_id, comment.body,
|
36
|
+
comment.path, comment.position)
|
37
|
+
else
|
38
|
+
create_commit_comment(comment)
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
private
|
data/lib/pronto/config_file.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
module Pronto
|
2
2
|
module Formatter
|
3
3
|
class CommitFormatter < GitFormatter
|
4
|
-
def existing_comments(client,
|
5
|
-
|
4
|
+
def existing_comments(messages, client, repo)
|
5
|
+
shas = messages.map(&:commit_sha)
|
6
|
+
comments = shas.flat_map { |sha| client.commit_comments(sha) }
|
6
7
|
grouped_comments(comments)
|
7
8
|
end
|
8
9
|
|
9
|
-
def line_number(message, _)
|
10
|
-
message.line.new_lineno
|
11
|
-
end
|
12
|
-
|
13
10
|
def submit_comments(client, comments)
|
14
11
|
comments.each { |comment| client.create_commit_comment(comment) }
|
15
12
|
rescue Octokit::UnprocessableEntity, HTTParty::Error => e
|
@@ -3,9 +3,8 @@ module Pronto
|
|
3
3
|
class GitFormatter
|
4
4
|
def format(messages, repo, patches)
|
5
5
|
client = client_module.new(repo)
|
6
|
-
|
7
|
-
|
8
|
-
comments = new_comments(messages, patches, head)
|
6
|
+
existing = existing_comments(messages, client, repo)
|
7
|
+
comments = new_comments(messages, patches)
|
9
8
|
additions = remove_duplicate_comments(existing, comments)
|
10
9
|
submit_comments(client, additions)
|
11
10
|
|
@@ -63,18 +62,19 @@ module Pronto
|
|
63
62
|
comments.map { |comment| "- #{comment.body}" }.join("\n")
|
64
63
|
end
|
65
64
|
|
66
|
-
def new_comment(message, patches
|
65
|
+
def new_comment(message, patches)
|
66
|
+
config.logger.log("Creating a comment from message: #{message.inspect}")
|
67
|
+
sha = message.commit_sha
|
67
68
|
body = message.msg
|
68
69
|
path = message.path
|
69
|
-
lineno = line_number(message, patches)
|
70
|
-
|
70
|
+
lineno = line_number(message, patches) if message.line
|
71
71
|
Comment.new(sha, body, path, lineno)
|
72
72
|
end
|
73
73
|
|
74
|
-
def new_comments(messages, patches
|
74
|
+
def new_comments(messages, patches)
|
75
75
|
comments = messages
|
76
76
|
.uniq
|
77
|
-
.map { |message| new_comment(message, patches
|
77
|
+
.map { |message| new_comment(message, patches) }
|
78
78
|
grouped_comments(comments)
|
79
79
|
end
|
80
80
|
|
@@ -1,15 +1,12 @@
|
|
1
1
|
module Pronto
|
2
2
|
module Formatter
|
3
3
|
class PullRequestFormatter < GitFormatter
|
4
|
-
def existing_comments(client,
|
4
|
+
def existing_comments(messages, client, repo)
|
5
|
+
sha = repo.head_commit_sha
|
5
6
|
comments = client.pull_comments(sha)
|
6
7
|
grouped_comments(comments)
|
7
8
|
end
|
8
9
|
|
9
|
-
def line_number(message, _)
|
10
|
-
message.line.line.new_lineno
|
11
|
-
end
|
12
|
-
|
13
10
|
def submit_comments(client, comments)
|
14
11
|
comments.each { |comment| client.create_pull_comment(comment) }
|
15
12
|
rescue Octokit::UnprocessableEntity, HTTParty::Error => e
|
data/lib/pronto/github.rb
CHANGED
@@ -31,10 +31,14 @@ module Pronto
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def create_pull_comment(comment)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
if comment.path && comment.position
|
35
|
+
@config.logger.log("Creating pull request comment on #{pull_id}")
|
36
|
+
client.create_pull_comment(slug, pull_id, comment.body,
|
37
|
+
pull_sha || comment.sha,
|
38
|
+
comment.path, comment.position)
|
39
|
+
else
|
40
|
+
create_commit_comment(comment)
|
41
|
+
end
|
38
42
|
end
|
39
43
|
|
40
44
|
def create_commit_status(status)
|
data/lib/pronto/version.rb
CHANGED
data/pronto.gemspec
CHANGED
@@ -52,6 +52,6 @@ Gem::Specification.new do |s|
|
|
52
52
|
s.add_development_dependency('rspec-expectations', '~> 3.4')
|
53
53
|
s.add_development_dependency('bundler', '~> 1.3')
|
54
54
|
s.add_development_dependency('simplecov', '~> 0.11')
|
55
|
-
s.add_development_dependency('rubocop', '~> 0.
|
56
|
-
s.add_development_dependency('pronto-rubocop', '~> 0.
|
55
|
+
s.add_development_dependency('rubocop', '~> 0.47')
|
56
|
+
s.add_development_dependency('pronto-rubocop', '~> 0.8.0')
|
57
57
|
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.
|
4
|
+
version: 0.8.1
|
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-02-
|
11
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -208,28 +208,28 @@ dependencies:
|
|
208
208
|
requirements:
|
209
209
|
- - "~>"
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
version: '0.
|
211
|
+
version: '0.47'
|
212
212
|
type: :development
|
213
213
|
prerelease: false
|
214
214
|
version_requirements: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
216
|
- - "~>"
|
217
217
|
- !ruby/object:Gem::Version
|
218
|
-
version: '0.
|
218
|
+
version: '0.47'
|
219
219
|
- !ruby/object:Gem::Dependency
|
220
220
|
name: pronto-rubocop
|
221
221
|
requirement: !ruby/object:Gem::Requirement
|
222
222
|
requirements:
|
223
223
|
- - "~>"
|
224
224
|
- !ruby/object:Gem::Version
|
225
|
-
version: 0.
|
225
|
+
version: 0.8.0
|
226
226
|
type: :development
|
227
227
|
prerelease: false
|
228
228
|
version_requirements: !ruby/object:Gem::Requirement
|
229
229
|
requirements:
|
230
230
|
- - "~>"
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
version: 0.
|
232
|
+
version: 0.8.0
|
233
233
|
description: |2
|
234
234
|
Pronto runs analysis quickly by checking only the relevant changes. Created
|
235
235
|
to be used on pull requests, but suited for other scenarios as well. Perfect
|