MCPcopy Index your code
hub / github.com/openai/plugins / open_scan_local_file

Function open_scan_local_file

plugins/codex-security/scripts/workbench_db.py:2805–2818  ·  view source on GitHub ↗
(scan_dir: Path, relative_path: str)

Source from the content-addressed store, hash-verified

2803
2804
2805def open_scan_local_file(scan_dir: Path, relative_path: str) -> Any:
2806 parsed = PurePosixPath(relative_path)
2807 if parsed.is_absolute() or not parsed.parts or ".." in parsed.parts:
2808 raise SystemExit("Patch path must identify a scan-local regular file.")
2809 scan_dir = require_canonical_scan_directory(scan_dir)
2810 try:
2811 file_fd = open_scan_local_file_descriptor(
2812 scan_dir,
2813 parsed.as_posix(),
2814 "Patch path",
2815 )
2816 return os.fdopen(file_fd, "rb")
2817 except (ContractError, OSError) as exc:
2818 raise SystemExit("Patch path must identify a scan-local regular file.") from exc
2819
2820
2821def index_findings(

Callers 4

scan_local_file_digestFunction · 0.85
patch_artifact_previewFunction · 0.85

Tested by

no test coverage detected