mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 21:53:07 +00:00
Suppress the clippy::type_complexity
lint (#8313)
# Objective The clippy lint `type_complexity` is known not to play well with bevy. It frequently triggers when writing complex queries, and taking the lint's advice of using a type alias almost always just obfuscates the code with no benefit. Because of this, this lint is currently ignored in CI, but unfortunately it still shows up when viewing bevy code in an IDE. As someone who's made a fair amount of pull requests to this repo, I will say that this issue has been a consistent thorn in my side. Since bevy code is filled with spurious, ignorable warnings, it can be very difficult to spot the *real* warnings that must be fixed -- most of the time I just ignore all warnings, only to later find out that one of them was real after I'm done when CI runs. ## Solution Suppress this lint in all bevy crates. This was previously attempted in #7050, but the review process ended up making it more complicated than it needs to be and landed on a subpar solution. The discussion in https://github.com/rust-lang/rust-clippy/pull/10571 explores some better long-term solutions to this problem. Since there is no timeline on when these solutions may land, we should resolve this issue in the meantime by locally suppressing these lints. ### Unresolved issues Currently, these lints are not suppressed in our examples, since that would require suppressing the lint in every single source file. They are still ignored in CI.
This commit is contained in:
parent
b8b0942f49
commit
3ead10a3e0
38 changed files with 57 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
//! Accessibility for Bevy
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
use std::{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//! Animation for the game engine Bevy
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
use std::ops::Deref;
|
||||
use std::time::Duration;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod app;
|
||||
mod main_schedule;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
//! [asset storage]: struct.Assets.html
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod asset_server;
|
||||
mod assets;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//! ```
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
mod audio;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
//! This crate provides core functionality for Bevy Engine.
|
||||
|
||||
mod name;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
pub mod blit;
|
||||
pub mod bloom;
|
||||
pub mod clear_color;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
mod app_plugin;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod diagnostic;
|
||||
mod entity_count_diagnostics_plugin;
|
||||
mod frame_time_diagnostics_plugin;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::single_component_path_imports)]
|
||||
|
||||
//! Forces dynamic linking of Bevy.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod loader;
|
||||
|
||||
pub use loader::*;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![warn(clippy::undocumented_unsafe_blocks)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
// Nothing here, check out the integration tests
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
use bevy_macro_utils::BevyManifest;
|
||||
use encase_derive_impl::{implement, syn};
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod converter;
|
||||
mod gilrs_system;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
//! This crate adds an immediate mode drawing api to Bevy for visual debugging.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
#[cfg(feature = "bevy_animation")]
|
||||
use bevy_animation::AnimationClip;
|
||||
use bevy_utils::HashMap;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
//! `bevy_hierarchy` can be used to define hierarchies of entities.
|
||||
//!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod axis;
|
||||
/// Common run conditions
|
||||
pub mod common_conditions;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org)
|
||||
//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android).
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
mod attrs;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
|
||||
//! like [`Quat`].
|
||||
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
pub mod cubic_splines;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::all)]
|
||||
|
||||
use glam::{Vec2, Vec3};
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
pub mod wireframe;
|
||||
|
||||
mod alpha;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#![doc = include_str!("../README.md")]
|
||||
#![no_std]
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
use core::fmt::{self, Formatter, Pointer};
|
||||
use core::{
|
||||
|
|
|
@ -435,6 +435,7 @@
|
|||
//! [orphan rule]: https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type:~:text=But%20we%20can%E2%80%99t,implementation%20to%20use.
|
||||
//! [`bevy_reflect_derive/documentation`]: bevy_reflect_derive
|
||||
//! [derive `Reflect`]: derive@crate::Reflect
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod array;
|
||||
mod fields;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
compile_error!("bevy_render cannot compile for a 16-bit platform.");
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod bundle;
|
||||
mod dynamic_scene;
|
||||
mod dynamic_scene_builder;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod bundle;
|
||||
mod dynamic_texture_atlas_builder;
|
||||
mod mesh2d;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![warn(missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
mod slice;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
mod error;
|
||||
mod font;
|
||||
mod font_atlas;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
/// Common run conditions
|
||||
pub mod common_conditions;
|
||||
pub mod fixed_timestep;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(clippy::undocumented_unsafe_blocks)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
//! This crate contains Bevy's UI system, which can be used to create UI for both 2D and 3D games
|
||||
//! # Basic usage
|
||||
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
//! General utilities for first-party [Bevy] engine crates.
|
||||
//!
|
||||
//! [Bevy]: https://bevyengine.org/
|
||||
|
||||
//!
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(clippy::undocumented_unsafe_blocks)]
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
|
||||
#[warn(missing_docs)]
|
||||
mod cursor;
|
||||
mod event;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![warn(missing_docs)]
|
||||
//! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`]
|
||||
//!
|
||||
|
|
Loading…
Reference in a new issue