pronto-rustcov 0.1.4 → 0.1.5

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 +2 -49
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63740536f0a7afad0d8d7072898fb5c90ffe7d73902cb234a6e6058c1733e221
4
- data.tar.gz: acafff7d282c63394f8f4d0424ba14e3999cd23097da1d5443460e5b26d5310d
3
+ metadata.gz: 4b90415468e5df17f944a01aaf70d5cfcedf235d6219cb6decfd7444fd5316aa
4
+ data.tar.gz: 7fa74a181f664b1f2f6790a46a96f5c75ccc23439f23348bcdfb3a5f00d385dc
5
5
  SHA512:
6
- metadata.gz: 66878eaab3af2cda55d7c6d74d569e5aaa8f9ddb21e9eca532eabb11248f6e737698f7ecbf872681849941908c450e7233ac704e949fb1578e3b4ae386818c7f
7
- data.tar.gz: 2620f0434925e9b940ccb60fc8bea6ade2ba074980f78c90e45f3f8135bc6c7d3f3dd7eb4a0141e91dfa7ec3c4cd438339cd0ed3c701a8f1416fceefac1a8262
6
+ metadata.gz: b0723c5c9ced93c32082537a66721a769dba75bb9f54a1113213c6ab7a921872f44b219d6cbb7d6856996ea7d6f881d1381f087f8214099aeb6fbe45d7fa6473
7
+ data.tar.gz: edc3c3699d2c03e1421708159891f8d4011c99e2a0b31951901f02e51bb95905b7f36feb16b03ebfbd5829fdb7f9cb298b835865cfd376b1354bd5323145184f
@@ -3,58 +3,11 @@ require 'pronto'
3
3
  module Pronto
4
4
  class Rustcov < Runner
5
5
  def run
6
- if ENV['PRONTO_RUSTCOV_URL']
7
- one_message_per_file_markdown('target/lcov.info', ENV['PRONTO_RUSTCOV_URL'])
8
- else
9
- one_message_per_file('target/lcov.info')
10
- end
6
+ one_message_per_file('target/lcov.info')
11
7
  end
12
8
 
13
9
  def messages_limit
14
- ENV['PRONTO_RUSTCOV_MESSAGES_LIMIT']&.to_i || 10
15
- end
16
-
17
- def one_message_per_file_markdown(lcov_path, base_url)
18
- base_url = base_url.delete_suffix('/')
19
-
20
- return [] unless @patches
21
-
22
- lcov = parse_lcov(lcov_path)
23
-
24
- grouped = Hash.new { |h, k| h[k] = [] }
25
-
26
- @patches.sort_by { |patch| -patch.added_lines.count }.take(messages_limit).each do |patch|
27
- next unless patch.added_lines.any?
28
- file_path = patch.new_file_full_path.to_s
29
- uncovered = lcov[file_path]
30
- next unless uncovered
31
-
32
- patch.added_lines.each do |line|
33
- if uncovered.include?(line.new_lineno)
34
- grouped[patch].push(line)
35
- end
36
- end
37
- end
38
-
39
- grouped.map do |patch, lines|
40
- linenos = lines.map(&:new_lineno).sort
41
- ranges = linenos.chunk_while { |i, j| j == i + 1 }
42
- .map { |group| group.size > 1 ? "#{group.first}–#{group.last}" : group.first.to_s }
43
-
44
- url = "#{base_url}/#{patch.new_file_path}.html#L#{linenos.first}"
45
- first_range_link = "[#{ranges.first}](#{url})"
46
- message_text = "⚠️ Test coverage is missing for lines: #{first_range_link}, #{ranges[1..].join(', ')}"
47
-
48
- # Attach the message to the first uncovered line
49
- Pronto::Message.new(
50
- patch.new_file_path,
51
- lines.first,
52
- :warning,
53
- message_text,
54
- nil,
55
- self.class
56
- )
57
- end
10
+ ENV['PRONTO_RUSTCOV_MESSAGES_LIMIT']&.to_i || 5
58
11
  end
59
12
 
60
13
  def one_message_per_file(lcov_path)
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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis