pronto-undercover 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pronto/patch_changeset.rb +1 -0
- data/lib/pronto/undercover.rb +11 -3
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8885bbb4623337f4d0fb6b1205b76552afad8af6f0d93f232aca0f1713b53b7c
|
4
|
+
data.tar.gz: a6ea1c17d975522f572b1d62d744c03778d4615675808065afde92b04a03e67b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38a67d942e78b7344a6d77592a85823512bd02c15be57c2676cb6a98f3095f42e67708094730a3043fa2a9d2b7f02cee960ec7b172db99f100c6926790fb5ec
|
7
|
+
data.tar.gz: 22e14d21eb45ac770e2c53e9e6d512ec83091717ed06a09bd472937c23c83f5a1d22ccc4aa663a5bf54e8906ae95815a3739a775582e5c8edb2b8f283987a296
|
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|
|
@@ -55,7 +59,7 @@ module Pronto
|
|
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 }
|
@@ -71,13 +75,17 @@ module Pronto
|
|
71
75
|
end.compact
|
72
76
|
end
|
73
77
|
|
78
|
+
# rubocop:disable Metrics/AbcSize
|
74
79
|
def undercover_options
|
75
|
-
config = Pronto::ConfigFile.new.to_h
|
80
|
+
config = Pronto::ConfigFile.new.to_h['pronto-undercover']
|
81
|
+
return ::Undercover::Options.new.parse([]) unless config
|
82
|
+
|
76
83
|
opts = []
|
77
84
|
opts << "-l#{config['lcov']}" if config['lcov']
|
78
85
|
opts << "-r#{config['ruby-syntax']}" if config['ruby-syntax']
|
79
86
|
opts << "-p#{config['path']}" if config['path']
|
80
87
|
::Undercover::Options.new.parse(opts)
|
81
88
|
end
|
89
|
+
# rubocop:enable Metrics/AbcSize
|
82
90
|
end
|
83
91
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Grodowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|