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

Function render_candidate_set

atomic-cli/src/commands/triage/mod.rs:129–165  ·  view source on GitHub ↗

The candidates render, over the gathered data — the repository path and the routed path (ListTriageCandidates' bundle) share it.

(
    feature: &str,
    into: &str,
    set: &atomic_repository::CandidateSet,
    json: bool,
)

Source from the content-addressed store, hash-verified

127/// The candidates render, over the gathered data — the repository path and
128/// the routed path (ListTriageCandidates' bundle) share it.
129fn render_candidate_set(
130 feature: &str,
131 into: &str,
132 set: &atomic_repository::CandidateSet,
133 json: bool,
134) -> CliResult<()> {
135 if json {
136 println!("{}", serde_json::to_string_pretty(&set).unwrap());
137 return Ok(());
138 }
139
140 println!("Triage candidates: {} \u{2192} {}", set.feature, set.target);
141 println!(" only in {}: {}", set.feature, set.only_in_feature.len());
142 for hash in &set.only_in_feature {
143 println!(" {}", hash);
144 }
145 println!(" closure additions: {}", set.closure_additions.len());
146 for hash in &set.closure_additions {
147 println!(" {}", hash);
148 }
149 println!(" baggage: {}", set.baggage.len());
150 for entry in &set.baggage {
151 let coverage = match entry.coverage {
152 atomic_repository::Coverage::Covered => "covered",
153 atomic_repository::Coverage::Uncovered => "uncovered",
154 atomic_repository::Coverage::Unknown => "unknown",
155 };
156 let files = if entry.modifies.is_empty() {
157 String::new()
158 } else {
159 format!(" [{}]", entry.modifies.join(", "))
160 };
161 println!(" {} ({}){}", entry.change, coverage, files);
162 }
163
164 Ok(())
165}
166
167/// Build the canonical triage report for a view relative to a target.
168#[derive(Debug, Parser)]

Callers 1

runMethod · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected