@@ -37,23 +37,26 @@ class Annotations(Linter):
3737
3838 cmd = None
3939 line_col_base = (0 , 0 )
40- regex = re .compile (r'^(?P<line>\d+):(?P<col>\d+):'
41- r' (warning \((?P<warning>.+?)\)|error \((?P<error>.+?)\)):'
42- r' (?P<message>.*)' )
40+ regex = (
41+ r'^(?P<line>\d+):(?P<col>\d+):'
42+ r' (?P<error_type>.+?) \((?P<code>.+)\):'
43+ r' (?P<message>.*)'
44+ )
4345
4446 # We use this to do the matching
45- mark_regex_template = r'(?:(?P<warning>{warnings})|(?P<error>{errors})):?\s*(?P<message>.*)'
47+ mark_regex_template = r'(?:(?P<info>{infos})|(?P< warning>{warnings})|(?P<error>{errors})):?\s*(?P<message>.*)'
4648
4749 # Words to look for
4850 defaults = {
4951 'selector' : '' , # select all views
50- 'errors' : ['FIXME' ],
51- 'warnings' : ['NOTE' , 'README' , 'TODO' , '@todo' , 'XXX' , 'WIP' ],
52+ 'errors' : ['FIXME' , 'ERROR' ],
53+ 'warnings' : ['TODO' , '@todo' , 'XXX' , 'WIP' , 'WARNING' ],
54+ 'infos' : ['NOTE' , 'README' , 'INFO' ],
5255 }
5356
5457 def run (self , cmd , code ):
5558 options = {}
56- for option in ('errors' , 'warnings' ):
59+ for option in ('errors' , 'warnings' , 'infos' ):
5760 words = self .settings .get (option )
5861 options [option ] = '|' .join (_escape_words (words ))
5962
@@ -79,7 +82,11 @@ def run(self, cmd, code):
7982 error_type = ERROR
8083 else :
8184 word = match .group ('warning' )
82- error_type = WARNING
85+ if word :
86+ error_type = WARNING
87+ else :
88+ word = match .group ('info' )
89+ error_type = 'info'
8390
8491 output .append ('{row}:{col}: {error_type} ({word}): {message}'
8592 .format (** locals ()))
0 commit comments