MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / render_text

Function render_text

atomic-cli/src/commands/diagnostics/render.rs:18–55  ·  view source on GitHub ↗
(report: &Report)

Source from the content-addressed store, hash-verified

16const LABEL: usize = 16;
17
18pub(crate) fn render_text(report: &Report) -> String {
19 let mut out = String::new();
20 let o = &mut out;
21
22 line(o, "Atomic diagnostics");
23 line(o, "==================");
24 field(o, "Generated", &report.generated_at);
25 blank(o);
26
27 section(o, "Atomic");
28 field(o, "Version", &report.atomic.version);
29 field(o, "Install source", &report.atomic.install_source);
30 field(
31 o,
32 "Platform",
33 &format!("{} {}", report.atomic.os, report.atomic.arch),
34 );
35 let workspace = match &report.workspace {
36 Workspace::Found { root } => root.clone(),
37 Workspace::NotFound => "none (not inside an Atomic workspace)".to_string(),
38 Workspace::Unreadable { reason } => format!("unknown — {reason}"),
39 };
40 field(o, "Workspace", &workspace);
41 blank(o);
42
43 render_repository(o, &report.repository);
44 render_integrations(o, report);
45 render_skills(o, report);
46 render_agents(o, &report.agents);
47 render_shim(o, report);
48
49 section(o, "Not collected");
50 for item in &report.not_collected {
51 line(o, &format!(" {}: {}", item.item, item.reason));
52 }
53
54 out
55}
56
57fn render_repository(o: &mut String, repository: &RepositoryMetrics) {
58 section(o, "Repository and redb");

Calls 10

lineFunction · 0.85
blankFunction · 0.85
render_repositoryFunction · 0.85
render_integrationsFunction · 0.85
render_skillsFunction · 0.85
render_agentsFunction · 0.85
render_shimFunction · 0.85
fieldFunction · 0.70
sectionFunction · 0.70
cloneMethod · 0.45