single_cov 1.1.0 → 1.2.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.
- checksums.yaml +4 -4
- data/lib/single_cov.rb +11 -1
- data/lib/single_cov/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 310e80976c5b117b3cfa36b082ca4c2b3fdbaf55733891cb450c33bc9b28636e
|
4
|
+
data.tar.gz: f50cc1ddb095a99ff9d0b2f9aba410ec02dddf499895dae228b252a728eb2d55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d1741d4b3823b2c3d703ab400a4a11f6738321a73c0463aa5590cdd1a2bd1fe97e31c561e1d8745f75908f4bef62bcc4916242ff76c18b633b64de8fa29b1e6
|
7
|
+
data.tar.gz: 8566b0b3f4a36ba63849bbbb0ca51f13c3e4e23820ff155213563fded10915441d5be66137b5c4e44fa7c01a33fe7209a2c39cc8d0c1a900f186cc24b1d9696e
|
data/lib/single_cov.rb
CHANGED
@@ -3,6 +3,7 @@ module SingleCov
|
|
3
3
|
MAX_OUTPUT = 40
|
4
4
|
APP_FOLDERS = ["models", "serializers", "helpers", "controllers", "mailers", "views", "jobs", "channels"]
|
5
5
|
BRANCH_COVERAGE_SUPPORTED = (RUBY_VERSION >= "2.5.0")
|
6
|
+
UNCOVERED_COMMENT_MARKER = "uncovered"
|
6
7
|
|
7
8
|
class << self
|
8
9
|
# optionally rewrite the file we guessed with a lambda
|
@@ -31,9 +32,18 @@ module SingleCov
|
|
31
32
|
|
32
33
|
next if uncovered.size == expected_uncovered
|
33
34
|
|
35
|
+
# ignore lines that are marked as uncovered via comments
|
36
|
+
# NOTE: ideally we should also warn when using uncovered but the section is indeed covered
|
37
|
+
content = File.readlines(file)
|
38
|
+
uncovered.reject! do |line_start, _, _, _|
|
39
|
+
content[line_start - 1].include?(UNCOVERED_COMMENT_MARKER)
|
40
|
+
end
|
41
|
+
|
42
|
+
next if uncovered.size == expected_uncovered
|
43
|
+
|
34
44
|
# branches are unsorted and added to the end, only sort when necessary
|
35
45
|
if branch_coverage
|
36
|
-
uncovered.sort_by! { |line_start, char_start,
|
46
|
+
uncovered.sort_by! { |line_start, char_start, _, _| [line_start, char_start || 0] }
|
37
47
|
end
|
38
48
|
|
39
49
|
uncovered.map! do |line_start, char_start, line_end, char_end|
|
data/lib/single_cov/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_cov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|