File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ class Annotations(Linter):
46
46
cmd = None
47
47
48
48
# 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
+ )
50
53
51
54
# Words to look for
52
55
defaults = {
@@ -81,11 +84,11 @@ def find_errors(self, output):
81
84
lines = region_text .splitlines (keepends = True )
82
85
offsets = accumulate (chain ([region .a ], map (len , lines )))
83
86
for line , offset in zip (lines , offsets ):
84
- match = mark_regex .search (line )
87
+ match = mark_regex .search (line . rstrip () )
85
88
if not match :
86
89
continue
87
90
88
- message = match .group ('message' ). strip () or '<no message>'
91
+ message = match .group ('message' ) or '<no message>'
89
92
word = match .group ('word' )
90
93
error_type = next (et for et in ('error' , 'warning' , 'info' ) if match .group (et ))
91
94
You can’t perform that action at this time.
0 commit comments