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;
15
16pub(crate) struct Restriction;
17
18impl LintGroup for Restriction {
19    const NAME: &str = "bevy::restriction";
20    const LEVEL: Level = Level::Allow;
21    const LINTS: &[&Lint] = &[
22        missing_reflect::MISSING_REFLECT,
23        panicking_methods::PANICKING_METHODS,
24    ];
25
26    fn register_passes(store: &mut LintStore) {
27        store.register_late_pass(|_| Box::new(missing_reflect::MissingReflect::default()));
28        store.register_late_pass(|_| Box::new(panicking_methods::PanickingMethods::default()));
29    }
30}