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

Function _format_decision

explainshell/manager.py:270–290  ·  view source on GitHub ↗

One-line summary of a Decision for --dry-run output.

(d: prefilter.Decision)

Source from the content-addressed store, hash-verified

268
269
270def _format_decision(d: prefilter.Decision) -> str:
271 """One-line summary of a Decision for --dry-run output."""
272 if isinstance(d, prefilter.Work):
273 return f"WORK {d.short_path}"
274 if isinstance(d, prefilter.SizeSkip):
275 cmp = ">" if d.direction == "small" else "<="
276 return f"SIZE-SKIP {d.short_path} ({d.size} {cmp} {d.threshold})"
277 if isinstance(d, prefilter.AlreadyStored):
278 return f"ALREADY {d.short_path}"
279 if isinstance(d, prefilter.FilterSkip):
280 return (
281 f"FILTER-SKIP {d.short_path} "
282 f"(stored {d.stored_extractor}/{d.stored_model})"
283 )
284 if isinstance(d, prefilter.Symlink):
285 loc = "in-input-set" if d.canonical_in_inputs else "not-in-inputs"
286 stale = ", stale-in-db" if d.stale_in_db else ""
287 return f"SYMLINK {d.short_path} -> {d.canonical_source} ({loc}{stale})"
288 if isinstance(d, prefilter.ContentDup):
289 return f"CONTENT-DUP {d.short_path} -> {d.canonical_source}"
290 return repr(d)
291
292
293def _run_plan(

Callers 1

_run_planFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected