Skip to main content

devscout_rs/
render.rs

1// Default / --compact rendering for `refs`/`impact`. This module owns
2// `render_refs_text`/`render_impact_text` (default), `render_refs_compact`/
3// `render_impact_compact` (`--compact`), and their shared helpers
4// (`ref_kind_block`/`compact_block`/`rle`/`group_by_file`). Analytics/dev output
5// (triage/analyze/report) is out of scope here.
6//
7// `--json` output is NOT built here -- it lives in cli.rs alongside the rest of
8// the CLI-level `--json` flag handling, matching the module split.
9//
10// Rendering notes (`ref_kind_block`/`compact_block`):
11//
12// - `ref_kind_block` (default renderer) prints its header line whenever the
13//   table itself is present, EVEN IF `total == 0` -- only a genuinely
14//   missing/undefined table suppresses the header entirely. `compact_block`
15//   additionally suppresses on `total == 0` (empty tables print nothing in
16//   `--compact`, not even a header). This asymmetry is real and preserved:
17//   see `ref_kind_block_present_but_empty_table_still_prints_header` below.
18// - "Missing table" tolerance (the `Option<&Table<R>>` parameter): query.rs's
19//   typed `RefsModel`/`ImpactModel` always supply a concrete (possibly
20//   zero-total) `Table` for every kind, so the `None` branch is unreachable from
21//   a real model. It is kept because the block helpers are tested directly with
22//   an absent table to exercise exactly this path; it is not reachable through
23//   the public render_* functions.
24
25mod blocks;
26mod coverage;
27mod impact;
28mod markers;
29mod read;
30mod refs;
31
32pub use coverage::{render_tests_compact, render_tests_text};
33pub use impact::{
34    render_impact_compact, render_impact_compact_with_imports, render_impact_text,
35    render_impact_text_with_imports,
36};
37pub use markers::seed_kind_str;
38pub use read::{render_read_compact, render_read_text};
39pub use refs::{render_refs_compact, render_refs_text};
40
41#[cfg(test)]
42mod tests;