uncov 0.4.2 → 0.6.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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uncov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Papis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-10 00:00:00.000000000 Z
11
+ date: 2025-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '3.1'
34
34
  type: :runtime
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.0'
40
+ version: '3.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: git_diff_parser
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pluginator
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.5'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.5'
83
97
  description: uncov compares your current branch with a target branch, identifies changed
84
98
  files, and reports on test coverage for those changes
85
99
  email:
@@ -95,6 +109,13 @@ files:
95
109
  - PHILOSOPHY.md
96
110
  - README.md
97
111
  - bin/uncov
112
+ - lib/plugins/uncov/formatter/terminal.rb
113
+ - lib/plugins/uncov/report/filters/diff_files.rb
114
+ - lib/plugins/uncov/report/filters/diff_lines.rb
115
+ - lib/plugins/uncov/report/filters/file_system.rb
116
+ - lib/plugins/uncov/report/filters/git_files.rb
117
+ - lib/plugins/uncov/report/filters/nocov_lines.rb
118
+ - lib/plugins/uncov/report/filters/simplecov.rb
98
119
  - lib/uncov.rb
99
120
  - lib/uncov/cache.rb
100
121
  - lib/uncov/cli.rb
@@ -102,18 +123,18 @@ files:
102
123
  - lib/uncov/configuration/option.rb
103
124
  - lib/uncov/finder.rb
104
125
  - lib/uncov/finder/file_system.rb
126
+ - lib/uncov/finder/files.rb
105
127
  - lib/uncov/finder/git.rb
106
128
  - lib/uncov/finder/git_base.rb
107
129
  - lib/uncov/finder/git_diff.rb
108
- - lib/uncov/finder/no_cov.rb
109
- - lib/uncov/finder/simple_cov.rb
130
+ - lib/uncov/finder/nocov.rb
131
+ - lib/uncov/finder/simplecov.rb
110
132
  - lib/uncov/formatter.rb
111
- - lib/uncov/formatter/terminal.rb
112
133
  - lib/uncov/report.rb
113
134
  - lib/uncov/report/context.rb
114
- - lib/uncov/report/diff_lines.rb
115
135
  - lib/uncov/report/file.rb
116
136
  - lib/uncov/report/file/line.rb
137
+ - lib/uncov/report/filters.rb
117
138
  - lib/uncov/struct.rb
118
139
  - lib/uncov/version.rb
119
140
  homepage: https://github.com/mpapis/uncov
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # report only files lines from the diff
4
- module Uncov::Report::DiffLines
5
- class << self
6
- def files(finder)
7
- finder.git_diff_file_names.map do |file_name|
8
- Uncov::Report::File.new(
9
- file_name:,
10
- git: true,
11
- lines: lines(finder, file_name)
12
- )
13
- end
14
- end
15
-
16
- private
17
-
18
- def lines(finder, file_name)
19
- lines_hash = git_diff_files_lines(finder, file_name)
20
- add_context(finder, file_name, lines_hash)
21
- lines_hash.sort.to_h.values
22
- end
23
-
24
- def git_diff_files_lines(finder, file_name)
25
- finder.git_diff_file_lines(file_name).keys.to_h do |line_number|
26
- [line_number, new_line(finder, file_name, line_number)]
27
- end
28
- end
29
-
30
- def add_context(finder, file_name, lines_hash)
31
- return if Uncov.configuration.context.zero?
32
-
33
- line_numbers =
34
- lines_hash.filter_map do |line_number, line|
35
- line_number if line.uncov?
36
- end
37
- all_line_numbers = finder.file_system_file_lines(file_name).keys
38
- context_line_numbers = Uncov::Report::Context.calculate(all_line_numbers, line_numbers, Uncov.configuration.context)
39
- context_line_numbers.each do |line_number|
40
- context_line(finder, file_name, lines_hash, line_number)
41
- end
42
- end
43
-
44
- def context_line(finder, file_name, lines_hash, line_number)
45
- if lines_hash.key?(line_number)
46
- lines_hash[line_number].context = true
47
- else
48
- lines_hash[line_number] = new_line(finder, file_name, line_number, context: true)
49
- end
50
- end
51
-
52
- def new_line(finder, file_name, line_number, context: false)
53
- Uncov::Report::File::Line.new(
54
- number: line_number,
55
- content: finder.file_system_file_line(file_name, line_number),
56
- no_cov: finder.no_cov_file_line?(file_name, line_number),
57
- simple_cov: finder.simple_cov_file_line?(file_name, line_number),
58
- git_diff: finder.git_diff_file_line?(file_name, line_number),
59
- context:
60
- )
61
- end
62
- end
63
- end