bevy_lint/lints/style/
mod.rs

1//! Lints that encourage idiomatic code.
2//!
3//! These lints are opinionated and may be freely disabled if you disagree with their suggestions.
4//!
5//! These lints are **warn** by default.
6
7use rustc_lint::{Level, Lint, LintStore};
8
9use crate::lint::LintGroup;
10
11pub mod unconventional_naming;
12
13pub(crate) struct Style;
14
15impl LintGroup for Style {
16    const NAME: &str = "bevy::style";
17    const LEVEL: Level = Level::Warn;
18    const LINTS: &[&Lint] = &[unconventional_naming::UNCONVENTIONAL_NAMING];
19
20    fn register_passes(store: &mut LintStore) {
21        store.register_late_pass(|_| {
22            Box::new(unconventional_naming::UnconventionalNaming::default())
23        });
24    }
25
26    fn register_lints(store: &mut LintStore) {
27        store.register_lints(Self::LINTS);
28
29        // `plugin_not_ending_in_plugin` was merged into `unconventional_naming` in v0.3.0. This
30        // helps users of v0.2.0 migrate to v0.3.0, but should be removed before v0.4.0 is
31        // released.
32        store.register_renamed(
33            "bevy::plugin_not_ending_in_plugin",
34            "bevy::unconventional_naming",
35        );
36    }
37}