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:
@@ -173,7 +173,10 @@ mod tests {
|
||||
index.update(e_near, TilePosition::new(5, 6, 0));
|
||||
|
||||
let in_range = index.entities_in_range(¢er, 2);
|
||||
assert!(!in_range.contains(&e_at), "entity at center should be excluded");
|
||||
assert!(
|
||||
!in_range.contains(&e_at),
|
||||
"entity at center should be excluded"
|
||||
);
|
||||
assert!(in_range.contains(&e_near));
|
||||
}
|
||||
|
||||
@@ -331,7 +334,10 @@ mod tests {
|
||||
let in_range = index.entities_in_range(¢er, 1);
|
||||
assert!(in_range.contains(&e_dist1_x));
|
||||
assert!(in_range.contains(&e_dist1_y));
|
||||
assert!(!in_range.contains(&e_dist2), "distance 2 must not appear in radius-1 result");
|
||||
assert!(
|
||||
!in_range.contains(&e_dist2),
|
||||
"distance 2 must not appear in radius-1 result"
|
||||
);
|
||||
}
|
||||
|
||||
/// Diagonal: Manhattan distance covers all 4 orthogonal directions.
|
||||
@@ -348,9 +354,9 @@ mod tests {
|
||||
|
||||
let center = TilePosition::new(10, 10, 0);
|
||||
index.update(north, TilePosition::new(10, 11, 0)); // distance 1
|
||||
index.update(south, TilePosition::new(10, 9, 0)); // distance 1
|
||||
index.update(east, TilePosition::new(11, 10, 0)); // distance 1
|
||||
index.update(west, TilePosition::new(9, 10, 0)); // distance 1
|
||||
index.update(south, TilePosition::new(10, 9, 0)); // distance 1
|
||||
index.update(east, TilePosition::new(11, 10, 0)); // distance 1
|
||||
index.update(west, TilePosition::new(9, 10, 0)); // distance 1
|
||||
index.update(corner, TilePosition::new(11, 11, 0)); // distance 2
|
||||
|
||||
let in_range = index.entities_in_range(¢er, 2);
|
||||
@@ -425,7 +431,11 @@ mod tests {
|
||||
}
|
||||
|
||||
let in_range = index.entities_in_range(¢er, 200);
|
||||
assert_eq!(in_range.len(), 10, "radius 200 should include all 10 entities");
|
||||
assert_eq!(
|
||||
in_range.len(),
|
||||
10,
|
||||
"radius 200 should include all 10 entities"
|
||||
);
|
||||
}
|
||||
|
||||
/// Remove one entity from a multi-entity index, others remain.
|
||||
@@ -500,7 +510,11 @@ mod tests {
|
||||
|
||||
{
|
||||
let idx = world.resource::<NaiveSpatialIndex>();
|
||||
assert_eq!(idx.entities_at(&start).len(), 1, "entity should be at start after first sync");
|
||||
assert_eq!(
|
||||
idx.entities_at(&start).len(),
|
||||
1,
|
||||
"entity should be at start after first sync"
|
||||
);
|
||||
}
|
||||
|
||||
// Update position
|
||||
@@ -511,8 +525,15 @@ mod tests {
|
||||
|
||||
{
|
||||
let idx = world.resource::<NaiveSpatialIndex>();
|
||||
assert!(idx.entities_at(&start).is_empty(), "old position should be cleared");
|
||||
assert_eq!(idx.entities_at(&dest).len(), 1, "entity should be at new position");
|
||||
assert!(
|
||||
idx.entities_at(&start).is_empty(),
|
||||
"old position should be cleared"
|
||||
);
|
||||
assert_eq!(
|
||||
idx.entities_at(&dest).len(),
|
||||
1,
|
||||
"entity should be at new position"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user