From d574b4077528fe7d7c340b87778f0f0b635db847 Mon Sep 17 00:00:00 2001 From: Alex Barclay Date: Tue, 8 Sep 2026 15:14:01 -0600 Subject: [PATCH] style: run rustfmt on both manifests; main's fmt gate has been red since #67 cargo fmt --all fails on main, in both cargo workspaces, and has since #67 merged on 2026-09-06. #68 added more. Both are mine. The reason it went unnoticed is worth recording: "fmt + clippy" is not a REQUIRED status check on this repo - only "cargo test (workspace)" is - so a red fmt does not block a merge. Three PRs merged past a failing gate without anyone choosing to override it. That is exactly I1's corollary from the doctrine side, arriving from the other direction: a check that cannot block is not a gate. It ran, it failed, and the merge happened anyway. No logic changes. rustfmt's own preferences only: server.rs import moved to its sorted position dashboard.rs two chained expressions wrapped Clippy is clean on both manifests with -D warnings, and was already. Tests unchanged: 90 fleetd + 30 fleet-core. Recommend making "fmt + clippy" required alongside "cargo test", so this class of drift cannot land again. Co-Authored-By: Claude Opus 5 (1M context) --- cockpit/ui/src-tauri/src/dashboard.rs | 8 +++++--- crates/fleetd/src/server.rs | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cockpit/ui/src-tauri/src/dashboard.rs b/cockpit/ui/src-tauri/src/dashboard.rs index 4afdf81..cd0367c 100644 --- a/cockpit/ui/src-tauri/src/dashboard.rs +++ b/cockpit/ui/src-tauri/src/dashboard.rs @@ -108,7 +108,9 @@ fn telltale_base() -> Option { // No default. An unset base URL means "Intake is not configured on this // machine", which the adapter must be able to tell apart from "configured but // unreachable" — the second greys a lane, the first should not invent one. - std::env::var("TELLTALE_BASE_URL").ok().filter(|s| !s.trim().is_empty()) + std::env::var("TELLTALE_BASE_URL") + .ok() + .filter(|s| !s.trim().is_empty()) } /// `GET {TELLTALE_BASE_URL}/v1/issues` → `{ issues, errors }` (spec §6.3), passed @@ -123,8 +125,8 @@ fn telltale_base() -> Option { #[tauri::command] pub async fn feedback_issues() -> Result { let base = telltale_base().ok_or_else(|| "TELLTALE_BASE_URL is not set".to_string())?; - let token = std::env::var("TELLTALE_TOKEN") - .map_err(|_| "TELLTALE_TOKEN is not set".to_string())?; + let token = + std::env::var("TELLTALE_TOKEN").map_err(|_| "TELLTALE_TOKEN is not set".to_string())?; let url = format!("{}/v1/issues", base.trim_end_matches('/')); let resp = reqwest::Client::new() diff --git a/crates/fleetd/src/server.rs b/crates/fleetd/src/server.rs index b9eda4f..5108c26 100644 --- a/crates/fleetd/src/server.rs +++ b/crates/fleetd/src/server.rs @@ -34,7 +34,6 @@ use axum::{ routing::{get, post}, Json, Router, }; -use tower_http::cors::{AllowOrigin, CorsLayer}; use fleet_core::{Command, Event, GateConfig, Phase, Tier}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -44,6 +43,7 @@ use std::sync::{ }; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use tokio::sync::{broadcast, mpsc, Semaphore}; +use tower_http::cors::{AllowOrigin, CorsLayer}; fn now_ms() -> i64 { SystemTime::now() @@ -2319,7 +2319,10 @@ mod tests { .get(header::ACCESS_CONTROL_ALLOW_METHODS) .map(|v| v.to_str().unwrap().to_string()) .unwrap_or_default(); - assert!(methods.contains("POST"), "POST must be allowed, got {methods:?}"); + assert!( + methods.contains("POST"), + "POST must be allowed, got {methods:?}" + ); } #[tokio::test] @@ -2359,7 +2362,9 @@ mod tests { .unwrap(); assert!( - res.headers().get(header::ACCESS_CONTROL_ALLOW_ORIGIN).is_none(), + res.headers() + .get(header::ACCESS_CONTROL_ALLOW_ORIGIN) + .is_none(), "an unlisted origin must not be granted access", ); }