Compare commits

...

3 Commits

Author SHA1 Message Date
naomi 5535d70ddf chore(dx): add bash script to run all ci checks locally
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 54s
CI / Lint & Test (pull_request) Successful in 14m13s
CI / Build Linux (pull_request) Successful in 16m55s
CI / Build Windows (cross-compile) (pull_request) Successful in 26m48s
2026-01-20 13:09:09 -08:00
naomi 2c1d63ef10 chore: more clippy 2026-01-20 12:33:54 -08:00
naomi c380fbca3a fix: more clippy 2026-01-20 12:11:47 -08:00
3 changed files with 55 additions and 1 deletions
Executable
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to run a command and check its status
run_check() {
local desc=$1
local cmd=$2
echo -e "\n${YELLOW}Running: ${desc}${NC}"
echo -e "${YELLOW}Command: ${cmd}${NC}"
if eval "$cmd"; then
echo -e "${GREEN}âś“ ${desc} passed${NC}"
return 0
else
echo -e "${RED}âś— ${desc} failed${NC}"
return 1
fi
}
# Track if any checks fail
failed=0
echo -e "${YELLOW}🔍 Running all checks for Hikari Desktop...${NC}"
# Frontend checks
run_check "Frontend lint" "pnpm lint" || failed=1
run_check "Frontend format check" "pnpm format:check" || failed=1
run_check "Frontend type check" "pnpm check" || failed=1
run_check "Frontend tests" "pnpm test" || failed=1
# Backend checks
run_check "Backend clippy (strict)" "cd src-tauri && cargo clippy --all-targets --all-features -- -D warnings" || failed=1
run_check "Backend tests" "cargo test" || failed=1
# Summary
echo -e "\n${YELLOW}========================================${NC}"
if [ $failed -eq 0 ]; then
echo -e "${GREEN}✨ All checks passed! The code is looking great!${NC}"
echo -e "${GREEN} Naomi would be so proud of us! đź’–${NC}"
exit 0
else
echo -e "${RED}❌ Some checks failed. Let's fix them together!${NC}"
echo -e "${RED} Don't worry, we'll get through this! đź’Ş${NC}"
exit 1
fi
+3
View File
@@ -97,11 +97,13 @@ impl BridgeManager {
.ok_or_else(|| "No Claude instance found for this conversation".to_string()) .ok_or_else(|| "No Claude instance found for this conversation".to_string())
} }
#[allow(dead_code)]
pub fn cleanup_stopped_bridges(&mut self) { pub fn cleanup_stopped_bridges(&mut self) {
// Remove bridges that are no longer running // Remove bridges that are no longer running
self.bridges.retain(|_, bridge| bridge.is_running()); self.bridges.retain(|_, bridge| bridge.is_running());
} }
#[allow(dead_code)]
pub fn stop_all(&mut self) { pub fn stop_all(&mut self) {
if let Some(app) = &self.app_handle { if let Some(app) = &self.app_handle {
for (_, bridge) in self.bridges.iter_mut() { for (_, bridge) in self.bridges.iter_mut() {
@@ -111,6 +113,7 @@ impl BridgeManager {
self.bridges.clear(); self.bridges.clear();
} }
#[allow(dead_code)]
pub fn get_active_conversations(&self) -> Vec<String> { pub fn get_active_conversations(&self) -> Vec<String> {
self.bridges.keys() self.bridges.keys()
.filter(|id| self.bridges.get(*id).map(|b| b.is_running()).unwrap_or(false)) .filter(|id| self.bridges.get(*id).map(|b| b.is_running()).unwrap_or(false))
+1 -1
View File
@@ -898,6 +898,6 @@ mod tests {
use crate::bridge_manager::create_shared_bridge_manager; use crate::bridge_manager::create_shared_bridge_manager;
let shared = create_shared_bridge_manager(); let shared = create_shared_bridge_manager();
let manager = shared.lock(); let manager = shared.lock();
assert!(manager.get_active_connections().is_empty()); assert!(manager.get_active_conversations().is_empty());
} }
} }