def __parse_line(self, regex):
"""Parse a GNATprove message line.
Adds the message to the current database session.
Retrieves following information:
* source basename
* line in source
* rule identification
* message description
:param re.RegexObject regex: the result of the _MESSAGE regex
"""
filename = regex.group('file')
src = GNAThub.Project.source_file(filename)
line = regex.group('line')
column = regex.group('column')
message = regex.group('message')
msg_id = regex.group('msg_id')
category = regex.group('category').lower()
record = self.msg_ids.get((filename, int(msg_id)))
if record is None:
self.log.warn(
'%s: failed to get record for msg_id #%s', filename, msg_id)
return
rule_id = record['rule'].lower()
self.__add_message(src, line, column, rule_id, message, category)
评论列表
文章目录