File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,15 @@ def add_plugin_options(parent: argparse.ArgumentParser) -> None:
18
18
),
19
19
)
20
20
21
+ parser .add_argument (
22
+ '--list-all-plugins' ,
23
+ action = 'store_true' ,
24
+ help = 'Lists all plugins that will be used for the scan.' ,
25
+ )
26
+
21
27
_add_custom_plugins (parser )
22
28
_add_custom_limits (parser )
23
29
_add_disable_flag (parser )
24
- # TODO: custom plugins?
25
30
26
31
27
32
def _add_custom_plugins (parser : argparse ._ArgumentGroup ) -> None :
Original file line number Diff line number Diff line change 15
15
from .core .secrets_collection import SecretsCollection
16
16
from .core .usage import ParserBuilder
17
17
from .exceptions import InvalidBaselineError
18
+ from .settings import get_settings
18
19
19
20
20
21
def main (argv : Optional [List [str ]] = None ) -> int :
@@ -38,6 +39,12 @@ def parse_args(argv: Optional[List[str]] = None) -> argparse.Namespace:
38
39
39
40
40
41
def handle_scan_action (args : argparse .Namespace ) -> None :
42
+ if args .list_all_plugins :
43
+ # NOTE: If there was a baseline provided, it would already have been parsed and
44
+ # settings populated by the time it reaches here.
45
+ print ('\n ' .join (get_settings ().plugins ))
46
+ return
47
+
41
48
if args .string :
42
49
line = args .string
43
50
if isinstance (args .string , bool ):
Original file line number Diff line number Diff line change @@ -163,6 +163,13 @@ def test_only_displays_result_if_actual_secret():
163
163
assert not output ['results' ]
164
164
165
165
166
+ def test_list_all_plugins ():
167
+ with mock_printer (main_module ) as printer :
168
+ assert main_module .main (['scan' , '--list-all-plugins' ]) == 0
169
+
170
+ assert printer .message
171
+
172
+
166
173
@contextmanager
167
174
def mock_stdin (response = None ):
168
175
if not response :
You can’t perform that action at this time.
0 commit comments