misra: improved execution of premium addon
This commit is contained in:
parent
40ff9edad6
commit
fb89a2c742
|
@ -4067,7 +4067,10 @@ class MisraChecker:
|
|||
cppcheck_severity = self.ruleTexts[ruleNum].cppcheck_severity
|
||||
elif len(self.ruleTexts) == 0:
|
||||
if self.path_premium_addon:
|
||||
errmsg = subprocess.check_output([self.path_premium_addon, '--get-rule-text=' + errorId]).strip().decode('ascii')
|
||||
errmsg = ''
|
||||
for line in subprocess.check_output([self.path_premium_addon, '--cli', '--get-rule-text=' + errorId]).strip().decode('ascii').split('\n'):
|
||||
if not line.startswith('{'):
|
||||
errmsg = line
|
||||
else:
|
||||
errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
|
||||
else:
|
||||
|
@ -4405,7 +4408,7 @@ class MisraChecker:
|
|||
|
||||
# Premium MISRA checking, deep analysis
|
||||
if cfgNumber == 0 and self.path_premium_addon:
|
||||
subprocess.call([self.path_premium_addon, '--misra', dumpfile])
|
||||
subprocess.check_output([self.path_premium_addon, '--cli', '--misra', dumpfile])
|
||||
|
||||
def analyse_ctu_info(self, ctu_info_files):
|
||||
all_typedef_info = []
|
||||
|
@ -4671,6 +4674,7 @@ def main():
|
|||
if args.cli:
|
||||
premium_command.append('--cli')
|
||||
for line in subprocess.check_output(premium_command).decode('ascii').split('\n'):
|
||||
if re.search(r'"errorId".*:.*"misra-', line) is not None:
|
||||
print(line.strip())
|
||||
|
||||
if settings.verify:
|
||||
|
|
Loading…
Reference in New Issue