fix: add --all to cargo fmt in script/test and autoformat codebase

cargo fmt without --all fails with "Failed to find targets" in
workspace repos. This was blocking every story's gates. Also ran
cargo fmt --all to fix all existing formatting issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-13 14:07:08 +00:00
parent ed2526ce41
commit 845b85e7a7
128 changed files with 3566 additions and 2395 deletions
+13 -16
View File
@@ -1,8 +1,8 @@
//! Server rebuild and restart logic shared between the MCP tool and Matrix bot command.
use crate::agents::AgentPool;
use crate::slog;
use crate::chat::ChatTransport;
use crate::slog;
use std::path::Path;
use std::sync::Arc;
@@ -31,11 +31,7 @@ pub struct BotShutdownNotifier {
}
impl BotShutdownNotifier {
pub fn new(
transport: Arc<dyn ChatTransport>,
channels: Vec<String>,
bot_name: String,
) -> Self {
pub fn new(transport: Arc<dyn ChatTransport>, channels: Vec<String>, bot_name: String) -> Self {
Self {
transport,
channels,
@@ -66,10 +62,7 @@ impl BotShutdownNotifier {
format!("{} is going offline (server stopped).", self.bot_name)
}
ShutdownReason::Rebuild => {
format!(
"{} is going offline to pick up a new build.",
self.bot_name
)
format!("{} is going offline to pick up a new build.", self.bot_name)
}
};
for channel in &self.channels {
@@ -221,9 +214,7 @@ pub async fn rebuild_and_restart(
// Use exec() to replace the current process.
// This never returns on success.
use std::os::unix::process::CommandExt;
let err = std::process::Command::new(&new_exe)
.args(&args[1..])
.exec();
let err = std::process::Command::new(&new_exe).args(&args[1..]).exec();
// If we get here, exec() failed.
Err(format!("Failed to exec new binary: {err}"))
@@ -234,8 +225,8 @@ pub async fn rebuild_and_restart(
#[cfg(test)]
mod tests {
use super::*;
use async_trait::async_trait;
use crate::chat::MessageId;
use async_trait::async_trait;
use std::sync::Mutex;
/// In-memory transport that records sent messages.
@@ -366,7 +357,10 @@ mod tests {
let manual_msg = &transport_a.messages()[0].1;
let rebuild_msg = &transport_b.messages()[0].1;
assert_ne!(manual_msg, rebuild_msg, "manual and rebuild messages must differ");
assert_ne!(
manual_msg, rebuild_msg,
"manual and rebuild messages must differ"
);
}
#[tokio::test]
@@ -483,6 +477,9 @@ mod tests {
let startup_msg = &transport_start.messages()[0].1;
let shutdown_msg = &transport_stop.messages()[0].1;
assert_ne!(startup_msg, shutdown_msg, "startup and shutdown messages must differ");
assert_ne!(
startup_msg, shutdown_msg,
"startup and shutdown messages must differ"
);
}
}