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

different matchlabels for local and global coverageIgnore

parent 1226f315
Branches
Tags
No related merge requests found
...@@ -42,28 +42,31 @@ class Annotator(object): ...@@ -42,28 +42,31 @@ 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 = False local_ignore = False
global_ignore = False
matcher_does_nothing = False matcher_does_nothing = False
if match: if match:
if matcher.coverageIgnore: if matcher.coverageIgnore:
ignore = True local_ignore = True
elif matcher.does_nothing: elif matcher.does_nothing:
matcher_does_nothing = True matcher_does_nothing = True
else: else:
m2 = RE_EMPTY.match(line) m2 = RE_EMPTY.match(line)
if m2: if m2:
ignore = True global_ignore = True
match = m2 match = m2
elif self.coverageIgnore is not None: elif self.coverageIgnore is not None:
m2 = self.coverageIgnore.match(line) m2 = self.coverageIgnore.match(line)
if m2: if m2:
ignore = True global_ignore = True
match = m2 match = m2
# setup match label # setup match label
matchlabel = '' matchlabel = ''
if ignore: if local_ignore:
matchlabel = 'ign' matchlabel = 'l_ign'
elif global_ignore:
matchlabel = 'g_ign'
elif match: elif match:
if matcher_does_nothing: if matcher_does_nothing:
matchlabel='n_' matchlabel='n_'
...@@ -73,7 +76,7 @@ class Annotator(object): ...@@ -73,7 +76,7 @@ class Annotator(object):
else: else:
matchlabel = 'no' matchlabel = 'no'
# highlight line # highlight line
if ignore: if local_ignore or global_ignore:
highlighted = self.matchHighlighter.highlight( highlighted = self.matchHighlighter.highlight(
match, line, linecolor=ANSI.FG_BLUE) match, line, linecolor=ANSI.FG_BLUE)
elif matcher_does_nothing: elif matcher_does_nothing:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment