From d3b93a9aae08ea66330c67f1090a18bd467855a6 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Thu, 24 Aug 2023 10:30:56 +0200 Subject: [PATCH 1/2] Move crate attributes after docs --- crates/bevy_core/src/lib.rs | 3 ++- crates/bevy_dylib/src/lib.rs | 8 ++++---- crates/bevy_ecs/src/lib.rs | 3 ++- crates/bevy_gizmos/src/lib.rs | 6 +++--- crates/bevy_hierarchy/src/lib.rs | 5 +++-- crates/bevy_input/src/lib.rs | 6 +++--- crates/bevy_internal/src/lib.rs | 3 ++- crates/bevy_log/src/lib.rs | 5 +++-- crates/bevy_ptr/src/lib.rs | 1 + crates/bevy_tasks/src/lib.rs | 3 ++- crates/bevy_time/src/lib.rs | 3 ++- crates/bevy_transform/src/lib.rs | 3 ++- crates/bevy_ui/src/lib.rs | 5 +++-- crates/bevy_utils/src/lib.rs | 1 + crates/bevy_winit/src/lib.rs | 5 +++-- 15 files changed, 36 insertions(+), 24 deletions(-) diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 977f01489f286..b3d019ca26258 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -1,6 +1,7 @@ +//! This crate provides core functionality for Bevy Engine. + #![warn(missing_docs)] #![allow(clippy::type_complexity)] -//! This crate provides core functionality for Bevy Engine. mod name; #[cfg(feature = "serialize")] diff --git a/crates/bevy_dylib/src/lib.rs b/crates/bevy_dylib/src/lib.rs index 2c5d6429676b5..8f144050a970c 100644 --- a/crates/bevy_dylib/src/lib.rs +++ b/crates/bevy_dylib/src/lib.rs @@ -1,7 +1,3 @@ -#![warn(missing_docs)] -#![allow(clippy::type_complexity)] -#![allow(clippy::single_component_path_imports)] - //! Forces dynamic linking of Bevy. //! //! Dynamic linking causes Bevy to be built and linked as a dynamic library. This will make @@ -51,6 +47,10 @@ //! use bevy_dylib; //! ``` +#![warn(missing_docs)] +#![allow(clippy::type_complexity)] +#![allow(clippy::single_component_path_imports)] + // Force linking of the main bevy crate #[allow(unused_imports)] use bevy_internal; diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index cb91dae60351e..5ccb10a305229 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -1,7 +1,8 @@ +#![doc = include_str!("../README.md")] + #![warn(clippy::undocumented_unsafe_blocks)] #![warn(missing_docs)] #![allow(clippy::type_complexity)] -#![doc = include_str!("../README.md")] #[cfg(target_pointer_width = "16")] compile_error!("bevy_ecs cannot safely compile for a 16-bit platform."); diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 5d21be330a2cb..c7db2dfc48685 100644 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -1,6 +1,3 @@ -#![allow(clippy::type_complexity)] -#![warn(missing_docs)] - //! This crate adds an immediate mode drawing api to Bevy for visual debugging. //! //! # Example @@ -16,6 +13,9 @@ //! //! See the documentation on [`Gizmos`](crate::gizmos::Gizmos) for more examples. +#![allow(clippy::type_complexity)] +#![warn(missing_docs)] + use std::mem; use bevy_app::{Last, Plugin, PostUpdate}; diff --git a/crates/bevy_hierarchy/src/lib.rs b/crates/bevy_hierarchy/src/lib.rs index d616e5384ae13..3a0040cac0f60 100644 --- a/crates/bevy_hierarchy/src/lib.rs +++ b/crates/bevy_hierarchy/src/lib.rs @@ -1,10 +1,11 @@ -#![allow(clippy::type_complexity)] -#![warn(missing_docs)] //! `bevy_hierarchy` can be used to define hierarchies of entities. //! //! Most commonly, these hierarchies are used for inheriting `Transform` values //! from the [`Parent`] to its [`Children`]. +#![allow(clippy::type_complexity)] +#![warn(missing_docs)] + mod components; pub use components::*; diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs index 7af8fec03add2..2c582a21c9b60 100644 --- a/crates/bevy_input/src/lib.rs +++ b/crates/bevy_input/src/lib.rs @@ -1,12 +1,12 @@ -#![allow(clippy::type_complexity)] -#![warn(missing_docs)] - //! Input functionality for the [Bevy game engine](https://bevyengine.org/). //! //! # Supported input devices //! //! `bevy` currently supports keyboard, mouse, gamepad, and touch inputs. +#![allow(clippy::type_complexity)] +#![warn(missing_docs)] + mod axis; /// Common run conditions pub mod common_conditions; diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs index 723e65afd9c8f..d2fb9e726e620 100644 --- a/crates/bevy_internal/src/lib.rs +++ b/crates/bevy_internal/src/lib.rs @@ -1,6 +1,7 @@ +//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly + #![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 /// `use bevy::prelude::*;` to import common components, bundles, and plugins. pub mod prelude; diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index a912d7d984b5c..c3d65c7201fbe 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -1,5 +1,3 @@ -#![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). //! @@ -12,6 +10,9 @@ //! For more fine-tuned control over logging behavior, set up the [`LogPlugin`] or //! `DefaultPlugins` during app initialization. +#![allow(clippy::type_complexity)] +#![warn(missing_docs)] + #[cfg(feature = "trace")] use std::panic; diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs index f6212c505ba70..c3deef9e529ef 100644 --- a/crates/bevy_ptr/src/lib.rs +++ b/crates/bevy_ptr/src/lib.rs @@ -1,4 +1,5 @@ #![doc = include_str!("../README.md")] + #![no_std] #![warn(missing_docs)] #![allow(clippy::type_complexity)] diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs index b97d2e9df466b..3d87a30a4cc8f 100644 --- a/crates/bevy_tasks/src/lib.rs +++ b/crates/bevy_tasks/src/lib.rs @@ -1,6 +1,7 @@ +#![doc = include_str!("../README.md")] + #![warn(missing_docs)] #![allow(clippy::type_complexity)] -#![doc = include_str!("../README.md")] mod slice; pub use slice::{ParallelSlice, ParallelSliceMut}; diff --git a/crates/bevy_time/src/lib.rs b/crates/bevy_time/src/lib.rs index 8850572b35961..87a43f15b31b8 100644 --- a/crates/bevy_time/src/lib.rs +++ b/crates/bevy_time/src/lib.rs @@ -1,6 +1,7 @@ +#![doc = include_str!("../README.md")] + #![allow(clippy::type_complexity)] #![warn(missing_docs)] -#![doc = include_str!("../README.md")] /// Common run conditions pub mod common_conditions; diff --git a/crates/bevy_transform/src/lib.rs b/crates/bevy_transform/src/lib.rs index 50444acd8b089..ee22ae3bbc4ef 100644 --- a/crates/bevy_transform/src/lib.rs +++ b/crates/bevy_transform/src/lib.rs @@ -1,7 +1,8 @@ +#![doc = include_str!("../README.md")] + #![allow(clippy::type_complexity)] #![warn(missing_docs)] #![warn(clippy::undocumented_unsafe_blocks)] -#![doc = include_str!("../README.md")] pub mod commands; /// The basic components of the transform crate diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs index 1752180b77d86..6418beedfc97b 100644 --- a/crates/bevy_ui/src/lib.rs +++ b/crates/bevy_ui/src/lib.rs @@ -1,9 +1,10 @@ -#![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`] //! This UI is laid out with the Flexbox and CSS Grid layout models (see ) + +#![allow(clippy::type_complexity)] + mod focus; mod geometry; mod layout; diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index 3dc32e81d8904..fde7f6760d58c 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -2,6 +2,7 @@ //! //! [Bevy]: https://bevyengine.org/ //! + #![allow(clippy::type_complexity)] #![warn(missing_docs)] #![warn(clippy::undocumented_unsafe_blocks)] diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index 504c70ac43ab6..e2aee231bf577 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::type_complexity)] -#![warn(missing_docs)] //! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`] //! //! Most commonly, the [`WinitPlugin`] is used as part of @@ -7,6 +5,9 @@ //! The app's [runner](bevy_app::App::runner) is set by `WinitPlugin` and handles the `winit` [`EventLoop`](winit::event_loop::EventLoop). //! See `winit_runner` for details. +#![allow(clippy::type_complexity)] +#![warn(missing_docs)] + pub mod accessibility; mod converters; mod system; From df0691d32d6b4368438959531fca09cc4dcb3163 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Thu, 24 Aug 2023 10:34:15 +0200 Subject: [PATCH 2/2] cargo fmt --- crates/bevy_ecs/src/lib.rs | 1 - crates/bevy_ptr/src/lib.rs | 1 - crates/bevy_tasks/src/lib.rs | 1 - crates/bevy_time/src/lib.rs | 1 - crates/bevy_transform/src/lib.rs | 1 - 5 files changed, 5 deletions(-) diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index 5ccb10a305229..8b50300a5d1e6 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![warn(clippy::undocumented_unsafe_blocks)] #![warn(missing_docs)] #![allow(clippy::type_complexity)] diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs index c3deef9e529ef..f6212c505ba70 100644 --- a/crates/bevy_ptr/src/lib.rs +++ b/crates/bevy_ptr/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![no_std] #![warn(missing_docs)] #![allow(clippy::type_complexity)] diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs index 3d87a30a4cc8f..edb7ca3bdedc5 100644 --- a/crates/bevy_tasks/src/lib.rs +++ b/crates/bevy_tasks/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![warn(missing_docs)] #![allow(clippy::type_complexity)] diff --git a/crates/bevy_time/src/lib.rs b/crates/bevy_time/src/lib.rs index 87a43f15b31b8..96afbdc23ae25 100644 --- a/crates/bevy_time/src/lib.rs +++ b/crates/bevy_time/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![allow(clippy::type_complexity)] #![warn(missing_docs)] diff --git a/crates/bevy_transform/src/lib.rs b/crates/bevy_transform/src/lib.rs index ee22ae3bbc4ef..704e195191636 100644 --- a/crates/bevy_transform/src/lib.rs +++ b/crates/bevy_transform/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![allow(clippy::type_complexity)] #![warn(missing_docs)] #![warn(clippy::undocumented_unsafe_blocks)]