bevy_lint/
lib.rs

1//! `bevy_lint` is a custom linter for the [Bevy game engine](https://bevy.org), similar to
2//! [Clippy](https://doc.rust-lang.org/stable/clippy).
3//!
4//! This is the primary documentation for its lints and lint groups. `bevy_lint` is not intended to
5//! be consumed as a library. You can find the documentation for individual lints and their groups
6//! in the [`lints`] module.
7//!
8//! <!--
9//! Override these links to point to the local copy of the docs.
10//! For more info on how this works, see <https://linebender.org/blog/doc-include/>.
11//! -->
12//! [**Documentation**]: crate
13//! [**All Lints**]: crate::lints
14#![doc = include_str!("../README.md")]
15// Enables linking to `rustc` crates.
16#![feature(rustc_private)]
17// Used to access the index of repeating macro input in `declare_bevy_symbols!`.
18#![feature(macro_metavar_expr)]
19// Warn on internal `rustc` lints that check for poor usage of internal compiler APIs. Note that
20// you also need to pass `-Z unstable-options` to `rustc` for this to be enabled:
21// `RUSTFLAGS="-Zunstable-options" cargo check`
22#![warn(rustc::internal)]
23#![allow(
24    rustc::usage_of_ty_tykind,
25    reason = "many false positives without a valid replacement"
26)]
27#![cfg_attr(
28    test,
29    allow(
30        clippy::disallowed_macros,
31        reason = "`bevy_lint`'s macros are intended for lints, not tests",
32    )
33)]
34
35// This is a list of every single `rustc` crate used within this library. If you need another, add
36// it here!
37extern crate rustc_abi;
38extern crate rustc_ast;
39extern crate rustc_data_structures;
40extern crate rustc_driver;
41extern crate rustc_errors;
42extern crate rustc_hir;
43extern crate rustc_hir_analysis;
44extern crate rustc_interface;
45extern crate rustc_lint;
46extern crate rustc_lint_defs;
47extern crate rustc_middle;
48extern crate rustc_session;
49extern crate rustc_span;
50extern crate rustc_type_ir;
51
52mod callback;
53mod config;
54mod lint;
55pub mod lints;
56mod paths;
57mod sym;
58mod utils;
59
60pub use self::callback::BevyLintCallback;