pronto-rustcov 0.1.9 → 0.1.11

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +92 -0
  3. data/lib/pronto/rustcov.rb +5 -4
  4. metadata +10 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aad469c0aeb544cb4bd49065731799cc6303a462833d143d77e9a0c805d8ef5
4
- data.tar.gz: df7c0823144b3708ef7f022d7748f5b8afd72532340679f73d92c75708e454ff
3
+ metadata.gz: 0d98a422f875578d4d6033ed040d09abd277f8f206f9387ae67cbb4813571c43
4
+ data.tar.gz: dccc38ff3b52e5dd8d9ea2bd97e3cd8b802481e64fa3a58c4e8f1b8024a782fe
5
5
  SHA512:
6
- metadata.gz: 68ead906857eb7354e322342b9d0da8396192918275e11fdcff7bbc1f8a2e11880d2a16cdea439638c6043a439cd96f061930462bb16d7d97840f348d7570779
7
- data.tar.gz: 417627cb6fa45276eec6b0507b36b54ad7e30da897a367cd8f78d14ea541d0a917231f133c22d97b93f7ce832322d6b509423a9eabc9e822205c39c9396455a4
6
+ metadata.gz: c4615aac5acedd17b7449c7577b3d4e03ff3b12cb7ad320481f93ced5ccd05ac09107b39c3dddeacd8f9ea32d4bd4e51a19426b1504a6a08db6631ae548f2940
7
+ data.tar.gz: f8df283bd331a5b4eadcd86ca52cd023f24680df9a214ee8c8552061e2ae603a537089656e68c9e4b2c7993736dc80b25e09693acffaaaa30fb2a79b72dae635
data/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # pronto-rustcov
2
+
3
+ ⚡ A [Pronto](https://github.com/prontolabs/pronto) runner that highlights **uncovered Rust lines** in GitHub pull requests using LCOV reports from [`cargo llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov).
4
+
5
+ ## 🔧 Installation
6
+
7
+ Add to your `Gemfile` in the `:development` group:
8
+
9
+ ```ruby
10
+ gem 'pronto-rustcov', group: :development
11
+ ```
12
+
13
+ Then install:
14
+
15
+ ```bash
16
+ bundle install
17
+ ```
18
+
19
+ Alternatively, install the gem globally:
20
+
21
+ ```bash
22
+ gem install pronto-rustcov
23
+ ```
24
+
25
+ ## 🚀 Usage
26
+
27
+ Make sure you've generated an LCOV file using `cargo llvm-cov`:
28
+
29
+ ```bash
30
+ cargo install cargo-llvm-cov
31
+ cargo llvm-cov clean
32
+ cargo llvm-cov --no-report
33
+ cargo llvm-cov report --lcov > target/lcov.info
34
+ ```
35
+
36
+
37
+ ## Github Actions Example
38
+
39
+ ```yaml
40
+ name: Tests
41
+
42
+ permissions:
43
+ contents: read
44
+ pull-requests: write
45
+ checks: write
46
+ statuses: write
47
+
48
+ on:
49
+ pull_request:
50
+ branches:
51
+ - main
52
+
53
+ jobs:
54
+ tests:
55
+ runs-on: ubuntu-latest
56
+
57
+ steps:
58
+ - name: Rust Toolchain Setup
59
+ uses: actions-rust-lang/setup-rust-toolchain@v1
60
+ with:
61
+ components: llvm-tools-preview
62
+
63
+ - uses: ruby/setup-ruby@v1
64
+ with:
65
+ ruby-version: '3.3'
66
+ bundler-cache: true
67
+
68
+ - name: Install rustup component
69
+ uses: taiki-e/install-action@cargo-llvm-cov
70
+
71
+ - name: Run Tests
72
+ run: |
73
+ cargo llvm-cov clean
74
+ cargo llvm-cov --no-report --workspace --no-cfg-coverage --remap-path-prefix
75
+ cargo llvm-cov report --html
76
+ cargo llvm-cov report --lcov > target/lcov.info
77
+
78
+ - name: Run Pronto
79
+ env:
80
+ PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
81
+ PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"
82
+ PRONTO_RUSTCOV_FILES_LIMIT: 3
83
+ PRONTO_RUSTCOV_MESSAGES_PER_FILE_LIMIT: 3
84
+ PRONTO_RUSTCOV_LCOV_PATH: target/lcov.info
85
+ run: |
86
+ gem install pronto pronto-rustcov
87
+ pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
88
+ ```
89
+
90
+ ## 📝 License
91
+
92
+ MIT
@@ -81,10 +81,11 @@ module Pronto
81
81
  end
82
82
 
83
83
  def format_message_text(range)
84
- # Format the range as "start–end" or just the number if it's a single line
85
- formatted_range = range.size > 1 ? "#{range.first}–#{range.last}" : range.first.to_s
86
-
87
- "⚠️ Test coverage is missing for lines: #{formatted_range}"
84
+ if range.size > 1
85
+ "⚠️ Test coverage is missing for lines: #{range.first}–#{range.last}"
86
+ else
87
+ "⚠️ Test coverage is missing"
88
+ end
88
89
  end
89
90
 
90
91
  def parse_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.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis
@@ -14,44 +14,44 @@ dependencies:
14
14
  name: pronto
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.11.0
19
+ version: 0.11.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.11.0
26
+ version: 0.11.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.12'
33
+ version: '3.13'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.12'
40
+ version: '3.13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '13.0'
47
+ version: '13.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '13.0'
54
+ version: '13.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - README.md
76
77
  - lib/pronto/rustcov.rb
77
78
  homepage: https://github.com/lazureykis/pronto-rustcov
78
79
  licenses: