fix(simulation): Clippy cleanup and CI enforcement (#635)
Fix all Clippy warnings across the server codebase (2411 insertions, 1341 deletions). Raise type-complexity-threshold to 750 and too-many-arguments to 12 in .clippy.toml for idiomatic Bevy ECS system signatures. The server now passes `cargo clippy -- --deny warnings` cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+10
-16
@@ -18,10 +18,10 @@
|
||||
use bevy_ecs::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::simulation::line_pool::Mood as ContentMood;
|
||||
use crate::npc::interaction::InteractionMemory;
|
||||
use crate::npc::{Npc, ToleranceThreshold};
|
||||
use crate::simulation::dialogue::CurrentMood;
|
||||
use crate::simulation::line_pool::Mood as ContentMood;
|
||||
use crate::simulation::tier::ActiveSim;
|
||||
use crate::simulation::time::{DayPhase, SimulationTime};
|
||||
|
||||
@@ -293,10 +293,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn mood_warm_when_positive_interaction() {
|
||||
assert_eq!(
|
||||
derive_mood(0, 50, DayPhase::Morning, true),
|
||||
NpcMood::Warm
|
||||
);
|
||||
assert_eq!(derive_mood(0, 50, DayPhase::Morning, true), NpcMood::Warm);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -381,10 +378,7 @@ mod tests {
|
||||
#[test]
|
||||
fn mood_priority_warm_over_frustrated() {
|
||||
// Warm takes priority over Frustrated (checked before Evening test)
|
||||
assert_eq!(
|
||||
derive_mood(25, 50, DayPhase::Evening, true),
|
||||
NpcMood::Warm
|
||||
);
|
||||
assert_eq!(derive_mood(25, 50, DayPhase::Evening, true), NpcMood::Warm);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -489,12 +483,7 @@ mod tests {
|
||||
|
||||
// No ToleranceThreshold → defaults (stress=0, threshold=50) → Content
|
||||
let npc = world
|
||||
.spawn((
|
||||
Npc,
|
||||
ActiveSim,
|
||||
MoodState::default(),
|
||||
CurrentMood::default(),
|
||||
))
|
||||
.spawn((Npc, ActiveSim, MoodState::default(), CurrentMood::default()))
|
||||
.id();
|
||||
|
||||
let mut schedule = bevy_ecs::schedule::Schedule::default();
|
||||
@@ -669,7 +658,12 @@ mod tests {
|
||||
// This test documents the invariant: derive_mood never emits these states.
|
||||
use std::collections::HashSet;
|
||||
|
||||
let phases = [DayPhase::Morning, DayPhase::Afternoon, DayPhase::Evening, DayPhase::Night];
|
||||
let phases = [
|
||||
DayPhase::Morning,
|
||||
DayPhase::Afternoon,
|
||||
DayPhase::Evening,
|
||||
DayPhase::Night,
|
||||
];
|
||||
let stresses: &[i16] = &[-50, -1, 0, 1, 19, 20, 29, 30, 49, 50, 51, 100];
|
||||
let thresholds: &[i16] = &[0, 1, 50, 100];
|
||||
let warm_flags = [false, true];
|
||||
|
||||
Reference in New Issue
Block a user