undercover 0.8.2 → 0.8.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfcb8604d5d6f2d750c8ef734b36a1d0d84beceb31c999e00b06b653063655b1
4
- data.tar.gz: 7dd446be898392baa898f4ff3329584d11410795334800f923175c8997cfb6f1
3
+ metadata.gz: f86959c16f0b74f14a45569ca4d746650e764eef3b94cc8f10ff341b2900f099
4
+ data.tar.gz: ef70c14d604fa88d59cca1cec6155382eed5360795a6c9c38c3b3d72366e2080
5
5
  SHA512:
6
- metadata.gz: facb61acb2821bd2ac578b35c70e0cc2139f35ff71f196703590821e1430270681d8bcc7b2b596efa7a3ff94862453056664c354afd9c399298120aca22eaa6f
7
- data.tar.gz: 3e30b3515493666b14c5006b084bd023a686b81df6c510adc2bdfb8da496efa086c9560f455443e70bfd32537105b9fd13c3d3a32b4845a67a3614dd9178de89
6
+ metadata.gz: 703e9ea6340101fd7d49368eb07bfd70986f31f7306219f5b3f791383eecf63483db59360716005e528ecdf6aae91e7ce4bb1d3a7d3c5b62dceccb5dde1e85b0
7
+ data.tar.gz: 704e695944e5135f41408bc9fa9f8b27c3213574a884d04a5f8723c7f985d0f309d32c49977d74ced2d21da4b580129419d2971a26fe91c495b4e0246ce4c1ff
@@ -1,13 +1,13 @@
1
1
  name: Ruby
2
- on: [push]
2
+ on: [push, pull_request]
3
3
  jobs:
4
4
  build:
5
5
  runs-on: ubuntu-latest
6
6
  strategy:
7
7
  matrix:
8
- ruby: ['3.4', '3.0']
8
+ ruby: ['4.0', '3.4']
9
9
  steps:
10
- - uses: actions/checkout@v5
10
+ - uses: actions/checkout@v6
11
11
  with:
12
12
  fetch-depth: 0 # fetch all since test fixtures depend on history
13
13
  - name: Set up Ruby ${{ matrix.ruby }}
@@ -23,7 +23,7 @@ jobs:
23
23
  run: |
24
24
  git fetch --update-head-ok origin master:master
25
25
  undercover --simplecov coverage/undercover_coverage.json --compare master
26
- - uses: actions/upload-artifact@v5
26
+ - uses: actions/upload-artifact@v6
27
27
  with:
28
28
  name: undercover-${{ matrix.ruby }}-coverage
29
29
  path: coverage/undercover_coverage.json
@@ -31,12 +31,19 @@ jobs:
31
31
  runs-on: ubuntu-latest
32
32
  needs: build
33
33
  steps:
34
- - uses: actions/download-artifact@v6
34
+ - uses: actions/download-artifact@v7
35
35
  with:
36
- name: undercover-3.4-coverage
36
+ name: undercover-4.0-coverage
37
37
  - name: Upload coverage
38
38
  run: |
39
- ruby -e "$(curl -s https://undercover-ci.com/uploader.rb)" -- \
39
+ output=$(ruby -e "$(curl -s https://undercover-ci.com/uploader.rb)" -- \
40
40
  --repo grodowski/undercover \
41
41
  --commit ${{ github.event.pull_request.head.sha || github.sha }} \
42
- --simplecov /home/runner/work/undercover/undercover/undercover_coverage.json
42
+ --simplecov /home/runner/work/undercover/undercover/undercover_coverage.json 2>&1) || {
43
+ if echo "$output" | grep -q "has already completed"; then
44
+ echo "Coverage already processed for this commit ✅"
45
+ else
46
+ echo "Coverage upload failed: $output"
47
+ exit 1
48
+ fi
49
+ }
data/.tool-versions CHANGED
@@ -1,2 +1,2 @@
1
- ruby 3.4.2
1
+ ruby 4.0.1
2
2
  nodejs v24.4.0
data/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ # [0.8.4] - 2026-02-06
10
+ ### Fixed
11
+ - Print branch coverage even on n/a lines (https://github.com/grodowski/undercover/pull/249) by [@kuahyeow](https://github.com/kuahyeow)
12
+
13
+ ### Added
14
+ - Ruby 4 support in CI
15
+
16
+ # [0.8.3] - 2025-11-20
17
+ ### Fixed
18
+ - Normalize slash prefix in FilterSet support to work with the 'rails' profile (https://github.com/grodowski/undercover/pull/244)
19
+
9
20
  # [0.8.2] - 2025-11-15
10
21
 
11
22
  ### Fixed
@@ -205,7 +216,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
205
216
  ### Added
206
217
  - First release of `undercover` 🎉
207
218
 
208
- [Unreleased]: https://github.com/grodowski/undercover/compare/v0.8.2...HEAD
219
+ [Unreleased]: https://github.com/grodowski/undercover/compare/v0.8.4...HEAD
220
+ [0.8.4]: https://github.com/grodowski/undercover/compare/v0.8.3...v0.8.4
221
+ [0.8.3]: https://github.com/grodowski/undercover/compare/v0.8.2...v0.8.3
209
222
  [0.8.2]: https://github.com/grodowski/undercover/compare/v0.8.1...v0.8.2
210
223
  [0.8.1]: https://github.com/grodowski/undercover/compare/v0.8.0...v0.8.1
211
224
  [0.8.0]: https://github.com/grodowski/undercover/compare/v0.7.4...v0.8.0
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem 'bundler'
9
9
  gem 'pry'
10
10
  gem 'rake', '~> 13.0'
11
11
  gem 'rspec', '~> 3.0'
12
- gem 'rubocop'
12
+ gem 'rubocop', '~> 1.84.0'
13
13
  gem 'ruby-lsp-rspec', require: false
14
14
  gem 'simplecov'
15
15
  gem 'simplecov-html'
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2020 Jan Grodowski
3
+ Copyright (c) 2018-2025 Jan Grodowski
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -26,13 +26,17 @@ module Undercover
26
26
  simplecov_filters.any? do |filter|
27
27
  filter = filter.transform_keys(&:to_sym)
28
28
  if filter[:string]
29
- filepath.include?(filter[:string])
29
+ normalized(filepath).include?(filter[:string])
30
30
  elsif filter[:regex]
31
- filepath.match?(Regexp.new(filter[:regex]))
31
+ normalized(filepath).match?(Regexp.new(filter[:regex]))
32
32
  elsif filter[:file]
33
- filepath == filter[:file]
33
+ filepath == filter[:file] # TODO: check if file also gets a slash?
34
34
  end
35
35
  end
36
36
  end
37
+
38
+ def normalized(filepath)
39
+ filepath.start_with?('/') ? filepath : "/#{filepath}"
40
+ end
37
41
  end
38
42
  end
@@ -3,7 +3,8 @@
3
3
  require 'undercover/root_to_relative_paths'
4
4
 
5
5
  module Undercover
6
- LcovParseError = Class.new(StandardError)
6
+ class LcovParseError < StandardError
7
+ end
7
8
 
8
9
  class LcovParser
9
10
  include RootToRelativePaths
@@ -108,7 +108,8 @@ module Undercover
108
108
  Rainbow(' skipped with :nocov:').italic.darkgray.dark
109
109
  elsif covered.nil?
110
110
  Rainbow(formatted_line).darkgray.dark +
111
- Rainbow(' hits: n/a').italic.darkgray.dark
111
+ Rainbow(' hits: n/a').italic.darkgray.dark +
112
+ count_covered_branches(num)
112
113
  elsif covered.positive?
113
114
  Rainbow(formatted_line).green +
114
115
  Rainbow(" hits: #{covered}").italic.darkgray.dark +
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Undercover
4
- VERSION = '0.8.2'
4
+ VERSION = '0.8.4'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: undercover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Grodowski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-11-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.6.2
181
+ rubygems_version: 4.0.3
182
182
  specification_version: 4
183
183
  summary: Actionable code coverage - detects untested code blocks in recent changes
184
184
  test_files: []