bevy_lint::lints

Module plugin_not_ending_in_plugin

Source
Expand description

Checks for types who implement Plugin but whose names does not end in “Plugin”.

This does not check function-style plugins (fn plugin(app: &mut App)), only structures with Plugin explicitly implemented with impl Plugin for T.

§Motivation

Unlike traits like Clone or Debug, the primary purpose of a type that implements Plugin is to be a Bevy plugin. As such, it is common practice to suffix plugin names with “Plugin” to signal how they should be used.

§Example

struct Physics;

impl Plugin for Physics {
    fn build(&self, app: &mut App) {
        // ...
    }
}

Use instead:

struct PhysicsPlugin;

impl Plugin for PhysicsPlugin {
    fn build(&self, app: &mut App) {
        // ...
    }
}

Structs§

Statics§