style: cargo fmt — fix all formatting for CI

Ran cargo fmt across entire codebase to pass CI's cargo fmt --check.
No logic changes, only whitespace/formatting.
This commit is contained in:
argenis de la rosa 2026-02-13 16:03:50 -05:00
parent a5887ad2dc
commit bc31e4389b
24 changed files with 613 additions and 242 deletions

View file

@ -130,7 +130,9 @@ fn list_integrations(config: &Config, filter_category: Option<&str>) -> Result<(
let total = available + active + coming;
println!();
println!(" {total} integrations: {active} active, {available} available, {coming} coming soon");
println!(
" {total} integrations: {active} active, {available} available, {coming} coming soon"
);
println!();
println!(" Configure: zeroclaw onboard");
println!(" Details: zeroclaw integrations info <name>");
@ -144,9 +146,7 @@ fn show_integration_info(config: &Config, name: &str) -> Result<()> {
let name_lower = name.to_lowercase();
let Some(entry) = entries.iter().find(|e| e.name.to_lowercase() == name_lower) else {
anyhow::bail!(
"Unknown integration: {name}. Run `zeroclaw integrations list` to see all."
);
anyhow::bail!("Unknown integration: {name}. Run `zeroclaw integrations list` to see all.");
};
let status = (entry.status_fn)(config);
@ -157,7 +157,12 @@ fn show_integration_info(config: &Config, name: &str) -> Result<()> {
};
println!();
println!(" {} {}{}", icon, console::style(entry.name).white().bold(), entry.description);
println!(
" {} {} — {}",
icon,
console::style(entry.name).white().bold(),
entry.description
);
println!(" Category: {}", entry.category.label());
println!(" Status: {label}");
println!();

View file

@ -161,7 +161,10 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
description: "Gemini 2.5 Pro/Flash",
category: IntegrationCategory::AiModel,
status_fn: |c| {
if c.default_model.as_deref().is_some_and(|m| m.starts_with("google/")) {
if c.default_model
.as_deref()
.is_some_and(|m| m.starts_with("google/"))
{
IntegrationStatus::Active
} else {
IntegrationStatus::Available
@ -173,7 +176,10 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
description: "DeepSeek V3 & R1",
category: IntegrationCategory::AiModel,
status_fn: |c| {
if c.default_model.as_deref().is_some_and(|m| m.starts_with("deepseek/")) {
if c.default_model
.as_deref()
.is_some_and(|m| m.starts_with("deepseek/"))
{
IntegrationStatus::Active
} else {
IntegrationStatus::Available
@ -185,7 +191,10 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
description: "Grok 3 & 4",
category: IntegrationCategory::AiModel,
status_fn: |c| {
if c.default_model.as_deref().is_some_and(|m| m.starts_with("x-ai/")) {
if c.default_model
.as_deref()
.is_some_and(|m| m.starts_with("x-ai/"))
{
IntegrationStatus::Active
} else {
IntegrationStatus::Available
@ -197,7 +206,10 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
description: "Mistral Large & Codestral",
category: IntegrationCategory::AiModel,
status_fn: |c| {
if c.default_model.as_deref().is_some_and(|m| m.starts_with("mistral")) {
if c.default_model
.as_deref()
.is_some_and(|m| m.starts_with("mistral"))
{
IntegrationStatus::Active
} else {
IntegrationStatus::Available
@ -655,15 +667,17 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
#[cfg(test)]
mod tests {
use super::*;
use crate::config::schema::{ChannelsConfig, IMessageConfig, MatrixConfig, TelegramConfig};
use crate::config::Config;
use crate::config::schema::{
ChannelsConfig, IMessageConfig, MatrixConfig, TelegramConfig,
};
#[test]
fn registry_has_entries() {
let entries = all_integrations();
assert!(entries.len() >= 50, "Expected 50+ integrations, got {}", entries.len());
assert!(
entries.len() >= 50,
"Expected 50+ integrations, got {}",
entries.len()
);
}
#[test]
@ -727,7 +741,10 @@ mod tests {
let config = Config::default();
let entries = all_integrations();
let tg = entries.iter().find(|e| e.name == "Telegram").unwrap();
assert!(matches!((tg.status_fn)(&config), IntegrationStatus::Available));
assert!(matches!(
(tg.status_fn)(&config),
IntegrationStatus::Available
));
}
#[test]
@ -746,7 +763,10 @@ mod tests {
let config = Config::default();
let entries = all_integrations();
let im = entries.iter().find(|e| e.name == "iMessage").unwrap();
assert!(matches!((im.status_fn)(&config), IntegrationStatus::Available));
assert!(matches!(
(im.status_fn)(&config),
IntegrationStatus::Available
));
}
#[test]
@ -768,7 +788,10 @@ mod tests {
let config = Config::default();
let entries = all_integrations();
let mx = entries.iter().find(|e| e.name == "Matrix").unwrap();
assert!(matches!((mx.status_fn)(&config), IntegrationStatus::Available));
assert!(matches!(
(mx.status_fn)(&config),
IntegrationStatus::Available
));
}
#[test]
@ -813,9 +836,21 @@ mod tests {
#[test]
fn category_counts_reasonable() {
let entries = all_integrations();
let chat_count = entries.iter().filter(|e| e.category == IntegrationCategory::Chat).count();
let ai_count = entries.iter().filter(|e| e.category == IntegrationCategory::AiModel).count();
assert!(chat_count >= 5, "Expected 5+ chat integrations, got {chat_count}");
assert!(ai_count >= 5, "Expected 5+ AI model integrations, got {ai_count}");
let chat_count = entries
.iter()
.filter(|e| e.category == IntegrationCategory::Chat)
.count();
let ai_count = entries
.iter()
.filter(|e| e.category == IntegrationCategory::AiModel)
.count();
assert!(
chat_count >= 5,
"Expected 5+ chat integrations, got {chat_count}"
);
assert!(
ai_count >= 5,
"Expected 5+ AI model integrations, got {ai_count}"
);
}
}