pronto 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/LICENSE +1 -1
- data/README.md +25 -5
- data/lib/pronto.rb +8 -16
- data/lib/pronto/cli.rb +17 -10
- data/lib/pronto/config.rb +10 -0
- data/lib/pronto/config_file.rb +4 -2
- data/lib/pronto/formatter/formatter.rb +5 -4
- data/lib/pronto/formatter/github_pull_request_formatter.rb +1 -1
- data/lib/pronto/gem_names.rb +16 -0
- data/lib/pronto/github.rb +7 -1
- data/lib/pronto/gitlab.rb +3 -2
- data/lib/pronto/logger.rb +16 -0
- data/lib/pronto/message.rb +5 -4
- data/lib/pronto/rake_task/travis_pull_request.rb +7 -6
- data/lib/pronto/runner.rb +17 -0
- data/lib/pronto/runners.rb +12 -2
- data/lib/pronto/version.rb +11 -1
- data/pronto.gemspec +8 -8
- metadata +30 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff7961eb19513e5f97591c8c3fe3630e3236728a
|
4
|
+
data.tar.gz: 967a58d14779d25bce8f2532795ce8002984512f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d5dd6119ee5480bcd3d2df9eab8a7a260d7ba22fde8d4eeb5bdcecc25b67564eab12507507e9a315d5673a8f11753eede5480723238895c2129b1e62adc5fd6
|
7
|
+
data.tar.gz: 1dd77adf6e74f41db0241da701de825084da6dff03370ab9e2faf37681b019bb6b2a66685dee304c545c3edc1d13dfd1c421756e69a481a1cdddba40ff4ec9fa
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,27 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 0.6.0
|
6
|
+
|
5
7
|
### New features
|
8
|
+
|
9
|
+
* Added `-V/--verbose-version` option that displays Ruby version.
|
10
|
+
* [#127](https://github.com/mmozuras/pronto/pull/127): ability to specify `max_warnings` via configuration or environment variable.
|
11
|
+
* [#18](https://github.com/mmozuras/pronto/issues/18): ability to specify `verbose` via configuration, which can provide more output for debugging purposes.
|
12
|
+
* [#83](https://github.com/mmozuras/pronto/issues/83): support multiple formatters as an option to `pronto run`.
|
13
|
+
|
6
14
|
### Changes
|
15
|
+
|
16
|
+
* `--version` only displays the version itself without any additional text.
|
17
|
+
* Replaced `Pronto.gem_names` with `Pronto::GemNames.new.to_a`.
|
18
|
+
* [#116](https://github.com/mmozuras/pronto/pull/116): improved GitHub formatter error output.
|
19
|
+
* [#123](https://github.com/mmozuras/pronto/pull/126): added runner attribute to message initialization.
|
20
|
+
* Runner expects to receive patches/commit via `initialize(patches, commit)`, instead of `run(patches, commit)`.
|
21
|
+
|
7
22
|
### Bugs fixed
|
8
23
|
|
24
|
+
* [#122](https://github.com/mmozuras/pronto/pull/122): ignore symlink directories.
|
25
|
+
|
9
26
|
## 0.5.3
|
10
27
|
|
11
28
|
### Bugs fixed
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,7 @@ to your [styleguide](https://github.com/mmozuras/pronto-rubocop), [are DRY](http
|
|
20
20
|
* [GitLab Integration](#gitlab-integration)
|
21
21
|
* [Configuration](#configuration)
|
22
22
|
* [Runners](#runners)
|
23
|
+
* [Articles](#articles)
|
23
24
|
* [Changelog](#changelog)
|
24
25
|
* [Copyright](#copyright)
|
25
26
|
|
@@ -78,7 +79,7 @@ Command flag | Description
|
|
78
79
|
`-c/--commit` | Commit for the diff.
|
79
80
|
`-i/--index` | Analyze changes in git index (staging area).
|
80
81
|
`-r/--runner` | Run only the passed runners.
|
81
|
-
`-f/--
|
82
|
+
`-f/--formatters`| Pick output formatters.
|
82
83
|
|
83
84
|
### GitHub Integration
|
84
85
|
|
@@ -105,7 +106,7 @@ $ GITHUB_ACCESS_TOKEN=token PULL_REQUEST_ID=id pronto run -f github_pr -c origin
|
|
105
106
|
As an alternative, you can also set up a rake task:
|
106
107
|
|
107
108
|
```ruby
|
108
|
-
Pronto.
|
109
|
+
Pronto::GemNames.new.to_a.each { |gem_name| require "pronto/#{gem_name}" }
|
109
110
|
|
110
111
|
formatter = Pronto::Formatter::GithubFormatter.new # or GithubPullRequestFormatter
|
111
112
|
Pronto.run('origin/master', '.', formatter)
|
@@ -133,7 +134,7 @@ $ GITLAB_API_ENDPOINT="https://gitlab.com/api/v3" GITLAB_API_PRIVATE_TOKEN=token
|
|
133
134
|
As an alternative, you can also set up a rake task:
|
134
135
|
|
135
136
|
```ruby
|
136
|
-
Pronto.
|
137
|
+
Pronto::GemNames.new.to_a.each { |gem_name| require "pronto/#{gem_name}" }
|
137
138
|
|
138
139
|
formatter = Pronto::Formatter::GitlabFormatter.new
|
139
140
|
Pronto.run('origin/master', '.', formatter)
|
@@ -148,7 +149,8 @@ The file has the following format:
|
|
148
149
|
|
149
150
|
```yaml
|
150
151
|
all:
|
151
|
-
exclude:
|
152
|
+
exclude:
|
153
|
+
- 'spec/**/*'
|
152
154
|
github:
|
153
155
|
slug: mmozuras/pronto
|
154
156
|
access_token: B26354
|
@@ -158,6 +160,8 @@ gitlab:
|
|
158
160
|
slug: mmozuras/pronto,
|
159
161
|
api_private_token: 46751,
|
160
162
|
api_endpoint: https://api.vinted.com/gitlab
|
163
|
+
max_warnings: 150
|
164
|
+
verbose: false
|
161
165
|
```
|
162
166
|
|
163
167
|
All properties that can be specified via `.pronto.yml`, can also be specified
|
@@ -172,9 +176,11 @@ Currently available:
|
|
172
176
|
|
173
177
|
* [pronto-brakeman](https://github.com/mmozuras/pronto-brakeman)
|
174
178
|
* [pronto-coffeelint](https://github.com/siebertm/pronto-coffeelint)
|
179
|
+
* [pronto-eslint](https://github.com/mmozuras/pronto-eslint)
|
175
180
|
* [pronto-fasterer](https://github.com/mmozuras/pronto-fasterer)
|
176
181
|
* [pronto-flay](https://github.com/mmozuras/pronto-flay)
|
177
182
|
* [pronto-foodcritic](https://github.com/mmozuras/pronto-foodcritic)
|
183
|
+
* [pronto-jscs](https://github.com/spajus/pronto-jscs)
|
178
184
|
* [pronto-jshint](https://github.com/mmozuras/pronto-jshint)
|
179
185
|
* [pronto-haml](https://github.com/mmozuras/pronto-haml)
|
180
186
|
* [pronto-poper](https://github.com/mmozuras/pronto-poper)
|
@@ -184,6 +190,20 @@ Currently available:
|
|
184
190
|
* [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop)
|
185
191
|
* [pronto-scss](https://github.com/mmozuras/pronto-scss)
|
186
192
|
* [pronto-spell](https://github.com/mmozuras/pronto-spell)
|
193
|
+
* [pronto-swiftlint](https://github.com/ajanauskas/pronto-swiftlint)
|
194
|
+
* [pronto-tailor](https://github.com/ajanauskas/pronto-tailor)
|
195
|
+
|
196
|
+
## Articles
|
197
|
+
|
198
|
+
Articles to help you to get started:
|
199
|
+
|
200
|
+
* [Automating code review with Pronto (and friends)](http://everydayrails.com/2015/02/17/pronto-ruby-code-review.html)
|
201
|
+
* [Setup Pronto with CircleCI](https://medium.com/@MaximAbramchuk/circleci-github-pr-commenting-ruby-scss-coffeescript-javascript-git-and-etc-fbcbe2a378a5#.gk5f14p3j)
|
202
|
+
* [Continuous Static Analysis using Pronto](http://codingfearlessly.com/2014/11/06/continuous-static-analysis/)
|
203
|
+
* [Pronto and git hooks](http://elliotthilaire.net/gem-pronto-and-git-hooks/)
|
204
|
+
* [How to end fruitless dev discussions about your project’s code style?](https://medium.com/appaloosa-store-engineering/how-to-end-fruitless-dev-discussions-about-your-project-s-code-style-245070bff6d4)
|
205
|
+
|
206
|
+
Make a Pull Request to add something you wrote or found useful.
|
187
207
|
|
188
208
|
## Changelog
|
189
209
|
|
@@ -191,4 +211,4 @@ Currently available:
|
|
191
211
|
|
192
212
|
## Copyright
|
193
213
|
|
194
|
-
Copyright (c) 2013-
|
214
|
+
Copyright (c) 2013-2016 Mindaugas Mozūras. See [LICENSE](LICENSE) for further details.
|
data/lib/pronto.rb
CHANGED
@@ -3,6 +3,9 @@ require 'octokit'
|
|
3
3
|
require 'gitlab'
|
4
4
|
require 'forwardable'
|
5
5
|
|
6
|
+
require 'pronto/gem_names'
|
7
|
+
|
8
|
+
require 'pronto/logger'
|
6
9
|
require 'pronto/config_file'
|
7
10
|
require 'pronto/config'
|
8
11
|
|
@@ -29,7 +32,7 @@ require 'pronto/formatter/formatter'
|
|
29
32
|
|
30
33
|
module Pronto
|
31
34
|
def self.run(commit = 'master', repo_path = '.',
|
32
|
-
|
35
|
+
formatters = [Formatter::TextFormatter.new], file = nil)
|
33
36
|
commit ||= 'master'
|
34
37
|
|
35
38
|
repo = Git::Repository.new(repo_path)
|
@@ -38,22 +41,11 @@ module Pronto
|
|
38
41
|
|
39
42
|
result = Runners.new.run(patches)
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
result
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.gem_names
|
48
|
-
gems = Gem::Specification.find_all.select do |gem|
|
49
|
-
if gem.name =~ /^pronto-/
|
50
|
-
true
|
51
|
-
elsif gem.name != 'pronto'
|
52
|
-
runner_path = File.join(gem.full_gem_path, "lib/pronto/#{gem.name}.rb")
|
53
|
-
File.exist?(runner_path)
|
54
|
-
end
|
44
|
+
Array(formatters).each do |formatter|
|
45
|
+
formatted = formatter.format(result, repo, patches)
|
46
|
+
puts formatted if formatted
|
55
47
|
end
|
56
48
|
|
57
|
-
|
49
|
+
result
|
58
50
|
end
|
59
51
|
end
|
data/lib/pronto/cli.rb
CHANGED
@@ -35,21 +35,21 @@ module Pronto
|
|
35
35
|
aliases: '-r',
|
36
36
|
desc: 'Run only the passed runners'
|
37
37
|
|
38
|
-
method_option :
|
39
|
-
type: :
|
38
|
+
method_option :formatters,
|
39
|
+
type: :array,
|
40
40
|
default: 'text',
|
41
|
-
aliases: '-f',
|
42
|
-
desc: "Pick output
|
41
|
+
aliases: ['formatter', '-f'],
|
42
|
+
desc: "Pick output formatters. Available: #{::Pronto::Formatter.names.join(', ')}"
|
43
43
|
|
44
44
|
def run(path = nil)
|
45
|
-
gem_names = options[:runner].any? ? options[:runner] : ::Pronto.
|
45
|
+
gem_names = options[:runner].any? ? options[:runner] : ::Pronto::GemNames.new.to_a
|
46
46
|
gem_names.each do |gem_name|
|
47
47
|
require "pronto/#{gem_name}"
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
formatters = ::Pronto::Formatter.get(options[:formatters])
|
51
51
|
commit = options[:index] ? :index : options[:commit]
|
52
|
-
messages = ::Pronto.run(commit, '.',
|
52
|
+
messages = ::Pronto.run(commit, '.', formatters, path)
|
53
53
|
exit(messages.count) if options[:'exit-code']
|
54
54
|
rescue Rugged::RepositoryError
|
55
55
|
puts '"pronto" should be run from a git repository'
|
@@ -58,14 +58,21 @@ module Pronto
|
|
58
58
|
desc 'list', 'Lists pronto runners that are available to be used'
|
59
59
|
|
60
60
|
def list
|
61
|
-
puts ::Pronto.
|
61
|
+
puts ::Pronto::GemNames.new.to_a
|
62
62
|
end
|
63
63
|
|
64
|
-
desc 'version', '
|
64
|
+
desc 'version', 'Display version'
|
65
65
|
map %w(-v --version) => :version
|
66
66
|
|
67
67
|
def version
|
68
|
-
puts
|
68
|
+
puts Version::STRING
|
69
|
+
end
|
70
|
+
|
71
|
+
desc 'verbose-version', 'Display verbose version'
|
72
|
+
map %w(-V --verbose-version) => :verbose_version
|
73
|
+
|
74
|
+
def verbose_version
|
75
|
+
puts Version.verbose
|
69
76
|
end
|
70
77
|
end
|
71
78
|
end
|
data/lib/pronto/config.rb
CHANGED
@@ -21,6 +21,16 @@ module Pronto
|
|
21
21
|
URI.parse(github_web_endpoint).host
|
22
22
|
end
|
23
23
|
|
24
|
+
def max_warnings
|
25
|
+
@config_hash['max_warnings']
|
26
|
+
end
|
27
|
+
|
28
|
+
def logger
|
29
|
+
@logger ||= begin
|
30
|
+
@config_hash['verbose'] ? Logger.new($stdout) : Logger.silent
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
24
34
|
private
|
25
35
|
|
26
36
|
def exclude
|
data/lib/pronto/config_file.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Pronto
|
2
2
|
module Formatter
|
3
|
-
def self.get(
|
4
|
-
|
5
|
-
|
3
|
+
def self.get(names)
|
4
|
+
names ||= 'text'
|
5
|
+
Array(names).map { |name| FORMATTERS[name.to_s] || TextFormatter }
|
6
|
+
.uniq.map(&:new)
|
6
7
|
end
|
7
8
|
|
8
9
|
def self.names
|
@@ -17,6 +18,6 @@ module Pronto
|
|
17
18
|
'checkstyle' => CheckstyleFormatter,
|
18
19
|
'text' => TextFormatter,
|
19
20
|
'null' => NullFormatter
|
20
|
-
}
|
21
|
+
}.freeze
|
21
22
|
end
|
22
23
|
end
|
@@ -29,7 +29,7 @@ module Pronto
|
|
29
29
|
# tends to recognize these better, leading to messages we can't post
|
30
30
|
# because their diff position is non-existent on Github.
|
31
31
|
# Ignore such occasions and continue posting other messages.
|
32
|
-
|
32
|
+
$stderr.puts "Failed to post: #{comment} with #{e.message}"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Pronto
|
2
|
+
class GemNames
|
3
|
+
def to_a
|
4
|
+
gems = Gem::Specification.find_all.select do |gem|
|
5
|
+
if gem.name =~ /^pronto-/
|
6
|
+
true
|
7
|
+
elsif gem.name != 'pronto'
|
8
|
+
runner_path = File.join(gem.full_gem_path, "lib/pronto/#{gem.name}.rb")
|
9
|
+
File.exist?(runner_path)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
gems.map { |gem| gem.name.sub(/^pronto-/, '') }.uniq.sort
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/pronto/github.rb
CHANGED
@@ -17,7 +17,7 @@ module Pronto
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def commit_comments(sha)
|
20
|
-
@comment_cache[
|
20
|
+
@comment_cache[sha.to_s] ||= begin
|
21
21
|
client.commit_comments(slug, sha).map do |comment|
|
22
22
|
Comment.new(sha, comment.body, comment.path, comment.position)
|
23
23
|
end
|
@@ -25,11 +25,13 @@ module Pronto
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def create_commit_comment(comment)
|
28
|
+
@config.logger.log("Creating commit comment on #{comment.sha}")
|
28
29
|
client.create_commit_comment(slug, comment.sha, comment.body,
|
29
30
|
comment.path, nil, comment.position)
|
30
31
|
end
|
31
32
|
|
32
33
|
def create_pull_comment(comment)
|
34
|
+
@config.logger.log("Creating pull request comment on #{pull_id}")
|
33
35
|
client.create_pull_comment(slug, pull_id, comment.body,
|
34
36
|
pull_sha || comment.sha,
|
35
37
|
comment.path, comment.position)
|
@@ -85,6 +87,10 @@ module Pronto
|
|
85
87
|
path == other.path &&
|
86
88
|
body == other.body
|
87
89
|
end
|
90
|
+
|
91
|
+
def to_s
|
92
|
+
"[#{sha}] #{path}:#{position} - #{body}"
|
93
|
+
end
|
88
94
|
end
|
89
95
|
end
|
90
96
|
end
|
data/lib/pronto/gitlab.rb
CHANGED
@@ -7,7 +7,7 @@ module Pronto
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def commit_comments(sha)
|
10
|
-
@comment_cache[
|
10
|
+
@comment_cache[sha.to_s] ||= begin
|
11
11
|
client.commit_comments(slug, sha, per_page: 500).map do |comment|
|
12
12
|
Comment.new(sha, comment.note, comment.path, comment.line)
|
13
13
|
end
|
@@ -15,6 +15,7 @@ module Pronto
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def create_commit_comment(comment)
|
18
|
+
@config.logger.log("Creating commit comment on #{comment.sha}")
|
18
19
|
client.create_commit_comment(slug, comment.sha, comment.note,
|
19
20
|
path: comment.path, line: comment.line,
|
20
21
|
line_type: 'new')
|
@@ -26,7 +27,7 @@ module Pronto
|
|
26
27
|
return @config.gitlab_slug if @config.gitlab_slug
|
27
28
|
@slug ||= begin
|
28
29
|
slug = @repo.remote_urls.map do |url|
|
29
|
-
match = if url
|
30
|
+
match = if url =~ /^ssh:\/\//
|
30
31
|
/.*#{host}(:[0-9]+)?(:|\/)(?<slug>.*).git/.match(url)
|
31
32
|
else
|
32
33
|
/.*#{host}(:|\/)(?<slug>.*).git/.match(url)
|
data/lib/pronto/message.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Pronto
|
2
2
|
class Message
|
3
|
-
attr_reader :path, :line, :level, :msg, :commit_sha
|
3
|
+
attr_reader :path, :line, :level, :msg, :commit_sha, :runner
|
4
4
|
|
5
|
-
LEVELS = [:info, :warning, :error, :fatal]
|
5
|
+
LEVELS = [:info, :warning, :error, :fatal].freeze
|
6
6
|
|
7
|
-
def initialize(path, line, level, msg, commit_sha = nil)
|
7
|
+
def initialize(path, line, level, msg, commit_sha = nil, runner = nil)
|
8
8
|
unless LEVELS.include?(level)
|
9
9
|
raise ::ArgumentError, "level should be set to one of #{LEVELS}"
|
10
10
|
end
|
@@ -13,6 +13,7 @@ module Pronto
|
|
13
13
|
@line = line
|
14
14
|
@level = level
|
15
15
|
@msg = msg
|
16
|
+
@runner = runner
|
16
17
|
@commit_sha = commit_sha
|
17
18
|
@commit_sha ||= line.commit_sha if line
|
18
19
|
end
|
@@ -31,7 +32,7 @@ module Pronto
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
34
|
-
|
35
|
+
alias eql? ==
|
35
36
|
|
36
37
|
def hash
|
37
38
|
comparison_attributes.reduce(0) do |hash, attribute|
|
@@ -21,9 +21,7 @@ module Pronto
|
|
21
21
|
|
22
22
|
task(name, *args) do |_, task_args|
|
23
23
|
RakeFileUtils.send(:verbose, verbose) do
|
24
|
-
if task_block
|
25
|
-
task_block.call(*[self, task_args].slice(0, task_block.arity))
|
26
|
-
end
|
24
|
+
yield(*[self, task_args].slice(0, task_block.arity)) if task_block
|
27
25
|
run_task
|
28
26
|
end
|
29
27
|
end
|
@@ -32,17 +30,20 @@ module Pronto
|
|
32
30
|
def run_task
|
33
31
|
return if pull_id.nil? || pull_id == 'false'
|
34
32
|
|
35
|
-
client = Octokit::Client.new
|
36
|
-
|
37
33
|
pull_request = client.pull_request(repo_slug, pull_id)
|
38
34
|
formatter = ::Pronto::Formatter::GithubFormatter.new
|
39
35
|
|
40
|
-
::Pronto.
|
36
|
+
gem_names = ::Pronto::GemNames.new.to_a
|
37
|
+
gem_names.each { |gem_name| require "pronto/#{gem_name}" }
|
41
38
|
::Pronto.run(pull_request.base.sha, '.', formatter)
|
42
39
|
end
|
43
40
|
|
44
41
|
private
|
45
42
|
|
43
|
+
def client
|
44
|
+
Octokit::Client.new
|
45
|
+
end
|
46
|
+
|
46
47
|
def pull_id
|
47
48
|
ENV['TRAVIS_PULL_REQUEST']
|
48
49
|
end
|
data/lib/pronto/runner.rb
CHANGED
@@ -2,14 +2,30 @@ module Pronto
|
|
2
2
|
class Runner
|
3
3
|
include Plugin
|
4
4
|
|
5
|
+
def initialize(patches, commit = nil)
|
6
|
+
@patches = patches
|
7
|
+
@commit = commit
|
8
|
+
end
|
9
|
+
|
5
10
|
def self.runners
|
6
11
|
repository
|
7
12
|
end
|
8
13
|
|
14
|
+
def ruby_patches
|
15
|
+
return [] unless @patches
|
16
|
+
|
17
|
+
@ruby_patches ||= @patches.select { |patch| patch.additions > 0 }
|
18
|
+
.select { |patch| ruby_file?(patch.new_file_full_path) }
|
19
|
+
end
|
20
|
+
|
9
21
|
def ruby_file?(path)
|
10
22
|
rb_file?(path) || rake_file?(path) || ruby_executable?(path)
|
11
23
|
end
|
12
24
|
|
25
|
+
def repo_path
|
26
|
+
ruby_patches.first.repo.path
|
27
|
+
end
|
28
|
+
|
13
29
|
private
|
14
30
|
|
15
31
|
def rb_file?(path)
|
@@ -21,6 +37,7 @@ module Pronto
|
|
21
37
|
end
|
22
38
|
|
23
39
|
def ruby_executable?(path)
|
40
|
+
return false if File.directory?(path)
|
24
41
|
line = File.open(path, &:readline)
|
25
42
|
line =~ /#!.*ruby/
|
26
43
|
rescue ArgumentError, EOFError
|
data/lib/pronto/runners.rb
CHANGED
@@ -9,8 +9,14 @@ module Pronto
|
|
9
9
|
patches = reject_excluded(patches)
|
10
10
|
return [] unless patches.any?
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
result = []
|
13
|
+
@runners.each do |runner|
|
14
|
+
next if exceeds_max?(result)
|
15
|
+
@config.logger.log("Running #{runner}")
|
16
|
+
result += runner.new(patches, patches.commit).run.flatten.compact
|
17
|
+
end
|
18
|
+
result = result.take(@config.max_warnings) if @config.max_warnings
|
19
|
+
result
|
14
20
|
end
|
15
21
|
|
16
22
|
private
|
@@ -24,5 +30,9 @@ module Pronto
|
|
24
30
|
def excluded?(patch)
|
25
31
|
@config.excluded_files.include?(patch.new_file_full_path.to_s)
|
26
32
|
end
|
33
|
+
|
34
|
+
def exceeds_max?(warnings)
|
35
|
+
@config.max_warnings && warnings.count >= @config.max_warnings
|
36
|
+
end
|
27
37
|
end
|
28
38
|
end
|
data/lib/pronto/version.rb
CHANGED
data/pronto.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'English'
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'pronto'
|
9
|
-
s.version = Pronto::
|
9
|
+
s.version = Pronto::Version::STRING
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
11
|
s.author = 'Mindaugas Mozūras'
|
12
12
|
s.email = 'mindaugas.mozuras@gmail.com'
|
@@ -40,14 +40,14 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.require_paths = ['lib']
|
41
41
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
42
42
|
|
43
|
-
s.add_runtime_dependency('rugged', '~> 0.23.0')
|
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.1.0')
|
46
|
-
s.add_runtime_dependency('gitlab', '~> 3.4.0')
|
47
|
-
s.add_development_dependency('rake', '~>
|
48
|
-
s.add_development_dependency('rspec', '~> 3.
|
45
|
+
s.add_runtime_dependency('octokit', '~> 4.3', '>= 4.1.0')
|
46
|
+
s.add_runtime_dependency('gitlab', '~> 3.6', '>= 3.4.0')
|
47
|
+
s.add_development_dependency('rake', '~> 11.0')
|
48
|
+
s.add_development_dependency('rspec', '~> 3.4')
|
49
49
|
s.add_development_dependency('rspec-its', '~> 1.2')
|
50
|
-
s.add_development_dependency('rspec-expectations', '~> 3.
|
50
|
+
s.add_development_dependency('rspec-expectations', '~> 3.4')
|
51
51
|
s.add_development_dependency('bundler', '~> 1.3')
|
52
|
-
s.add_development_dependency('simplecov', '~> 0.
|
52
|
+
s.add_development_dependency('simplecov', '~> 0.11')
|
53
53
|
end
|
metadata
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.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:
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.24'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 0.23.0
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.24'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 0.23.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
@@ -43,6 +49,9 @@ dependencies:
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '4.3'
|
54
|
+
- - ">="
|
46
55
|
- !ruby/object:Gem::Version
|
47
56
|
version: 4.1.0
|
48
57
|
type: :runtime
|
@@ -50,6 +59,9 @@ dependencies:
|
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
51
60
|
requirements:
|
52
61
|
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '4.3'
|
64
|
+
- - ">="
|
53
65
|
- !ruby/object:Gem::Version
|
54
66
|
version: 4.1.0
|
55
67
|
- !ruby/object:Gem::Dependency
|
@@ -57,6 +69,9 @@ dependencies:
|
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
71
|
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '3.6'
|
74
|
+
- - ">="
|
60
75
|
- !ruby/object:Gem::Version
|
61
76
|
version: 3.4.0
|
62
77
|
type: :runtime
|
@@ -64,6 +79,9 @@ dependencies:
|
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
65
80
|
requirements:
|
66
81
|
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.6'
|
84
|
+
- - ">="
|
67
85
|
- !ruby/object:Gem::Version
|
68
86
|
version: 3.4.0
|
69
87
|
- !ruby/object:Gem::Dependency
|
@@ -72,28 +90,28 @@ dependencies:
|
|
72
90
|
requirements:
|
73
91
|
- - "~>"
|
74
92
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
93
|
+
version: '11.0'
|
76
94
|
type: :development
|
77
95
|
prerelease: false
|
78
96
|
version_requirements: !ruby/object:Gem::Requirement
|
79
97
|
requirements:
|
80
98
|
- - "~>"
|
81
99
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
100
|
+
version: '11.0'
|
83
101
|
- !ruby/object:Gem::Dependency
|
84
102
|
name: rspec
|
85
103
|
requirement: !ruby/object:Gem::Requirement
|
86
104
|
requirements:
|
87
105
|
- - "~>"
|
88
106
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
107
|
+
version: '3.4'
|
90
108
|
type: :development
|
91
109
|
prerelease: false
|
92
110
|
version_requirements: !ruby/object:Gem::Requirement
|
93
111
|
requirements:
|
94
112
|
- - "~>"
|
95
113
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
114
|
+
version: '3.4'
|
97
115
|
- !ruby/object:Gem::Dependency
|
98
116
|
name: rspec-its
|
99
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +132,14 @@ dependencies:
|
|
114
132
|
requirements:
|
115
133
|
- - "~>"
|
116
134
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
135
|
+
version: '3.4'
|
118
136
|
type: :development
|
119
137
|
prerelease: false
|
120
138
|
version_requirements: !ruby/object:Gem::Requirement
|
121
139
|
requirements:
|
122
140
|
- - "~>"
|
123
141
|
- !ruby/object:Gem::Version
|
124
|
-
version: '3.
|
142
|
+
version: '3.4'
|
125
143
|
- !ruby/object:Gem::Dependency
|
126
144
|
name: bundler
|
127
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +160,14 @@ dependencies:
|
|
142
160
|
requirements:
|
143
161
|
- - "~>"
|
144
162
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
163
|
+
version: '0.11'
|
146
164
|
type: :development
|
147
165
|
prerelease: false
|
148
166
|
version_requirements: !ruby/object:Gem::Requirement
|
149
167
|
requirements:
|
150
168
|
- - "~>"
|
151
169
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0.
|
170
|
+
version: '0.11'
|
153
171
|
description: |2
|
154
172
|
Pronto runs analysis quickly by checking only the relevant changes. Created
|
155
173
|
to be used on pull requests, but suited for other scenarios as well. Perfect
|
@@ -180,12 +198,14 @@ files:
|
|
180
198
|
- lib/pronto/formatter/json_formatter.rb
|
181
199
|
- lib/pronto/formatter/null_formatter.rb
|
182
200
|
- lib/pronto/formatter/text_formatter.rb
|
201
|
+
- lib/pronto/gem_names.rb
|
183
202
|
- lib/pronto/git/line.rb
|
184
203
|
- lib/pronto/git/patch.rb
|
185
204
|
- lib/pronto/git/patches.rb
|
186
205
|
- lib/pronto/git/repository.rb
|
187
206
|
- lib/pronto/github.rb
|
188
207
|
- lib/pronto/gitlab.rb
|
208
|
+
- lib/pronto/logger.rb
|
189
209
|
- lib/pronto/message.rb
|
190
210
|
- lib/pronto/plugin.rb
|
191
211
|
- lib/pronto/rake_task/travis_pull_request.rb
|