bevy_lint/lints/mod.rs
1//! All lints offered by `bevy_lint`, organized by lint group.
2//!
3//! Each module contains the lints for that lint group. [`suspicious`], for example, contains the
4//! documentation for [`suspicious::insert_event_resource`] and
5//! [`suspicious::iter_current_update_events`], since they are both within the `bevy::suspicious`
6//! lint group.
7//!
8//! Just like lints, [lint groups that can be toggled together]. The following lint groups are
9//! enabled by default:
10//!
11//! - [`correctness`]
12//! - [`suspicious`]
13//! - [`complexity`]
14//! - [`performance`]
15//! - [`style`]
16//!
17//! The following groups are disabled by default:
18//!
19//! - [`pedantic`]
20//! - [`restriction`]
21//! - [`nursery`]
22//!
23//! [lint groups that can be toggled together]: crate#toggling-lints-in-cargotoml
24
25use rustc_lint::LintStore;
26
27use crate::lint::LintGroup;
28
29mod cargo;
30
31pub mod complexity;
32pub mod correctness;
33pub mod nursery;
34pub mod pedantic;
35pub mod performance;
36pub mod restriction;
37pub mod style;
38pub mod suspicious;
39
40/// Registers all lints, lint passes, and lint groups offered by `bevy_lint` into a given
41/// [`LintStore`].
42pub(crate) fn register(store: &mut LintStore) {
43 complexity::Complexity::register(store);
44 correctness::Correctness::register(store);
45 nursery::Nursery::register(store);
46 pedantic::Pedantic::register(store);
47 performance::Performance::register(store);
48 restriction::Restriction::register(store);
49 style::Style::register(store);
50 suspicious::Suspicious::register(store);
51
52 // The Cargo lint pass is not associated with a single lint group, so we register it
53 // separately.
54 store.register_late_pass(|_| Box::new(cargo::Cargo));
55}