MCPcopy Create free account
hub / github.com/idank/explainshell / _changed_metric_lines

Function _changed_metric_lines

tests/evals/render/render_eval.py:337–366  ·  view source on GitHub ↗
(old: dict[str, Any], new: dict[str, Any])

Source from the content-addressed store, hash-verified

335
336
337def _changed_metric_lines(old: dict[str, Any], new: dict[str, Any]) -> list[str]:
338 metric_keys = [
339 "markdown.line_count",
340 "markdown.char_count",
341 "markdown.max_line_length",
342 "markdown.giant_lines_500",
343 "markdown.max_option_like_tokens_on_line",
344 "filtered.line_count",
345 "html.data_chars",
346 "html.tags.p",
347 "html.tags.br",
348 "html.tags.li",
349 "html.tags.blockquote",
350 "html.tags.pre",
351 "html.tags.a",
352 "html.tags.code",
353 "html.tags.em",
354 "html.tags.strong",
355 "html.tags.h1",
356 "html.tags.h2",
357 "html.tags.h3",
358 "html.tags.tr",
359 ]
360 changed: list[str] = []
361 for key in metric_keys:
362 before = _get_metric(old, key)
363 after = _get_metric(new, key)
364 if before != after:
365 changed.append(f"- `{key}`: {_format_delta(before, after)}")
366 return changed
367
368
369def _summarize_comparison(

Callers 2

_summarize_comparisonFunction · 0.85
diff_reportFunction · 0.85

Calls 2

_get_metricFunction · 0.90
_format_deltaFunction · 0.90

Tested by

no test coverage detected