pronto-undercover 0.1.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/.travis.yml +13 -5
- data/CHANGELOG.md +26 -0
- data/lib/pronto/patch_changeset.rb +1 -0
- data/lib/pronto/undercover.rb +11 -5
- data/lib/version.rb +1 -1
- data/pronto-undercover.gemspec +4 -3
- metadata +19 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f16e3d54ccfa1eb353e26f3f6b8131dfbbc73c9fb9c7c5793bf5d349d45853e1
|
4
|
+
data.tar.gz: 529446093c7e3c3cc464cc6ade0d429c9934dce288a21410f01d581bd70f8900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec5ad40ae074c10a0b6975d9573fa54463019b180cfbf94fc24e415cec020cf071d8c1fbbdf244d27e40dfddec6c60955c4e709038f0eecf75f6f88bc2ca912
|
7
|
+
data.tar.gz: a36733b06b41128f39a08d2a41f73090579db0592535d90c0bfb0f7a650254ec3eb3387396aa091d62eb8d875f26a724f51060e745fa48f912a07a13bf133a09
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
sudo: false
|
2
1
|
language: ruby
|
3
2
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
|
3
|
+
- 2.7.1
|
4
|
+
- 2.6.6
|
5
|
+
- 2.5.8
|
6
|
+
- 3.0.0
|
7
|
+
allow_failures:
|
8
|
+
- 3.0.0
|
9
|
+
before_install:
|
10
|
+
- gem install bundler undercover
|
11
|
+
- gem update --system
|
12
|
+
script:
|
13
|
+
- bundle exec rake
|
14
|
+
- git pull origin master:master
|
15
|
+
- undercover --compare master
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [0.1.6] - 2020-02-06
|
10
|
+
### Changed
|
11
|
+
- Update pronto dependency
|
12
|
+
|
13
|
+
## [0.1.5] - 2019-03-19
|
14
|
+
### Added
|
15
|
+
- Use flagged_results accessor by @yassinecc
|
16
|
+
|
17
|
+
## [0.1.4] - 2019-03-19
|
18
|
+
### Added
|
19
|
+
- This `CHANGELOG.md`
|
20
|
+
|
21
|
+
### Changed
|
22
|
+
- support `pronto >= 0.9`
|
23
|
+
|
24
|
+
[Unreleased]: https://github.com/grodowski/pronto-undercover/compare/v0.1.5...HEAD
|
25
|
+
[0.1.5]: https://github.com/grodowski/pronto-undercover/compare/v0.1.4...v0.1.5
|
26
|
+
[0.1.4]: https://github.com/grodowski/pronto-undercover/compare/v0.1.3...v0.1.4
|
data/lib/pronto/undercover.rb
CHANGED
@@ -20,7 +20,7 @@ module Pronto
|
|
20
20
|
return [] if !@patches || @patches.count.zero?
|
21
21
|
|
22
22
|
@patches
|
23
|
-
.select { |patch| patch
|
23
|
+
.select { |patch| valid_patch?(patch) }
|
24
24
|
.map { |patch| patch_to_undercover_message(patch) }
|
25
25
|
.flatten.compact
|
26
26
|
rescue Errno::ENOENT => e
|
@@ -30,6 +30,10 @@ module Pronto
|
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
+
def valid_patch?(patch)
|
34
|
+
patch.additions.positive? && ruby_file?(patch.new_file_full_path)
|
35
|
+
end
|
36
|
+
|
33
37
|
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
34
38
|
def patch_to_undercover_message(patch)
|
35
39
|
offending_line_numbers(patch).map do |warning, msg_line_no|
|
@@ -42,7 +46,7 @@ module Pronto
|
|
42
46
|
msg = "#{warning.node.human_name} #{warning.node.name} missing tests" \
|
43
47
|
" for line#{'s' if lines.size > 1} #{lines.join(', ')}" \
|
44
48
|
" (coverage: #{warning.coverage_f})"
|
45
|
-
Message.new(path, line, DEFAULT_LEVEL, msg)
|
49
|
+
Message.new(path, line, DEFAULT_LEVEL, msg, nil, self.class)
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
@@ -51,11 +55,11 @@ module Pronto
|
|
51
55
|
def undercover_warnings
|
52
56
|
@undercover_warnings ||= ::Undercover::Report.new(
|
53
57
|
@patch_changeset, undercover_options
|
54
|
-
).build.
|
58
|
+
).build.flagged_results
|
55
59
|
end
|
56
60
|
|
57
61
|
def offending_line_numbers(patch)
|
58
|
-
patch_lines = patch.added_lines.map(&:
|
62
|
+
patch_lines = patch.added_lines.map(&:new_lineno)
|
59
63
|
path = patch.new_file_full_path.to_s
|
60
64
|
undercover_warnings
|
61
65
|
.select { |warning| File.expand_path(warning.file_path) == path }
|
@@ -72,7 +76,9 @@ module Pronto
|
|
72
76
|
end
|
73
77
|
|
74
78
|
def undercover_options
|
75
|
-
config = Pronto::ConfigFile.new.to_h
|
79
|
+
config = Pronto::ConfigFile.new.to_h['pronto-undercover']
|
80
|
+
return ::Undercover::Options.new.parse([]) unless config
|
81
|
+
|
76
82
|
opts = []
|
77
83
|
opts << "-l#{config['lcov']}" if config['lcov']
|
78
84
|
opts << "-r#{config['ruby-syntax']}" if config['ruby-syntax']
|
data/lib/version.rb
CHANGED
data/pronto-undercover.gemspec
CHANGED
@@ -18,11 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
f.match(/^(test|spec|features)\//)
|
19
19
|
end
|
20
20
|
spec.require_paths = ['lib']
|
21
|
+
spec.required_ruby_version = '>= 2.5'
|
21
22
|
|
22
|
-
spec.add_dependency 'pronto', '
|
23
|
-
spec.add_dependency 'undercover', '~> 0.
|
23
|
+
spec.add_dependency 'pronto', '>= 0.9', '< 0.12'
|
24
|
+
spec.add_dependency 'undercover', '~> 0.3.4'
|
24
25
|
spec.add_development_dependency 'pry'
|
25
|
-
spec.add_development_dependency 'rake', '~>
|
26
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
26
27
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
28
|
spec.add_development_dependency 'rubocop'
|
28
29
|
spec.add_development_dependency 'simplecov'
|
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-undercover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Grodowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9
|
19
|
+
version: '0.9'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0.12'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.9'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
32
|
+
version: '0.12'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: undercover
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
39
|
+
version: 0.3.4
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
46
|
+
version: 0.3.4
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: pry
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +64,14 @@ dependencies:
|
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
67
|
+
version: '13.0'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
74
|
+
version: '13.0'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: rspec
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,6 +167,7 @@ files:
|
|
161
167
|
- ".rspec"
|
162
168
|
- ".rubocop.yml"
|
163
169
|
- ".travis.yml"
|
170
|
+
- CHANGELOG.md
|
164
171
|
- Gemfile
|
165
172
|
- LICENSE.txt
|
166
173
|
- README.md
|
@@ -181,15 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
188
|
requirements:
|
182
189
|
- - ">="
|
183
190
|
- !ruby/object:Gem::Version
|
184
|
-
version: '
|
191
|
+
version: '2.5'
|
185
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
193
|
requirements:
|
187
194
|
- - ">="
|
188
195
|
- !ruby/object:Gem::Version
|
189
196
|
version: '0'
|
190
197
|
requirements: []
|
191
|
-
|
192
|
-
rubygems_version: 2.7.6
|
198
|
+
rubygems_version: 3.1.4
|
193
199
|
signing_key:
|
194
200
|
specification_version: 4
|
195
201
|
summary: Pronto runner for Undercover - actionable code coverage
|