Skip to content
Snippets Groups Projects
Commit f5d21487 authored by Henning Glawe's avatar Henning Glawe
Browse files

classify empty lines as 'ignored' unless explicitly matched

parent e0b03f68
No related branches found
No related tags found
No related merge requests found
import logging import logging
import re
from nomadcore.match_highlighter import MatchHighlighter, ANSI from nomadcore.match_highlighter import MatchHighlighter, ANSI
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
RE_EMPTY = re.compile(r"^\s*$")
class Annotator(object): class Annotator(object):
def __init__(self, annotateFilename=None, coverageIgnore=None, def __init__(self, annotateFilename=None, coverageIgnore=None,
formatNameWidth=15, formatSourceWidth=20): formatNameWidth=15, formatSourceWidth=20):
...@@ -38,7 +42,7 @@ class Annotator(object): ...@@ -38,7 +42,7 @@ class Annotator(object):
return 1 return 1
# classify match # classify match
full = match and match.start() == 0 and match.end() == len(line) full = match and match.start() == 0 and match.end() == len(line)
ignore = not match and self.coverageIgnore.match(line) ignore = not match and (RE_EMPTY.match(line) or self.coverageIgnore.match(line))
# setup match label # setup match label
if match: if match:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment