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:
@@ -169,7 +169,7 @@ pub fn collect_sound_events(
|
||||
) {
|
||||
queue.events.clear();
|
||||
for (entity, mut emitter) in emitters.iter_mut() {
|
||||
queue.events.extend(emitter.pending.drain(..));
|
||||
queue.events.append(&mut emitter.pending);
|
||||
commands.entity(entity).remove::<SoundEventEmitter>();
|
||||
}
|
||||
}
|
||||
@@ -221,9 +221,7 @@ mod tests {
|
||||
world.insert_resource(SoundEventQueue::default());
|
||||
|
||||
let pos = tile(5, 5);
|
||||
let _entity = world
|
||||
.spawn(SoundEventEmitter::new(close_event(&pos)))
|
||||
.id();
|
||||
let _entity = world.spawn(SoundEventEmitter::new(close_event(&pos))).id();
|
||||
|
||||
let mut schedule = bevy_ecs::schedule::Schedule::default();
|
||||
schedule.add_systems(collect_sound_events);
|
||||
@@ -337,8 +335,7 @@ mod tests {
|
||||
#[test]
|
||||
fn long_range_sound_audible_within_20_tiles() {
|
||||
let source = tile(0, 0);
|
||||
let event =
|
||||
SoundEvent::at(&source, SoundEventKind::Alert, 0.9, SoundRange::Long, None);
|
||||
let event = SoundEvent::at(&source, SoundEventKind::Alert, 0.9, SoundRange::Long, None);
|
||||
|
||||
// Manhattan distance 20 — exactly at boundary
|
||||
let listener = tile(10, 10);
|
||||
@@ -351,8 +348,7 @@ mod tests {
|
||||
#[test]
|
||||
fn long_range_sound_not_audible_beyond_20_tiles() {
|
||||
let source = tile(0, 0);
|
||||
let event =
|
||||
SoundEvent::at(&source, SoundEventKind::Alert, 0.9, SoundRange::Long, None);
|
||||
let event = SoundEvent::at(&source, SoundEventKind::Alert, 0.9, SoundRange::Long, None);
|
||||
|
||||
let listener = tile(11, 10); // manhattan 21
|
||||
assert!(
|
||||
@@ -364,8 +360,13 @@ mod tests {
|
||||
#[test]
|
||||
fn long_range_audible_at_origin() {
|
||||
let source = tile(5, 5);
|
||||
let event =
|
||||
SoundEvent::at(&source, SoundEventKind::Machinery, 0.5, SoundRange::Long, None);
|
||||
let event = SoundEvent::at(
|
||||
&source,
|
||||
SoundEventKind::Machinery,
|
||||
0.5,
|
||||
SoundRange::Long,
|
||||
None,
|
||||
);
|
||||
assert!(event.audible_at(&source), "audible at source position");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user