File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/pysonar_scanner/configuration Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 24
24
from pysonar_scanner .exceptions import UnexpectedCliArgument
25
25
26
26
27
+ class PyScannerHelpFormatter (argparse .HelpFormatter ):
28
+ recommended_args = {"help" , "token" , "sonar_project_key" }
29
+
30
+ def _format_actions_usage (self , actions , groups ):
31
+ filtered_actions = [action for action in actions if action .dest in PyScannerHelpFormatter .recommended_args ]
32
+ return super ()._format_actions_usage (filtered_actions , groups )
33
+
34
+
27
35
class CliConfigurationLoader :
28
36
29
37
@classmethod
@@ -59,6 +67,7 @@ def __create_parser(cls):
59
67
parser = argparse .ArgumentParser (
60
68
description = "Sonar scanner CLI for Python" ,
61
69
epilog = "Analysis properties not listed here will also be accepted, as long as they start with the -D prefix." ,
70
+ formatter_class = PyScannerHelpFormatter ,
62
71
)
63
72
64
73
parser .add_argument (
You can’t perform that action at this time.
0 commit comments