File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ class LinesClassifier
1212 COMMENT_LINE = /^\s *#/ . freeze
1313 WHITESPACE_OR_COMMENT_LINE = Regexp . union ( WHITESPACE_LINE , COMMENT_LINE )
1414
15- def self . no_cov_block
15+ def self . no_cov_line
1616 /^(\s *)#(\s *)(:#{ SimpleCov . nocov_token } :)/o
1717 end
1818
19- def self . no_cov_line
20- /#( \s *)( :#{ SimpleCov . nocov_token } :)( \s *) $/o
19+ def self . no_cov_inline
20+ /\S .*# \s *:#{ SimpleCov . nocov_token } :\s *$/o
2121 end
2222
2323 def self . no_cov_line? ( line )
@@ -27,8 +27,8 @@ def self.no_cov_line?(line)
2727 false
2828 end
2929
30- def self . no_cov_block ?( line )
31- no_cov_block . match? ( line )
30+ def self . no_cov_inline ?( line )
31+ no_cov_inline . match? ( line )
3232 rescue ArgumentError
3333 # E.g., line contains an invalid byte sequence in UTF-8
3434 false
@@ -45,10 +45,10 @@ def classify(lines)
4545 skipping = false
4646
4747 lines . map do |line |
48- if self . class . no_cov_block ?( line )
48+ if self . class . no_cov_line ?( line )
4949 skipping = !skipping
5050 NOT_RELEVANT
51- elsif skipping || self . class . no_cov_line ?( line ) || self . class . whitespace_line? ( line )
51+ elsif skipping || self . class . no_cov_inline ?( line ) || self . class . whitespace_line? ( line )
5252 NOT_RELEVANT
5353 else
5454 RELEVANT
You can’t perform that action at this time.
0 commit comments