Skip to content

Commit 22c1f20

Browse files
authored
CM-65133 upgrade ruff to 0.15.14 (#462)
1 parent c33b781 commit 22c1f20

4 files changed

Lines changed: 613 additions & 644 deletions

File tree

cycode/cli/apps/mcp/mcp_command.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import uuid
99
from typing import Annotated, Any, Optional
1010

11+
import anyio
1112
import typer
1213
from pathvalidate import sanitize_filepath
1314
from pydantic import Field
@@ -65,6 +66,7 @@ def _get_current_executable() -> str:
6566
return 'cycode'
6667

6768

69+
# ruff: disable[ASYNC109]
6870
async def _run_cycode_command(*args: str, timeout: int = _DEFAULT_RUN_COMMAND_TIMEOUT) -> dict[str, Any]:
6971
"""Run a cycode command asynchronously and return the parsed result.
7072
@@ -109,6 +111,9 @@ async def _run_cycode_command(*args: str, timeout: int = _DEFAULT_RUN_COMMAND_TI
109111
return {'error': f'Failed to run command: {e!s}'}
110112

111113

114+
# ruff: enable[ASYNC109]
115+
116+
112117
def _sanitize_file_path(file_path: str) -> str:
113118
"""Sanitize file path to prevent path traversal and other security issues.
114119
@@ -238,7 +243,7 @@ async def _cycode_scan_tool(
238243

239244
try:
240245
if paths:
241-
missing = [p for p in paths if not os.path.exists(p)]
246+
missing = [p for p in paths if not await anyio.Path(p).exists()]
242247
if missing:
243248
return json.dumps({'error': f'Paths not found on disk: {missing}'}, indent=2)
244249

0 commit comments

Comments
 (0)