MCPcopy Index your code
hub / github.com/idank/explainshell / _run_plan

Function _run_plan

explainshell/manager.py:293–319  ·  view source on GitHub ↗

Print the prefilter classification for each file; no extraction, no writes.

(
    gz_files: list[str],
    s: store.Store,
    *,
    overwrite: bool,
    filter_specs: list[tuple[str, str | None]],
    small_only: bool,
    large_only: bool,
)

Source from the content-addressed store, hash-verified

291
292
293def _run_plan(
294 gz_files: list[str],
295 s: store.Store,
296 *,
297 overwrite: bool,
298 filter_specs: list[tuple[str, str | None]],
299 small_only: bool,
300 large_only: bool,
301) -> None:
302 """Print the prefilter classification for each file; no extraction, no writes."""
303 classifier = prefilter.Classifier(
304 s=s,
305 overwrite=overwrite,
306 filter_specs=filter_specs,
307 small_only=small_only,
308 large_only=large_only,
309 size_threshold=_SIZE_FILTER_THRESHOLD,
310 normalized_inputs={os.path.normpath(p) for p in gz_files},
311 )
312 counts: dict[str, int] = {}
313 for gz_path in gz_files:
314 d = classifier.classify(gz_path)
315 kind = type(d).__name__
316 counts[kind] = counts.get(kind, 0) + 1
317 logger.info("%s", _format_decision(d))
318 summary = ", ".join(f"{n} {k.lower()}" for k, n in sorted(counts.items()))
319 logger.info("plan: %s (%d total)", summary or "(empty)", len(gz_files))
320
321
322# ---------------------------------------------------------------------------

Callers 1

extractFunction · 0.85

Calls 2

classifyMethod · 0.95
_format_decisionFunction · 0.85

Tested by

no test coverage detected