pronto-rustcov 0.1.5 → 0.1.6

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 +8 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b90415468e5df17f944a01aaf70d5cfcedf235d6219cb6decfd7444fd5316aa
4
- data.tar.gz: 7fa74a181f664b1f2f6790a46a96f5c75ccc23439f23348bcdfb3a5f00d385dc
3
+ metadata.gz: bb33cf0ba6f6437b808ddc35ee00823c3cfbf03d463dc943b4255597dca768b2
4
+ data.tar.gz: 50f0acb9d7d0c3c240ca13e5191d7f871512d4280ad3ba92d25a4f6fd94fec8e
5
5
  SHA512:
6
- metadata.gz: b0723c5c9ced93c32082537a66721a769dba75bb9f54a1113213c6ab7a921872f44b219d6cbb7d6856996ea7d6f881d1381f087f8214099aeb6fbe45d7fa6473
7
- data.tar.gz: edc3c3699d2c03e1421708159891f8d4011c99e2a0b31951901f02e51bb95905b7f36feb16b03ebfbd5829fdb7f9cb298b835865cfd376b1354bd5323145184f
6
+ metadata.gz: 9eae0d6aa9a54c4dd6986fe8423b2a6e805ddc32af24b2321cbb6f1434af8596544eda819248313a45904585cf6bc17759f6f2e81de0f281e457c9bd3eeca0bf
7
+ data.tar.gz: 4d9156c24fe8183937b769a36ed7782384d4e8875794b1014106cc32d6546feddd2de5d9787190d306428810159ebb0b4bc5eefda7d8fbb108f1d566c9de4d3d
@@ -6,8 +6,12 @@ module Pronto
6
6
  one_message_per_file('target/lcov.info')
7
7
  end
8
8
 
9
- def messages_limit
10
- ENV['PRONTO_RUSTCOV_MESSAGES_LIMIT']&.to_i || 5
9
+ def pronto_files_limit
10
+ ENV['PRONTO_RUSTCOV_FILES_LIMIT']&.to_i || 5
11
+ end
12
+
13
+ def pronto_messages_per_file_limit
14
+ ENV['PRONTO_RUSTCOV_MESSAGES_PER_FILE_LIMIT']&.to_i || 5
11
15
  end
12
16
 
13
17
  def one_message_per_file(lcov_path)
@@ -17,7 +21,7 @@ module Pronto
17
21
 
18
22
  grouped = Hash.new { |h, k| h[k] = [] }
19
23
 
20
- @patches.sort_by { |patch| -patch.added_lines.count }.take(messages_limit).each do |patch|
24
+ @patches.sort_by { |patch| -patch.added_lines.count }.take(pronto_files_limit).each do |patch|
21
25
  next unless patch.added_lines.any?
22
26
  file_path = patch.new_file_full_path.to_s
23
27
  uncovered = lcov[file_path]
@@ -33,6 +37,7 @@ module Pronto
33
37
  grouped.map do |patch, lines|
34
38
  linenos = lines.map(&:new_lineno).sort
35
39
  ranges = linenos.chunk_while { |i, j| j == i + 1 }
40
+ .take(pronto_messages_per_file_limit)
36
41
  .map { |group| group.size > 1 ? "#{group.first}–#{group.last}" : group.first.to_s }
37
42
 
38
43
  message_text = "⚠️ Test coverage is missing for lines: #{ranges.join(', ')}"
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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis