File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -450,16 +450,17 @@ def main():
450
450
args .confidence = 4
451
451
# Other strings will be blocked by argparse
452
452
453
- try :
454
- b_conf = b_config .BanditConfig (config_file = args .config_file )
455
- except utils .ConfigError as e :
456
- LOG .error (e )
457
- sys .exit (2 )
458
-
459
453
# Handle .bandit files in projects to pass cmdline args from file
460
454
ini_options = _get_options_from_ini (args .ini_path , args .targets )
461
455
if ini_options :
462
456
# prefer command line, then ini file
457
+ args .config_file = _log_option_source (
458
+ parser .get_default ("configfile" ),
459
+ args .config_file ,
460
+ ini_options .get ("configfile" ),
461
+ "config file" ,
462
+ )
463
+
463
464
args .excluded_paths = _log_option_source (
464
465
parser .get_default ("excluded_paths" ),
465
466
args .excluded_paths ,
@@ -592,6 +593,12 @@ def main():
592
593
"path of a baseline report" ,
593
594
)
594
595
596
+ try :
597
+ b_conf = b_config .BanditConfig (config_file = args .config_file )
598
+ except utils .ConfigError as e :
599
+ LOG .error (e )
600
+ sys .exit (2 )
601
+
595
602
if not args .targets :
596
603
parser .print_usage ()
597
604
sys .exit (2 )
You can’t perform that action at this time.
0 commit comments