pronto-rustcov 0.1.7 → 0.1.9
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/lib/pronto/rustcov.rb +5 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aad469c0aeb544cb4bd49065731799cc6303a462833d143d77e9a0c805d8ef5
|
4
|
+
data.tar.gz: df7c0823144b3708ef7f022d7748f5b8afd72532340679f73d92c75708e454ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ead906857eb7354e322342b9d0da8396192918275e11fdcff7bbc1f8a2e11880d2a16cdea439638c6043a439cd96f061930462bb16d7d97840f348d7570779
|
7
|
+
data.tar.gz: 417627cb6fa45276eec6b0507b36b54ad7e30da897a367cd8f78d14ea541d0a917231f133c22d97b93f7ce832322d6b509423a9eabc9e822205c39c9396455a4
|
data/lib/pronto/rustcov.rb
CHANGED
@@ -33,7 +33,7 @@ module Pronto
|
|
33
33
|
def group_patches(patches, lcov)
|
34
34
|
grouped = Hash.new { |h, k| h[k] = [] }
|
35
35
|
|
36
|
-
patches.
|
36
|
+
patches.each do |patch|
|
37
37
|
next unless patch.added_lines.any?
|
38
38
|
file_path = patch.new_file_full_path.to_s
|
39
39
|
uncovered = lcov[file_path]
|
@@ -46,7 +46,7 @@ module Pronto
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
grouped
|
49
|
+
grouped.sort_by { |_, lines| -lines.count }.take(pronto_files_limit)
|
50
50
|
end
|
51
51
|
|
52
52
|
def build_messages(grouped)
|
@@ -56,9 +56,11 @@ module Pronto
|
|
56
56
|
linenos = lines.map(&:new_lineno).sort
|
57
57
|
line_ranges = linenos.chunk_while { |i, j| j == i + 1 }.to_a
|
58
58
|
|
59
|
+
best_ranges = line_ranges.sort_by { |range| [-range.size, range.first] }.take(pronto_messages_per_file_limit)
|
60
|
+
|
59
61
|
# If we have a message per file limit of N, then create N individual messages
|
60
62
|
# We'll take each range and create a separate message for it, up to the limit
|
61
|
-
|
63
|
+
best_ranges.each do |range|
|
62
64
|
message_text = format_message_text(range)
|
63
65
|
|
64
66
|
# Find the first line in this range for the message
|
@@ -72,9 +74,6 @@ module Pronto
|
|
72
74
|
nil,
|
73
75
|
self.class
|
74
76
|
)
|
75
|
-
|
76
|
-
# Stop if we've reached the limit of messages per file
|
77
|
-
break if messages.count { |m| m.path == patch.new_file_path } >= pronto_messages_per_file_limit
|
78
77
|
end
|
79
78
|
end
|
80
79
|
|