bevy_lint/lints/suspicious/
mod.rs1use rustc_lint::{Level, Lint, LintStore};
9
10use crate::lint::LintGroup;
11
12pub mod insert_event_resource;
13pub mod iter_current_update_events;
14pub mod unit_in_bundle;
15
16pub(crate) struct Suspicious;
17
18impl LintGroup for Suspicious {
19 const NAME: &str = "bevy::suspicious";
20 const LEVEL: Level = Level::Warn;
21 const LINTS: &[&Lint] = &[
22 insert_event_resource::INSERT_EVENT_RESOURCE,
23 iter_current_update_events::ITER_CURRENT_UPDATE_EVENTS,
24 unit_in_bundle::UNIT_IN_BUNDLE,
25 ];
26
27 fn register_passes(store: &mut LintStore) {
28 store.register_late_pass(|_| Box::new(insert_event_resource::InsertEventResource));
29 store.register_late_pass(|_| Box::new(iter_current_update_events::IterCurrentUpdateEvents));
30 store.register_late_pass(|_| Box::new(unit_in_bundle::UnitInBundle));
31 }
32
33 fn register_lints(store: &mut LintStore) {
34 store.register_lints(Self::LINTS);
35
36 store.register_renamed("bevy::insert_unit_bundle", "bevy::unit_in_bundle");
38 }
39}