| 16 | const LABEL: usize = 16; |
| 17 | |
| 18 | pub(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 | |
| 57 | fn render_repository(o: &mut String, repository: &RepositoryMetrics) { |
| 58 | section(o, "Repository and redb"); |