utils_macros/
lib.rs

1#![doc = include_str!("../README.md")]
2
3mod linters;
4
5use proc_macro::TokenStream;
6
7/// An attribute intended to annotate Bevy systems.
8/// It automatically annotates the system with several `#[allow]` lints common to Bevy systems for
9/// our linting configuration.
10///
11/// The idea is that we can define all ignored lints for Bevy systems once and update them in one
12/// place rather than spread across the entire codebase.
13///
14/// Currently, this macro applies the following `#[allow]`:
15/// * [`clippy::missing_errors_doc`](https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc)
16/// * [`clippy::needless_pass_by_value`](https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value)
17#[proc_macro_attribute]
18pub fn bevy_system(attr: TokenStream, item: TokenStream) -> TokenStream {
19    linters::bevy_system(attr, item)
20}