misra: fix problems when executing premium addon
This commit is contained in:
parent
843f7893d6
commit
9b807ba047
|
@ -10,6 +10,8 @@ import argparse
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
import pathlib
|
||||
except ImportError:
|
||||
|
@ -1390,6 +1392,6 @@ def get_path_premium_addon():
|
|||
|
||||
def cmd_output(cmd):
|
||||
try:
|
||||
return subprocess.check_output([self.path_premium_addon, '--cli', '--get-rule-text=' + errorId]).strip().decode('ascii')
|
||||
return subprocess.check_output(cmd).strip().decode('ascii')
|
||||
except subprocess.CalledProcessError as e:
|
||||
return e.output
|
||||
|
|
|
@ -25,7 +25,6 @@ import argparse
|
|||
import codecs
|
||||
import string
|
||||
import copy
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
from itertools import izip as zip
|
||||
|
@ -4400,7 +4399,7 @@ class MisraChecker:
|
|||
|
||||
# Premium MISRA checking, deep analysis
|
||||
if cfgNumber == 0 and self.path_premium_addon:
|
||||
subprocess.cmd_output([self.path_premium_addon, '--cli', '--misra', dumpfile])
|
||||
cppcheckdata.cmd_output([self.path_premium_addon, '--cli', '--misra', dumpfile])
|
||||
|
||||
def analyse_ctu_info(self, ctu_info_files):
|
||||
all_typedef_info = []
|
||||
|
@ -4665,7 +4664,7 @@ def main():
|
|||
premium_command = [checker.path_premium_addon, '--misra', '--file-list', args.file_list]
|
||||
if args.cli:
|
||||
premium_command.append('--cli')
|
||||
for line in subprocess.cmd_output(premium_command).split('\n'):
|
||||
for line in cppcheckdata.cmd_output(premium_command).split('\n'):
|
||||
if re.search(r'"errorId".*:.*"misra-', line) is not None:
|
||||
print(line.strip())
|
||||
|
||||
|
|
Loading…
Reference in New Issue