pronto-rustcov 0.1.0

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 +7 -0
  2. data/lib/pronto/rustcov.rb +54 -0
  3. metadata +58 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6dc94a4e6bb3722f1284103d67fdfaff10fe3cc8a185a60442bf9d30d324d375
4
+ data.tar.gz: 44229237d9c91ccbb8b358f3f340a22ccd4b633d081f354133528ffd31b64219
5
+ SHA512:
6
+ metadata.gz: 170b1b4577ac500787c55be2d29043e7ed80b36aa31cc4b5e4f9621f2b947acb2812c4a13a74174fb82ee2437f0e5c5b58a523bac8bfa9be4500f6ba167a8769
7
+ data.tar.gz: 133ebf3b947480174cb1b5dc1c0b43642989650b8bce72db8fa918a1d8274d44f337d5eb0a1ee3afda95e26d7a5d4b6e0e555c61122abd2a89c8c7b433ff1b4b
@@ -0,0 +1,54 @@
1
+ require 'pronto'
2
+
3
+ module Pronto
4
+ class Rustcov < Runner
5
+ def run
6
+ return [] unless @patches
7
+
8
+ lcov = parse_lcov('target/lcov.info')
9
+ messages = []
10
+
11
+ @patches.each do |patch|
12
+ next unless patch.additions.any?
13
+ file_path = patch.new_file_full_path.to_s
14
+ uncovered = lcov[file_path]
15
+ next unless uncovered
16
+
17
+ patch.added_lines.each do |line|
18
+ if uncovered.include?(line.new_lineno)
19
+ messages << Message.new(
20
+ patch.new_file_path,
21
+ line,
22
+ :warning,
23
+ "⚠️ Line #{line.new_lineno} is not covered by tests.",
24
+ nil,
25
+ self.class
26
+ )
27
+ end
28
+ end
29
+ end
30
+
31
+ messages
32
+ end
33
+
34
+ private
35
+
36
+ def parse_lcov(path)
37
+ uncovered = Hash.new { |h, k| h[k] = [] }
38
+ file = nil
39
+
40
+ File.foreach(path) do |line|
41
+ case line
42
+ when /^SF:(.+)/
43
+ file = File.expand_path($1.strip)
44
+ when /^DA:(\d+),0$/
45
+ uncovered[file] << $1.to_i if file
46
+ when /^end_of_record/
47
+ file = nil
48
+ end
49
+ end
50
+
51
+ uncovered
52
+ end
53
+ end
54
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pronto-rustcov
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pavel Lazureykis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pronto
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.11.0
27
+ description: This gem integrates Rust test coverage with Pronto via LCOV.
28
+ email:
29
+ - pavel@lazureykis.dev
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/pronto/rustcov.rb
35
+ homepage: https://github.com/lazureykis/pronto-rustcov
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '2.7'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.5.16
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Pronto runner for Rust LCOV coverage
58
+ test_files: []