22Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33SPDX-License-Identifier: MIT-0
44"""
5+
56import argparse
67
7- from .lib .reporter import ResourceOrCodeFindingToIgnore , ResourceAndCodeFindingToIgnore , \
8- AllowedExternalArn , AllowedExternalPrincipal
8+ from .lib .reporter import (
9+ ResourceOrCodeFindingToIgnore ,
10+ ResourceAndCodeFindingToIgnore ,
11+ AllowedExternalArn ,
12+ AllowedExternalPrincipal ,
13+ )
914from .tools import regex_patterns
1015
1116
@@ -28,8 +33,8 @@ class ParseFindingsToIgnoreFromCLI(argparse.Action):
2833 a combination of both in the form MyResource.FindingA
2934 """
3035
31- def __call__ (self , _ , namespace , values , option_string = None ):
32- values = values .split (',' )
36+ def __call__ (self , _ , namespace , values , option_string = None ):
37+ values = values .split ("," )
3338
3439 findings_to_ignore = parse_findings_to_ignore (values )
3540
@@ -47,7 +52,9 @@ def parse_findings_to_ignore(values_as_list):
4752 if "." in value :
4853 resource_and_code = value .split ("." , 1 )
4954 # a split must have at least two members of the array, so no need to validate
50- finding_to_ignore = ResourceAndCodeFindingToIgnore (resource_and_code [0 ], resource_and_code [1 ])
55+ finding_to_ignore = ResourceAndCodeFindingToIgnore (
56+ resource_and_code [0 ], resource_and_code [1 ]
57+ )
5158 else :
5259 finding_to_ignore = ResourceOrCodeFindingToIgnore (value )
5360
@@ -63,7 +70,7 @@ class ParseAllowExternalPrincipalsFromCLI(argparse.Action):
6370 """
6471
6572 def __call__ (self , _ , namespace , values , option_string = None ):
66- values = values .split (',' )
73+ values = values .split ("," )
6774
6875 allowed_external_principals = parse_allow_external_principals (values )
6976
@@ -88,10 +95,11 @@ def parse_allow_external_principals(values_as_list):
8895
8996 return allowed_external_principals
9097
98+
9199class ParseListFromCLI (argparse .Action ):
92100 def __call__ (self , _ , namespace , values , option_string = None ):
93- values = values .split (',' )
101+ values = values .split ("," )
94102 if values is None :
95103 setattr (namespace , self .dest , None )
96104 values = [value .strip () for value in values ]
97- setattr (namespace , self .dest , values )
105+ setattr (namespace , self .dest , values )
0 commit comments