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:
2026-03-17 10:33:15 +01:00
co-authored by Claude Opus 4.6
parent 7f7706442a
commit aa79dd97e7
84 changed files with 2409 additions and 1339 deletions
+11 -11
View File
@@ -132,12 +132,7 @@ pub fn enter_activity(
mut commands: Commands,
time: Res<SimulationTime>,
npcs: Query<
(
Entity,
&TilePosition,
&DailyRoutine,
Option<&ActivityState>,
),
(Entity, &TilePosition, &DailyRoutine, Option<&ActivityState>),
(
With<Npc>,
With<ActiveSim>,
@@ -287,8 +282,7 @@ pub fn detect_routine_deviation(
let phase = time.day_phase();
let tick = time.tick;
for (entity, pos, routine, activity_opt, path_req, computed_path, deviating_opt) in
npcs.iter()
for (entity, pos, routine, activity_opt, path_req, computed_path, deviating_opt) in npcs.iter()
{
let Some(entry) = routine.entry_for_phase(phase) else {
// No routine entry for this phase — nothing to deviate from.
@@ -388,7 +382,7 @@ mod tests {
.spawn((
Npc,
crate::simulation::tier::ActiveSim, // system requires With<ActiveSim> (#94)
TilePosition::new(5, 5, 0), // Not at afternoon location
TilePosition::new(5, 5, 0), // Not at afternoon location
DailyRoutine {
entries: vec![RoutineEntry {
phase: DayPhase::Afternoon,
@@ -570,7 +564,10 @@ mod tests {
let state = world.get::<ActivityState>(entity).unwrap();
assert_eq!(state.activity, "Work");
assert_eq!(state.phase, DayPhase::Afternoon);
assert_eq!(state.started_tick, MINUTES_PER_PHASE * TICKS_PER_GAME_MINUTE);
assert_eq!(
state.started_tick,
MINUTES_PER_PHASE * TICKS_PER_GAME_MINUTE
);
}
#[test]
@@ -933,7 +930,10 @@ mod tests {
run_deviation_system(&mut world);
let queue = world.resource::<RoutineDeviationEventQueue>();
assert!(queue.is_empty(), "on-schedule NPC should not emit a deviation event");
assert!(
queue.is_empty(),
"on-schedule NPC should not emit a deviation event"
);
}
#[test]