bevy_lint/lints/restriction/
mod.rs

1//! Opt-in lints that restrict you from writing certain code patterns.
2//!
3//! These are designed for scenarios where you want to increase the consistency of your project by
4//! rejecting certain patterns. These lints should not all be enabled as a group, but instead
5//! should be chosen individually after reading the documentation.
6//!
7//! These lints are **allow** by default.
8
9use rustc_lint::{Level, Lint, LintStore};
10
11use crate::lint::LintGroup;
12
13pub mod missing_reflect;
14pub mod panicking_methods;
15pub mod schedule;
16
17pub(crate) struct Restriction;
18
19impl LintGroup for Restriction {
20    const NAME: &str = "bevy::restriction";
21    const LEVEL: Level = Level::Allow;
22    const LINTS: &[&Lint] = &[
23        missing_reflect::MISSING_REFLECT,
24        panicking_methods::PANICKING_METHODS,
25        schedule::FIXED_UPDATE_SCHEDULE,
26        schedule::UPDATE_SCHEDULE,
27    ];
28
29    fn register_passes(store: &mut LintStore) {
30        store.register_late_pass(|_| Box::new(missing_reflect::MissingReflect));
31        store.register_late_pass(|_| Box::new(panicking_methods::PanickingMethods));
32        store.register_late_pass(|_| Box::new(schedule::Schedule));
33    }
34}