Skip to content

Commit e276d95

Browse files
committed
CM-63288 ruff and lint
1 parent ef2af5c commit e276d95

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ def is_project(self, document: Document) -> bool:
1515
return any(document.path.endswith(ext) for ext in NUGET_PROJECT_FILE_EXTENSIONS)
1616

1717
def get_commands(self, manifest_file_path: str) -> list[list[str]]:
18-
return [['dotnet', 'restore', manifest_file_path, '--use-lock-file', '--verbosity', 'quiet', '--ignore-failed-sources']]
18+
return [
19+
[
20+
'dotnet',
21+
'restore',
22+
manifest_file_path,
23+
'--use-lock-file',
24+
'--verbosity',
25+
'quiet',
26+
'--ignore-failed-sources',
27+
]
28+
]
1929

2030
def get_lock_file_name(self) -> str:
2131
return NUGET_LOCK_FILE_NAME

tests/cli/commands/scan/test_scan_command.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ def _make_ctx(**obj_overrides: object) -> click.Context:
2020

2121

2222
def _invoke_result_callback(ctx: click.Context) -> int:
23-
with pytest.raises(typer.Exit) as exc_info:
24-
with ctx:
25-
scan_command_result_callback()
23+
with pytest.raises(typer.Exit) as exc_info, ctx:
24+
scan_command_result_callback()
2625
return exc_info.value.exit_code
2726

2827

@@ -47,4 +46,7 @@ def test_soft_fail_overrides_violations(self) -> None:
4746
assert _invoke_result_callback(_make_ctx(soft_fail=True, issue_detected=True)) == NO_ISSUES_STATUS_CODE
4847

4948
def test_soft_fail_overrides_stop_on_error(self) -> None:
50-
assert _invoke_result_callback(_make_ctx(soft_fail=True, did_fail=True, stop_on_error=True)) == NO_ISSUES_STATUS_CODE
49+
assert (
50+
_invoke_result_callback(_make_ctx(soft_fail=True, did_fail=True, stop_on_error=True))
51+
== NO_ISSUES_STATUS_CODE
52+
)

0 commit comments

Comments
 (0)