bevy_lint/lints/pedantic/
mod.rs

1//! Lints that make the linter a nit-picky perfectionist.
2//!
3//! Unlike other lint groups, pedantic lints have limited value and may not always apply. Be sure
4//! to read the motivation behind each lint in this category before enabling them, and expect to
5//! liberally apply `#[allow(...)]` attributes throughout your code if you do use them.
6//!
7//! These lints are **allow** by default.
8
9use rustc_lint::{Level, Lint, LintStore};
10
11use crate::lint::LintGroup;
12
13pub mod borrowed_reborrowable;
14pub mod main_return_without_appexit;
15
16pub(crate) struct Pedantic;
17
18impl LintGroup for Pedantic {
19    const NAME: &str = "bevy::pedantic";
20    const LEVEL: Level = Level::Allow;
21    const LINTS: &[&Lint] = &[
22        borrowed_reborrowable::BORROWED_REBORROWABLE,
23        main_return_without_appexit::MAIN_RETURN_WITHOUT_APPEXIT,
24    ];
25
26    fn register_passes(store: &mut LintStore) {
27        store.register_late_pass(|_| {
28            Box::new(borrowed_reborrowable::BorrowedReborrowable::default())
29        });
30        store.register_late_pass(|_| {
31            Box::new(main_return_without_appexit::MainReturnWithoutAppExit::default())
32        });
33    }
34}