Skip to content

Commit e4686c8

Browse files
authored
Don't match newline characters (#37)
1 parent 82fad04 commit e4686c8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

linter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ class Annotations(Linter):
4646
cmd = None
4747

4848
# We use this to do the matching
49-
mark_regex_template = r'(?P<word>(?P<info>{infos})|(?P<warning>{warnings})|(?P<error>{errors})):?\s*(?P<message>.*)'
49+
mark_regex_template = (
50+
r'(?P<word>(?P<info>{infos})|(?P<warning>{warnings})|(?P<error>{errors})):?\s*'
51+
r'(?P<message>.*)'
52+
)
5053

5154
# Words to look for
5255
defaults = {
@@ -81,11 +84,11 @@ def find_errors(self, output):
8184
lines = region_text.splitlines(keepends=True)
8285
offsets = accumulate(chain([region.a], map(len, lines)))
8386
for line, offset in zip(lines, offsets):
84-
match = mark_regex.search(line)
87+
match = mark_regex.search(line.rstrip())
8588
if not match:
8689
continue
8790

88-
message = match.group('message').strip() or '<no message>'
91+
message = match.group('message') or '<no message>'
8992
word = match.group('word')
9093
error_type = next(et for et in ('error', 'warning', 'info') if match.group(et))
9194

0 commit comments

Comments
 (0)