Skip to content

Commit 34732e9

Browse files
Test Userclaude
andcommitted
fix(lint): resolve 4 clippy -D warnings gate failures Refs #2933
- weather_report: collapse nested if-let/if into let-chain (collapsible_if) - merge_coordinator: wrap const assertions in const{} blocks (assertions_on_constants) - terraphim_validation: remove trivial assert!(true) (assertions_on_constants) - terraphim_server: move build_router_for_tests before mod tests (items_after_test_module) `cargo clippy --workspace --all-targets -- -D warnings` now passes clean. Co-Authored-By: Ferrox <noreply@anthropic.com>
1 parent 3d7b070 commit 34732e9

4 files changed

Lines changed: 51 additions & 47 deletions

File tree

  • crates
  • terraphim_server/src

crates/terraphim_merge_coordinator/src/gitea.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,22 @@ mod tests {
212212

213213
#[test]
214214
fn open_prs_limit_exceeds_gitea_default_of_50() {
215-
assert!(
216-
OPEN_PRS_LIMIT > 50,
217-
"OPEN_PRS_LIMIT must exceed 50 so PRs beyond position 50 are not silently dropped"
218-
);
215+
const {
216+
assert!(
217+
OPEN_PRS_LIMIT > 50,
218+
"OPEN_PRS_LIMIT must exceed 50 so PRs beyond position 50 are not silently dropped"
219+
)
220+
}
219221
}
220222

221223
#[test]
222224
fn open_prs_limit_within_gitea_max_page_size() {
223-
assert!(
224-
OPEN_PRS_LIMIT <= 300,
225-
"Gitea max page size is 300; limit must not exceed it"
226-
);
225+
const {
226+
assert!(
227+
OPEN_PRS_LIMIT <= 300,
228+
"Gitea max page size is 300; limit must not exceed it"
229+
)
230+
}
227231
}
228232

229233
#[test]

crates/terraphim_validation/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ mod tests {
6161

6262
#[tokio::test]
6363
async fn test_validation_system_creation() {
64-
let system = ValidationSystem::new().unwrap();
65-
assert!(true); // Basic creation test
64+
let _system = ValidationSystem::new().unwrap();
6665
}
6766
}

crates/terraphim_weather_report/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,11 @@ fn print_tier_markdown(tier: &terraphim_weather_report::TierSection) {
350350
"| {} | {} | `{}` | {} | {} | {} |",
351351
cond, m.provider, m.model, m.cli, latency, cost
352352
);
353-
if let Some(detail) = &m.detail {
354-
if !detail.is_empty() && !detail.starts_with("probe skipped") {
355-
println!("| | | | | | *{}* |", detail.replace('|', "\\|"));
356-
}
353+
if let Some(detail) = &m.detail
354+
&& !detail.is_empty()
355+
&& !detail.starts_with("probe skipped")
356+
{
357+
println!("| | | | | | *{}* |", detail.replace('|', "\\|"));
357358
}
358359
}
359360
println!();

terraphim_server/src/lib.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,39 @@ async fn not_found() -> Response {
629629
(StatusCode::NOT_FOUND, "404").into_response()
630630
}
631631

632+
/// Constructs a minimal Axum router suitable for integration tests.
633+
pub async fn build_router_for_tests() -> Router {
634+
use terraphim_config::ConfigBuilder;
635+
636+
// Create minimal test configuration
637+
let mut config = ConfigBuilder::new()
638+
.build_default_embedded()
639+
.build()
640+
.expect("Failed to build test config");
641+
642+
let config_state = ConfigState::new(&mut config)
643+
.await
644+
.expect("Failed to create ConfigState");
645+
646+
let (tx, _rx) = channel::<IndexedDocument>(10);
647+
648+
// Initialize summarization manager
649+
let summarization_manager = Arc::new(SummarizationManager::new(QueueConfig::default()));
650+
651+
// Initialize workflow management components for tests
652+
let workflow_sessions = Arc::new(RwLock::new(HashMap::new()));
653+
let (websocket_broadcaster, _) = broadcast::channel(100);
654+
655+
// Create extended application state for tests
656+
let app_state = AppState {
657+
config_state,
658+
workflow_sessions,
659+
websocket_broadcaster,
660+
};
661+
662+
build_router(app_state, tx, summarization_manager, false)
663+
}
664+
632665
#[cfg(test)]
633666
mod tests {
634667
use super::*;
@@ -860,36 +893,3 @@ mod tests {
860893
assert!(!desc.is_empty());
861894
}
862895
}
863-
864-
/// Constructs a minimal Axum router suitable for integration tests.
865-
pub async fn build_router_for_tests() -> Router {
866-
use terraphim_config::ConfigBuilder;
867-
868-
// Create minimal test configuration
869-
let mut config = ConfigBuilder::new()
870-
.build_default_embedded()
871-
.build()
872-
.expect("Failed to build test config");
873-
874-
let config_state = ConfigState::new(&mut config)
875-
.await
876-
.expect("Failed to create ConfigState");
877-
878-
let (tx, _rx) = channel::<IndexedDocument>(10);
879-
880-
// Initialize summarization manager
881-
let summarization_manager = Arc::new(SummarizationManager::new(QueueConfig::default()));
882-
883-
// Initialize workflow management components for tests
884-
let workflow_sessions = Arc::new(RwLock::new(HashMap::new()));
885-
let (websocket_broadcaster, _) = broadcast::channel(100);
886-
887-
// Create extended application state for tests
888-
let app_state = AppState {
889-
config_state,
890-
workflow_sessions,
891-
websocket_broadcaster,
892-
};
893-
894-
build_router(app_state, tx, summarization_manager, false)
895-
}

0 commit comments

Comments
 (0)