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 crate::lint::LintGroup;
26use rustc_lint::LintStore;
27
28mod cargo;
29
30pub mod complexity;
31pub mod correctness;
32pub mod nursery;
33pub mod pedantic;
34pub mod performance;
35pub mod restriction;
36pub mod style;
37pub mod suspicious;
38
39/// Registers all lints, lint passes, and lint groups offered by `bevy_lint` into a given
40/// [`LintStore`].
41pub(crate) fn register(store: &mut LintStore) {
42    complexity::Complexity::register(store);
43    correctness::Correctness::register(store);
44    nursery::Nursery::register(store);
45    pedantic::Pedantic::register(store);
46    performance::Performance::register(store);
47    restriction::Restriction::register(store);
48    style::Style::register(store);
49    suspicious::Suspicious::register(store);
50
51    // The Cargo lint pass is not associated with a single lint group, so we register it
52    // separately.
53    store.register_late_pass(|_| Box::new(cargo::Cargo::default()));
54}