forked from cycodehq/cycode-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsca_options.py
More file actions
47 lines (40 loc) · 1.31 KB
/
sca_options.py
File metadata and controls
47 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from pathlib import Path
from typing import Annotated, Optional
import typer
_SCA_RICH_HELP_PANEL = 'SCA options'
NoRestoreOption = Annotated[
bool,
typer.Option(
'--no-restore',
help='When specified, Cycode will not run restore command. Will scan direct dependencies [b]only[/]!',
rich_help_panel=_SCA_RICH_HELP_PANEL,
),
]
GradleAllSubProjectsOption = Annotated[
bool,
typer.Option(
'--gradle-all-sub-projects',
help='When specified, Cycode will run gradle restore command for all sub projects. '
'Should run from root project directory [b]only[/]!',
rich_help_panel=_SCA_RICH_HELP_PANEL,
),
]
MavenSettingsFileOption = Annotated[
Optional[Path],
typer.Option(
'--maven-settings-file',
show_default=False,
help='When specified, Cycode will use this settings.xml file when building the maven dependency tree.',
dir_okay=False,
rich_help_panel=_SCA_RICH_HELP_PANEL,
),
]
def apply_sca_restore_options_to_context(
ctx: typer.Context,
no_restore: bool,
gradle_all_sub_projects: bool,
maven_settings_file: Optional[Path],
) -> None:
ctx.obj['no_restore'] = no_restore
ctx.obj['gradle_all_sub_projects'] = gradle_all_sub_projects
ctx.obj['maven_settings_file'] = maven_settings_file