undercover 0.6.2 → 0.6.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 +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/.tool-versions +1 -1
- data/CHANGELOG.md +13 -1
- data/lib/undercover/cli.rb +0 -1
- data/lib/undercover/options.rb +26 -13
- data/lib/undercover/result.rb +10 -4
- data/lib/undercover/version.rb +1 -1
- data/lib/undercover.rb +1 -2
- data/undercover.gemspec +2 -1
- metadata +19 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a3601cf9aa4d26cee9c04f12b44273f8a67e0e8584b020e4e9bb763e03bf24e
|
4
|
+
data.tar.gz: 8198c30de2bc16734a1575b7aa0213c25ccafe120848dad9c24257d688b7bca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6a60fad9a478c37895ae24035022a9acf86f789ce0d798194b6d13b82c7db52c9de6590a9a9d3b8a84d304f220a30ef2c8e5226bab6fa58cea96f09c3856ca
|
7
|
+
data.tar.gz: fd1ca272d59b29debe708bd2f8df2bf867dccc60484416002dbf004d21ea83370e408e7703098f8d6e2ff0345d2234a7e662f94254a7dcc339f7370bae9f9885
|
data/.github/workflows/ruby.yml
CHANGED
@@ -5,7 +5,7 @@ jobs:
|
|
5
5
|
runs-on: ubuntu-latest
|
6
6
|
strategy:
|
7
7
|
matrix:
|
8
|
-
ruby: ['3.
|
8
|
+
ruby: ['3.4', '3.0']
|
9
9
|
steps:
|
10
10
|
- uses: actions/checkout@v4
|
11
11
|
with:
|
@@ -33,7 +33,7 @@ jobs:
|
|
33
33
|
steps:
|
34
34
|
- uses: actions/download-artifact@v4
|
35
35
|
with:
|
36
|
-
name: undercover-3.
|
36
|
+
name: undercover-3.4.lcov
|
37
37
|
- name: Upload coverage
|
38
38
|
run: |
|
39
39
|
ruby -e "$(curl -s https://undercover-ci.com/uploader.rb)" -- \
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 3.
|
1
|
+
ruby 3.4.2
|
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.6.4] - 2025-03-29
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- Fix more false positives due to source file / coverage locator issues ([#222](https://github.com/grodowski/undercover/issues/222))
|
13
|
+
|
14
|
+
# [0.6.3] - 2024-12-23
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Fix false positives with empty blocks/methods on a single line ([#216](https://github.com/grodowski/undercover/issues/216)) by [@splattael](https://github.com/splattael).
|
18
|
+
- Updated list of default excluded directories (added `db/` and `config/`)
|
19
|
+
|
9
20
|
# [0.6.0] - 2024-12-12
|
10
21
|
### Added
|
11
22
|
- Add support for including and exluding files by glob patterns, supplied through CLI args and the configuration file (#146)
|
@@ -137,7 +148,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
137
148
|
### Added
|
138
149
|
- First release of `undercover` 🎉
|
139
150
|
|
140
|
-
[Unreleased]: https://github.com/grodowski/undercover/compare/v0.6.
|
151
|
+
[Unreleased]: https://github.com/grodowski/undercover/compare/v0.6.3...HEAD
|
152
|
+
[0.6.3]:https://github.com/grodowski/undercover/compare/v0.6.3...v0.6.0
|
141
153
|
[0.6.0]: https://github.com/grodowski/undercover/compare/v0.6.0...v0.5.0
|
142
154
|
[0.5.0]: https://github.com/grodowski/undercover/compare/v0.4.7...v0.5.0
|
143
155
|
[0.4.7]: https://github.com/grodowski/undercover/compare/v0.4.6...v0.4.7
|
data/lib/undercover/cli.rb
CHANGED
data/lib/undercover/options.rb
CHANGED
@@ -5,34 +5,47 @@ require 'pathname'
|
|
5
5
|
|
6
6
|
module Undercover
|
7
7
|
class Options # rubocop:disable Metrics/ClassLength
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
|
12
|
-
#
|
8
|
+
DIFF_TRIGGER_MODE = [
|
9
|
+
# Default, analyse all code blocks with changed lines. Untested lines and branches will trigger warnings if they
|
10
|
+
# strictly belong to the diff.
|
11
|
+
DIFF_TRIGGER_LINE = :diff_trigger_line,
|
12
|
+
#
|
13
|
+
# Doesn't exist yet
|
14
|
+
# Analyse all code blocks with changed lines. Untested lines and branches always trigger warnings for code block.
|
15
|
+
# DIFF_TRIGGER_BLOCK = :diff_trigger_block,
|
16
|
+
# Analyse all code blocks in each changed file.
|
17
|
+
# DIFF_TRIGGER_FILE = :diff_trigger_file,
|
18
|
+
# Analyse all code blocks in all files, ignores current diff (use --include-files and --exclude-files for control)
|
19
|
+
# ALL = :all,
|
13
20
|
].freeze
|
14
21
|
|
15
|
-
|
16
|
-
|
17
|
-
#
|
22
|
+
FILE_SCOPE = [
|
23
|
+
# Extended scope helps identify Ruby files that are not required in the test suite.
|
24
|
+
# Warning: currently doesn't respect :nocov: syntax in files not traced by SimpleCov.
|
25
|
+
# (use --include-files and --exclude-files for control)
|
26
|
+
FILE_SCOPE_EXTENDED = :scope_extended,
|
27
|
+
#
|
28
|
+
# Doesn't exist yet
|
29
|
+
# Analyse file that appear in coverage reports. Historically, the default undercover mode.
|
30
|
+
# FILE_SCOPE_COVERAGE = :scope_coverage,
|
18
31
|
].freeze
|
19
32
|
|
20
33
|
DEFAULT_FILE_INCLUDE_GLOBS = %w[*.rb *.rake *.ru Rakefile].freeze
|
21
|
-
DEFAULT_FILE_EXCLUDE_GLOBS = %w[test/* spec/* db/* *_test.rb *_spec.rb].freeze
|
34
|
+
DEFAULT_FILE_EXCLUDE_GLOBS = %w[test/* spec/* db/* config/* *_test.rb *_spec.rb].freeze
|
22
35
|
|
23
36
|
attr_accessor :lcov,
|
24
37
|
:path,
|
25
38
|
:git_dir,
|
26
39
|
:compare,
|
27
40
|
:syntax_version,
|
41
|
+
:run_mode,
|
42
|
+
:file_scope,
|
28
43
|
:glob_allow_filters,
|
29
44
|
:glob_reject_filters
|
30
45
|
|
31
46
|
def initialize
|
32
|
-
|
33
|
-
|
34
|
-
@run_mode = RUN_MODE_DIFF_STRICT
|
35
|
-
@enabled_formatters = [OUTPUT_STDOUT]
|
47
|
+
@run_mode = DIFF_TRIGGER_LINE
|
48
|
+
@file_scope = FILE_SCOPE_EXTENDED
|
36
49
|
# set defaults
|
37
50
|
self.path = '.'
|
38
51
|
self.git_dir = '.git'
|
data/lib/undercover/result.rb
CHANGED
@@ -10,10 +10,16 @@ module Undercover
|
|
10
10
|
|
11
11
|
def_delegators :node, :first_line, :last_line, :name
|
12
12
|
|
13
|
-
def initialize(node, file_cov, file_path)
|
13
|
+
def initialize(node, file_cov, file_path) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
14
14
|
@node = node
|
15
15
|
@coverage = file_cov.select do |ln, _|
|
16
|
-
|
16
|
+
if first_line == last_line
|
17
|
+
ln == first_line
|
18
|
+
elsif node.empty_def? || node.is_a?(Imagen::Node::Block)
|
19
|
+
ln >= first_line && ln <= last_line # rubocop:disable Style/ComparableBetween
|
20
|
+
else
|
21
|
+
ln > first_line && ln < last_line
|
22
|
+
end
|
17
23
|
end
|
18
24
|
@file_path = file_path
|
19
25
|
@flagged = false
|
@@ -92,11 +98,11 @@ module Undercover
|
|
92
98
|
Rainbow(' hits: n/a').italic.darkgray.dark
|
93
99
|
elsif covered.positive?
|
94
100
|
Rainbow(formatted_line).green +
|
95
|
-
Rainbow(" hits: #{covered}").italic.darkgray.dark +
|
101
|
+
Rainbow(" hits: #{covered}").italic.darkgray.dark +
|
96
102
|
count_covered_branches(num)
|
97
103
|
elsif covered.zero?
|
98
104
|
Rainbow(formatted_line).red +
|
99
|
-
Rainbow(" hits: #{covered}").italic.darkgray.dark +
|
105
|
+
Rainbow(" hits: #{covered}").italic.darkgray.dark +
|
100
106
|
count_covered_branches(num)
|
101
107
|
end
|
102
108
|
end.join("\n")
|
data/lib/undercover/version.rb
CHANGED
data/lib/undercover.rb
CHANGED
@@ -107,8 +107,7 @@ module Undercover
|
|
107
107
|
return if root_ast.children.empty?
|
108
108
|
|
109
109
|
loaded_files[key] = []
|
110
|
-
|
111
|
-
root_ast.children[0].find_all(->(_) { true }).each do |imagen_node|
|
110
|
+
root_ast.find_all(->(node) { !node.is_a?(Imagen::Node::Root) }).each do |imagen_node|
|
112
111
|
loaded_files[key] << Result.new(imagen_node, coverage, filepath)
|
113
112
|
end
|
114
113
|
end
|
data/undercover.gemspec
CHANGED
@@ -27,8 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.required_ruby_version = '>= 3.0.0'
|
29
29
|
|
30
|
+
spec.add_dependency 'base64'
|
30
31
|
spec.add_dependency 'bigdecimal'
|
31
32
|
spec.add_dependency 'imagen', '>= 0.2.0'
|
32
33
|
spec.add_dependency 'rainbow', '>= 2.1', '< 4.0'
|
33
|
-
spec.add_dependency 'rugged', '>= 0.27', '< 1.
|
34
|
+
spec.add_dependency 'rugged', '>= 0.27', '< 1.10'
|
34
35
|
end
|
metadata
CHANGED
@@ -1,15 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: undercover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Grodowski
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: base64
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
13
26
|
- !ruby/object:Gem::Dependency
|
14
27
|
name: bigdecimal
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +80,7 @@ dependencies:
|
|
67
80
|
version: '0.27'
|
68
81
|
- - "<"
|
69
82
|
- !ruby/object:Gem::Version
|
70
|
-
version: '1.
|
83
|
+
version: '1.10'
|
71
84
|
type: :runtime
|
72
85
|
prerelease: false
|
73
86
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,8 +90,7 @@ dependencies:
|
|
77
90
|
version: '0.27'
|
78
91
|
- - "<"
|
79
92
|
- !ruby/object:Gem::Version
|
80
|
-
version: '1.
|
81
|
-
description:
|
93
|
+
version: '1.10'
|
82
94
|
email:
|
83
95
|
- jgrodowski@gmail.com
|
84
96
|
executables:
|
@@ -121,7 +133,6 @@ licenses:
|
|
121
133
|
- MIT
|
122
134
|
metadata:
|
123
135
|
rubygems_mfa_required: 'true'
|
124
|
-
post_install_message:
|
125
136
|
rdoc_options: []
|
126
137
|
require_paths:
|
127
138
|
- lib
|
@@ -136,8 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
147
|
- !ruby/object:Gem::Version
|
137
148
|
version: '0'
|
138
149
|
requirements: []
|
139
|
-
rubygems_version: 3.
|
140
|
-
signing_key:
|
150
|
+
rubygems_version: 3.6.2
|
141
151
|
specification_version: 4
|
142
152
|
summary: Actionable code coverage - detects untested code blocks in recent changes
|
143
153
|
test_files: []
|