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

Function run

atomic-cli/src/commands/review/incremental.rs:100–130  ·  view source on GitHub ↗
(args: &IncrementalArgs)

Source from the content-addressed store, hash-verified

98}
99
100pub fn run(args: &IncrementalArgs) -> CliResult<()> {
101 let root = find_repository_root()?;
102 let thinking = super::progress::Thinking::start(args.json || args.html);
103 let report = crate::commands::rpc::review(&request(args)?)?;
104 drop(thinking);
105 if args.html {
106 let repo =
107 crate::commands::open_readonly_repository(&root).map_err(CliError::Repository)?;
108 let html = super::html::render(&repo, &report)?;
109 if !args.no_open {
110 crate::output::html::write_and_open_html(&html, args.output.as_deref(), |url| {
111 open::that(url)
112 })?;
113 } else if let Some(path) = &args.output {
114 std::fs::write(path, html)?;
115 } else {
116 print!("{html}");
117 }
118 } else if args.json {
119 println!(
120 "{}",
121 serde_json::to_string_pretty(&report).map_err(|e| CliError::Internal(e.into()))?
122 );
123 } else {
124 print!(
125 "{}",
126 libatomic::review::incremental::render(&report, args.details)?
127 );
128 }
129 Ok(())
130}
131
132#[cfg(test)]
133mod tests {

Callers

nothing calls this directly

Calls 7

find_repository_rootFunction · 0.85
open_readonly_repositoryFunction · 0.85
write_and_open_htmlFunction · 0.85
requestFunction · 0.70
reviewFunction · 0.50
renderFunction · 0.50
writeFunction · 0.50

Tested by

no test coverage detected