Skip to content

Commit af953f3

Browse files
authored
CM-52199 - Fix --gradle-all-sub-projects and --no-restore scan options (#331)
1 parent 51399f3 commit af953f3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cycode/cli/apps/scan/scan_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def scan_command(
155155
ctx.obj['monitor'] = monitor
156156
ctx.obj['maven_settings_file'] = maven_settings_file
157157
ctx.obj['report'] = report
158+
ctx.obj['gradle_all_sub_projects'] = gradle_all_sub_projects
159+
ctx.obj['no_restore'] = no_restore
158160

159161
scan_client = get_scan_cycode_client(ctx)
160162
ctx.obj['client'] = scan_client
@@ -167,8 +169,6 @@ def scan_command(
167169
console_printer = ctx.obj['console_printer']
168170
console_printer.enable_recording(export_type, export_file)
169171

170-
_ = no_restore, gradle_all_sub_projects # they are actually used; via ctx.params
171-
172172
_sca_scan_to_context(ctx, sca_scan)
173173

174174

cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
self.projects = self.get_all_projects() if self.is_gradle_sub_projects() else projects
2828

2929
def is_gradle_sub_projects(self) -> bool:
30-
return self.ctx.params.get('gradle_all_sub_projects', False)
30+
return self.ctx.obj.get('gradle_all_sub_projects', False)
3131

3232
def is_project(self, document: Document) -> bool:
3333
return document.path.endswith(BUILD_GRADLE_FILE_NAME) or document.path.endswith(BUILD_GRADLE_KTS_FILE_NAME)

cycode/cli/files_collector/sca/sca_file_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ def _add_dependencies_tree_documents(
165165
def add_sca_dependencies_tree_documents_if_needed(
166166
ctx: typer.Context, scan_type: str, documents_to_scan: list[Document], is_git_diff: bool = False
167167
) -> None:
168-
no_restore = ctx.params.get('no_restore', False)
168+
no_restore = ctx.obj.get('no_restore', False)
169169
if scan_type == consts.SCA_SCAN_TYPE and not no_restore:
170170
_add_dependencies_tree_documents(ctx, documents_to_scan, is_git_diff)

0 commit comments

Comments
 (0)