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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pronto/rustcov.rb +5 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7df000545899a6dcf0010858dce8b6b70fbd490b3267ce907167289be36c746f
4
- data.tar.gz: 1e7e6c583a9be88702d442f9da91921e0bb1debed9563af582f1e06d356cc575
3
+ metadata.gz: 3aad469c0aeb544cb4bd49065731799cc6303a462833d143d77e9a0c805d8ef5
4
+ data.tar.gz: df7c0823144b3708ef7f022d7748f5b8afd72532340679f73d92c75708e454ff
5
5
  SHA512:
6
- metadata.gz: 9d3cc9a905b9ed10d597c8e2a414a1fe4d368c486cb80d0adb9751df1c594f745597b5edbfc0087780154df510691fb6b5de3147fdc5f06ef4eac5c1312e7478
7
- data.tar.gz: a04b4aa9f19c3dd7b6bf2dd555f35129c5a89b1432997f6e1e9b0c5ada57d3a558e0a8eb570d36fc81f89fea27cb00f0c8d3aa06568228d3a170d848d3f7d4d0
6
+ metadata.gz: 68ead906857eb7354e322342b9d0da8396192918275e11fdcff7bbc1f8a2e11880d2a16cdea439638c6043a439cd96f061930462bb16d7d97840f348d7570779
7
+ data.tar.gz: 417627cb6fa45276eec6b0507b36b54ad7e30da897a367cd8f78d14ea541d0a917231f133c22d97b93f7ce832322d6b509423a9eabc9e822205c39c9396455a4
@@ -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.sort_by { |patch| -patch.added_lines.count }.take(pronto_files_limit).each do |patch|
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
- line_ranges.each do |range|
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-rustcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis