@@ -1318,7 +1318,7 @@ def __init__(self, settings, stdversion="c89"):
13181318 self ._ctu_summary_identifiers = False
13191319 self ._ctu_summary_usage = False
13201320
1321- self .premium_addon = None
1321+ self .path_premium_addon = None
13221322
13231323 def __repr__ (self ):
13241324 attrs = ["settings" , "verify_expected" , "verify_actual" , "violations" ,
@@ -4048,8 +4048,8 @@ def reportError(self, location, num1, num2):
40484048 misra_severity = self .ruleTexts [ruleNum ].misra_severity
40494049 cppcheck_severity = self .ruleTexts [ruleNum ].cppcheck_severity
40504050 elif len (self .ruleTexts ) == 0 :
4051- if self .premium_addon :
4052- errmsg = subprocess .check_output ([self .premium_addon , '--get-rule-text=' + errorId ]).strip ().decode ('ascii' )
4051+ if self .path_premium_addon :
4052+ errmsg = subprocess .check_output ([self .path_premium_addon , '--get-rule-text=' + errorId ]).strip ().decode ('ascii' )
40534053 else :
40544054 errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
40554055 else :
@@ -4386,8 +4386,8 @@ def fillVerifyExpected(verify_expected, tok):
43864386 self .executeCheck (2210 , self .misra_22_10 , cfg )
43874387
43884388 # Premium MISRA checking, deep analysis
4389- if cfgNumber == 0 and self .premium_addon :
4390- subprocess .call ([self .premium_addon , '--misra' , dumpfile ])
4389+ if cfgNumber == 0 and self .path_premium_addon :
4390+ subprocess .call ([self .path_premium_addon , '--misra' , dumpfile ])
43914391
43924392 def analyse_ctu_info (self , ctu_info_files ):
43934393 all_typedef_info = []
@@ -4572,7 +4572,6 @@ def get_args_parser():
45724572 parser .add_argument ("-generate-table" , help = argparse .SUPPRESS , action = "store_true" )
45734573 parser .add_argument ("-verify" , help = argparse .SUPPRESS , action = "store_true" )
45744574 parser .add_argument ("--severity" , type = str , help = "Set a custom severity string, for example 'error' or 'warning'. " )
4575- parser .add_argument ("--premium-addon" , type = str , default = None , help = argparse .SUPPRESS )
45764575 return parser
45774576
45784577
@@ -4582,7 +4581,7 @@ def main():
45824581 settings = MisraSettings (args )
45834582 checker = MisraChecker (settings )
45844583
4585- checker .premium_addon = args . premium_addon
4584+ checker .path_premium_addon = cppcheckdata . get_path_premium_addon ()
45864585
45874586 if args .generate_table :
45884587 generateTable ()
@@ -4645,8 +4644,8 @@ def main():
46454644
46464645 checker .analyse_ctu_info (ctu_info_files )
46474646
4648- if args .file_list and args . premium_addon :
4649- premium_command = [args . premium_addon , '--misra' , '--file-list' , args .file_list ]
4647+ if args .file_list and checker . path_premium_addon :
4648+ premium_command = [checker . path_premium_addon , '--misra' , '--file-list' , args .file_list ]
46504649 if args .cli :
46514650 premium_command .append ('--cli' )
46524651 for line in subprocess .check_output (premium_command ).decode ('ascii' ).split ('\n ' ):
0 commit comments