Expand description
The report list-override DSL: parse a [report] section into a
ReportOverride of per-list ListPatches, plus the generic op-table
primitives is_list_op_table / patch_value_list reused by the TOML
inheritance merge (crate::toml_merge::deep_merge).
The report’s table columns, card-featured metrics, and JSON stats keys are
inherited from the global metric catalog. A config patches an inherited list
rather than restating it: a plain array replaces it wholesale, while an
op-table mutates it in place —
[report]
columns = { remove = ["volume", "effort"], add = ["unsafe"] }
stats = { add = ["unsafe"] }
card = { replace = { "sloc" = "unsafe" } }The op semantics (clear → remove → replace → after/before →
prepend → add, then dedup) live in ListPatch::apply. The orchestrator
applies the patch over the catalog list, then prunes to keys present.
Lives in code-ranker-plugin-api (next to ReportOverride) so both the
language plugins (<lang>.toml [report]) and the CLI (a project
code-ranker.toml [report], and its config inheritance merge) use it without
reaching into a sibling crate.
Functions§
- is_
list_ op_ table - True when
tis a list-op table (carries at least one op key) — i.e. it patches an inherited list rather than replacing it with a value. - patch_
value_ list - Apply an op-table
ovto a string-listbase(used bydeep_merge). A non-string base can’t be patched by value, so it is kept unchanged. - report_
override - Read the
[report]section of a merged config table as aReportOverride(used for a language’s<lang>.toml, which nests it underreport). - report_
override_ section - Read a bare
[report]section table (itscolumns/card/statskeys) as aReportOverride. Used for the projectcode-ranker.toml, where the section is parsed into a table directly.