misra.py: better handling of --get-rule-text

This commit is contained in:
Daniel Marjamäki 2022-07-08 14:06:13 +02:00
parent c6f7b7db02
commit 48738c22eb
1 changed files with 2 additions and 1 deletions

View File

@ -4062,8 +4062,9 @@ class MisraChecker:
errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
if self.path_premium_addon:
for line in cppcheckdata.cmd_output([self.path_premium_addon, '--cli', '--get-rule-text=' + errorId]).split('\n'):
if not line.startswith('{'):
if len(line) > 1 and not line.startswith('{'):
errmsg = line
break
else:
errmsg = 'misra violation %s with no text in the supplied rule-texts-file' % (ruleNum)