From b453c52242e57eb232b1dc3b450a8f5b1074d7ea Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Sat, 3 Feb 2024 22:40:55 +0100 Subject: [PATCH] Inverse `missing_docs` logic (#11676) # Objective Currently the `missing_docs` lint is allowed-by-default and enabled at crate level when their documentations is complete (see #3492). This PR proposes to inverse this logic by making `missing_docs` warn-by-default and mark crates with imcomplete docs allowed. ## Solution Makes `missing_docs` warn at workspace level and allowed at crate level when the docs is imcomplete. --- Cargo.toml | 1 + crates/bevy_a11y/src/lib.rs | 1 - crates/bevy_animation/src/lib.rs | 2 -- crates/bevy_app/src/lib.rs | 2 -- crates/bevy_asset/macros/src/lib.rs | 3 +++ crates/bevy_asset/src/lib.rs | 3 +++ crates/bevy_audio/src/lib.rs | 1 - crates/bevy_core/src/lib.rs | 2 -- crates/bevy_core_pipeline/src/lib.rs | 3 +++ crates/bevy_derive/src/lib.rs | 3 +++ crates/bevy_diagnostic/src/lib.rs | 3 +++ crates/bevy_dylib/src/lib.rs | 1 - crates/bevy_dynamic_plugin/src/lib.rs | 2 ++ crates/bevy_ecs/examples/change_detection.rs | 15 ++++++++------- crates/bevy_ecs/examples/events.rs | 5 +++-- crates/bevy_ecs/examples/resources.rs | 5 +++-- crates/bevy_ecs/macros/src/lib.rs | 3 +++ crates/bevy_ecs/src/lib.rs | 1 - crates/bevy_encase_derive/src/lib.rs | 3 +++ crates/bevy_gilrs/src/lib.rs | 2 -- crates/bevy_gizmos/src/lib.rs | 4 +--- crates/bevy_gltf/src/lib.rs | 2 -- crates/bevy_hierarchy/src/lib.rs | 1 - crates/bevy_input/src/lib.rs | 2 -- crates/bevy_internal/src/lib.rs | 1 - crates/bevy_log/src/lib.rs | 1 - crates/bevy_macro_utils/src/lib.rs | 1 - crates/bevy_math/src/lib.rs | 2 -- crates/bevy_mikktspace/examples/generate.rs | 4 +++- crates/bevy_mikktspace/src/lib.rs | 2 ++ crates/bevy_pbr/src/lib.rs | 3 +++ crates/bevy_ptr/src/lib.rs | 1 - crates/bevy_reflect/src/lib.rs | 3 +++ crates/bevy_reflect/src/path/mod.rs | 2 -- crates/bevy_render/macros/src/lib.rs | 3 +++ crates/bevy_render/src/lib.rs | 3 +++ crates/bevy_render/src/mesh/primitives/mod.rs | 2 -- crates/bevy_scene/src/lib.rs | 2 -- crates/bevy_sprite/src/lib.rs | 3 +++ crates/bevy_tasks/examples/busy_behavior.rs | 8 ++++---- crates/bevy_tasks/examples/idle_behavior.rs | 8 ++++---- crates/bevy_tasks/src/lib.rs | 1 - crates/bevy_text/src/lib.rs | 3 +++ crates/bevy_time/src/lib.rs | 1 - crates/bevy_transform/src/lib.rs | 1 - crates/bevy_ui/src/lib.rs | 3 +++ crates/bevy_utils/macros/src/lib.rs | 3 +++ crates/bevy_utils/src/lib.rs | 2 -- crates/bevy_window/src/lib.rs | 1 - crates/bevy_winit/src/lib.rs | 1 - crates/bevy_winit/src/winit_windows.rs | 2 -- examples/3d/3d_gizmos.rs | 2 +- examples/3d/generate_custom_mesh.rs | 7 ++++--- examples/3d/lines.rs | 8 ++++---- examples/3d/spotlight.rs | 2 ++ examples/3d/tonemapping.rs | 2 +- examples/animation/cubic_curve.rs | 8 ++------ examples/app/plugin.rs | 2 +- examples/app/plugin_group.rs | 4 ++-- examples/asset/asset_decompression.rs | 6 +++--- examples/asset/custom_asset.rs | 13 +++++++------ examples/asset/processing/asset_processing.rs | 6 +++--- examples/diagnostics/custom_diagnostic.rs | 3 +-- examples/ecs/system_param.rs | 4 ++-- examples/ecs/system_stepping.rs | 2 ++ examples/hello_world.rs | 2 ++ examples/mobile/src/lib.rs | 2 ++ examples/reflection/reflection.rs | 2 +- examples/reflection/reflection_types.rs | 4 ++-- examples/reflection/trait_reflection.rs | 2 +- examples/shader/array_texture.rs | 5 +++-- examples/shader/compute_shader_game_of_life.rs | 6 +++--- examples/shader/custom_vertex_attribute.rs | 2 +- examples/shader/post_processing.rs | 2 +- examples/shader/shader_defs.rs | 4 ++-- examples/shader/shader_instancing.rs | 8 ++++---- examples/shader/shader_material.rs | 2 +- examples/shader/shader_material_2d.rs | 2 +- examples/shader/shader_material_glsl.rs | 2 +- .../shader/shader_material_screenspace_texture.rs | 2 +- examples/shader/shader_prepass.rs | 4 ++-- examples/stress_tests/many_buttons.rs | 3 ++- examples/stress_tests/many_gizmos.rs | 2 ++ examples/time/time.rs | 2 ++ examples/time/timers.rs | 8 ++++---- 85 files changed, 149 insertions(+), 123 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 88df3f64f937bb..8a3dbed40f9a70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ map_flatten = "warn" [workspace.lints.rust] unsafe_op_in_unsafe_fn = "warn" +missing_docs = "warn" [lints] workspace = true diff --git a/crates/bevy_a11y/src/lib.rs b/crates/bevy_a11y/src/lib.rs index 44e4f5cb9031ab..53a515c7eeb6d5 100644 --- a/crates/bevy_a11y/src/lib.rs +++ b/crates/bevy_a11y/src/lib.rs @@ -1,6 +1,5 @@ //! Accessibility for Bevy -#![warn(missing_docs)] #![forbid(unsafe_code)] use std::sync::{ diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 43d66fd2d81bbb..5771e2e9da5104 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -1,7 +1,5 @@ //! Animation for the game engine Bevy -#![warn(missing_docs)] - mod animatable; mod util; diff --git a/crates/bevy_app/src/lib.rs b/crates/bevy_app/src/lib.rs index dfcd0dc99db1fd..8f6ba7972f2723 100644 --- a/crates/bevy_app/src/lib.rs +++ b/crates/bevy_app/src/lib.rs @@ -1,7 +1,5 @@ //! This crate is about everything concerning the highest-level, application layer of a Bevy app. -#![warn(missing_docs)] - mod app; mod main_schedule; mod plugin; diff --git a/crates/bevy_asset/macros/src/lib.rs b/crates/bevy_asset/macros/src/lib.rs index 952cf8d7d7aec4..8dc8975f2352bc 100644 --- a/crates/bevy_asset/macros/src/lib.rs +++ b/crates/bevy_asset/macros/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + use bevy_macro_utils::BevyManifest; use proc_macro::{Span, TokenStream}; use quote::{format_ident, quote}; diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index 49703ff3ece21f..4f0d259d45b0d5 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + pub mod io; pub mod meta; pub mod processor; diff --git a/crates/bevy_audio/src/lib.rs b/crates/bevy_audio/src/lib.rs index ecba57bf0df953..c0968775982475 100644 --- a/crates/bevy_audio/src/lib.rs +++ b/crates/bevy_audio/src/lib.rs @@ -21,7 +21,6 @@ //! ``` #![forbid(unsafe_code)] -#![warn(missing_docs)] mod audio; mod audio_output; diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 708b006d7d293e..eff6851e30457a 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -1,5 +1,3 @@ -#![warn(missing_docs)] - //! This crate provides core functionality for Bevy Engine. mod name; diff --git a/crates/bevy_core_pipeline/src/lib.rs b/crates/bevy_core_pipeline/src/lib.rs index 5aad6703eda56b..af59f5f1102677 100644 --- a/crates/bevy_core_pipeline/src/lib.rs +++ b/crates/bevy_core_pipeline/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + pub mod blit; pub mod bloom; pub mod contrast_adaptive_sharpening; diff --git a/crates/bevy_derive/src/lib.rs b/crates/bevy_derive/src/lib.rs index 18d61262ee0fdb..fda825dc161a66 100644 --- a/crates/bevy_derive/src/lib.rs +++ b/crates/bevy_derive/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + extern crate proc_macro; mod app_plugin; diff --git a/crates/bevy_diagnostic/src/lib.rs b/crates/bevy_diagnostic/src/lib.rs index e16360a2d49623..095eed2e71df02 100644 --- a/crates/bevy_diagnostic/src/lib.rs +++ b/crates/bevy_diagnostic/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + //! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/). //! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing //! their ability to monitor and optimize their game's. diff --git a/crates/bevy_dylib/src/lib.rs b/crates/bevy_dylib/src/lib.rs index a950f985d611a2..9aefb17ace32f0 100644 --- a/crates/bevy_dylib/src/lib.rs +++ b/crates/bevy_dylib/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] #![allow(clippy::single_component_path_imports)] //! Forces dynamic linking of Bevy. diff --git a/crates/bevy_dynamic_plugin/src/lib.rs b/crates/bevy_dynamic_plugin/src/lib.rs index 76a593de45d3b1..0a86b83b8aa289 100644 --- a/crates/bevy_dynamic_plugin/src/lib.rs +++ b/crates/bevy_dynamic_plugin/src/lib.rs @@ -1,5 +1,7 @@ // FIXME(11590): remove this once the lint is fixed #![allow(unsafe_op_in_unsafe_fn)] +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] mod loader; diff --git a/crates/bevy_ecs/examples/change_detection.rs b/crates/bevy_ecs/examples/change_detection.rs index 8bfa18d735f6df..0f49c5e709f7dc 100644 --- a/crates/bevy_ecs/examples/change_detection.rs +++ b/crates/bevy_ecs/examples/change_detection.rs @@ -1,14 +1,15 @@ +//! In this example we will simulate a population of entities. In every tick we will: +//! 1. spawn a new entity with a certain possibility +//! 2. age all entities +//! 3. despawn entities with age > 2 +//! +//! To demonstrate change detection, there are some console outputs based on changes in +//! the `EntityCounter` resource and updated Age components + use bevy_ecs::prelude::*; use rand::Rng; use std::ops::Deref; -// In this example we will simulate a population of entities. In every tick we will: -// 1. spawn a new entity with a certain possibility -// 2. age all entities -// 3. despawn entities with age > 2 -// -// To demonstrate change detection, there are some console outputs based on changes in -// the EntityCounter resource and updated Age components fn main() { // Create a new empty World to hold our Entities, Components and Resources let mut world = World::new(); diff --git a/crates/bevy_ecs/examples/events.rs b/crates/bevy_ecs/examples/events.rs index 7be6795880775e..f75ca81b50b5fb 100644 --- a/crates/bevy_ecs/examples/events.rs +++ b/crates/bevy_ecs/examples/events.rs @@ -1,7 +1,8 @@ +//! In this example a system sends a custom event with a 50/50 chance during any frame. +//! If an event was send, it will be printed by the console in a receiving system. + use bevy_ecs::prelude::*; -// In this example a system sends a custom event with a 50/50 chance during any frame. -// If an event was send, it will be printed by the console in a receiving system. fn main() { // Create a new empty world and add the event as a resource let mut world = World::new(); diff --git a/crates/bevy_ecs/examples/resources.rs b/crates/bevy_ecs/examples/resources.rs index b1f170ef9d6199..e8d6a9bc10cceb 100644 --- a/crates/bevy_ecs/examples/resources.rs +++ b/crates/bevy_ecs/examples/resources.rs @@ -1,9 +1,10 @@ +//! In this example we add a counter resource and increase it's value in one system, +//! while a different system prints the current count to the console. + use bevy_ecs::prelude::*; use rand::Rng; use std::ops::Deref; -// In this example we add a counter resource and increase it's value in one system, -// while a different system prints the current count to the console. fn main() { // Create a world let mut world = World::new(); diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs index f9d3f0314ba029..43b1fe65913247 100644 --- a/crates/bevy_ecs/macros/src/lib.rs +++ b/crates/bevy_ecs/macros/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + extern crate proc_macro; mod component; diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index 4f527bfd963893..6b63156d48c655 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -1,6 +1,5 @@ // FIXME(11590): remove this once the lint is fixed #![allow(unsafe_op_in_unsafe_fn)] -#![warn(missing_docs)] #![doc = include_str!("../README.md")] #[cfg(target_pointer_width = "16")] diff --git a/crates/bevy_encase_derive/src/lib.rs b/crates/bevy_encase_derive/src/lib.rs index d57be9f85c7c51..e09bc4b247d1a9 100644 --- a/crates/bevy_encase_derive/src/lib.rs +++ b/crates/bevy_encase_derive/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + use bevy_macro_utils::BevyManifest; use encase_derive_impl::{implement, syn}; diff --git a/crates/bevy_gilrs/src/lib.rs b/crates/bevy_gilrs/src/lib.rs index 46867b73a2f961..b48256b8db826b 100644 --- a/crates/bevy_gilrs/src/lib.rs +++ b/crates/bevy_gilrs/src/lib.rs @@ -3,8 +3,6 @@ //! This crate is built on top of [GilRs](gilrs), a library //! that handles abstracting over platform-specific gamepad APIs. -#![warn(missing_docs)] - mod converter; mod gilrs_system; mod rumble; diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 41022bcf4cad68..70e3afd11dd8e9 100644 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -1,5 +1,3 @@ -#![warn(missing_docs)] - //! This crate adds an immediate mode drawing api to Bevy for visual debugging. //! //! # Example @@ -79,7 +77,7 @@ use bevy_render::{ renderer::RenderDevice, Extract, ExtractSchedule, Render, RenderApp, RenderSet, }; -use bevy_utils::{tracing::warn, HashMap}; +use bevy_utils::HashMap; use config::{ DefaultGizmoConfigGroup, GizmoConfig, GizmoConfigGroup, GizmoConfigStore, GizmoMeshConfig, }; diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs index 0e7e882d231f31..5e8d8e3f1cb46b 100644 --- a/crates/bevy_gltf/src/lib.rs +++ b/crates/bevy_gltf/src/lib.rs @@ -3,8 +3,6 @@ //! //! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files. -#![warn(missing_docs)] - #[cfg(feature = "bevy_animation")] use bevy_animation::AnimationClip; use bevy_utils::HashMap; diff --git a/crates/bevy_hierarchy/src/lib.rs b/crates/bevy_hierarchy/src/lib.rs index da4b33f341bd37..83c0a10569ea33 100644 --- a/crates/bevy_hierarchy/src/lib.rs +++ b/crates/bevy_hierarchy/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] //! Parent-child relationships for Bevy entities. //! //! You should use the tools in this crate diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs index d08ed93ce890ea..e6841ace816368 100644 --- a/crates/bevy_input/src/lib.rs +++ b/crates/bevy_input/src/lib.rs @@ -1,5 +1,3 @@ -#![warn(missing_docs)] - //! Input functionality for the [Bevy game engine](https://bevyengine.org/). //! //! # Supported input devices diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs index 98dc5eeb3b126c..04d364493805c2 100644 --- a/crates/bevy_internal/src/lib.rs +++ b/crates/bevy_internal/src/lib.rs @@ -1,4 +1,3 @@ -#![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. diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index b60c154dc64e20..791b1565360702 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -1,4 +1,3 @@ -#![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). //! diff --git a/crates/bevy_macro_utils/src/lib.rs b/crates/bevy_macro_utils/src/lib.rs index d14a2c6db7eef3..443313f8e87bda 100644 --- a/crates/bevy_macro_utils/src/lib.rs +++ b/crates/bevy_macro_utils/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] #![deny(unsafe_code)] //! A collection of helper types and functions for working on macros within the Bevy ecosystem. diff --git a/crates/bevy_math/src/lib.rs b/crates/bevy_math/src/lib.rs index 0fd8717964f4bc..d4ac8b6158ee31 100644 --- a/crates/bevy_math/src/lib.rs +++ b/crates/bevy_math/src/lib.rs @@ -4,8 +4,6 @@ //! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations //! like [`Quat`]. -#![warn(missing_docs)] - mod affine3; mod aspect_ratio; pub mod bounding; diff --git a/crates/bevy_mikktspace/examples/generate.rs b/crates/bevy_mikktspace/examples/generate.rs index a8cefb8809ff4e..6ca3fa36df06e2 100644 --- a/crates/bevy_mikktspace/examples/generate.rs +++ b/crates/bevy_mikktspace/examples/generate.rs @@ -1,8 +1,10 @@ +//! This example demonstrates how to generate a mesh. + #![allow(clippy::bool_assert_comparison, clippy::useless_conversion)] use glam::{Vec2, Vec3}; -pub type Face = [u32; 3]; +type Face = [u32; 3]; #[derive(Debug)] struct Vertex { diff --git a/crates/bevy_mikktspace/src/lib.rs b/crates/bevy_mikktspace/src/lib.rs index 50cf1ea7d5c574..b7d43a79da634e 100644 --- a/crates/bevy_mikktspace/src/lib.rs +++ b/crates/bevy_mikktspace/src/lib.rs @@ -3,6 +3,8 @@ clippy::all, clippy::undocumented_unsafe_blocks )] +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] use glam::{Vec2, Vec3}; diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index c1556c8d360d1b..7a3edeb1b6de67 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + pub mod wireframe; mod alpha; diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs index 861219155e2528..73a0ab5555b0ce 100644 --- a/crates/bevy_ptr/src/lib.rs +++ b/crates/bevy_ptr/src/lib.rs @@ -1,6 +1,5 @@ #![doc = include_str!("../README.md")] #![no_std] -#![warn(missing_docs)] use core::fmt::{self, Formatter, Pointer}; use core::{ diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs index 9447cd41a6701a..15d61b1bba2a89 100644 --- a/crates/bevy_reflect/src/lib.rs +++ b/crates/bevy_reflect/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + //! Reflection in Rust. //! //! [Reflection] is a powerful tool provided within many programming languages diff --git a/crates/bevy_reflect/src/path/mod.rs b/crates/bevy_reflect/src/path/mod.rs index 4f08805a9d60a5..ce22d86e5c32fe 100644 --- a/crates/bevy_reflect/src/path/mod.rs +++ b/crates/bevy_reflect/src/path/mod.rs @@ -1,5 +1,3 @@ -#![warn(missing_docs)] - pub mod access; pub use access::*; diff --git a/crates/bevy_render/macros/src/lib.rs b/crates/bevy_render/macros/src/lib.rs index c0d04e6c776a38..43af3eff89b644 100644 --- a/crates/bevy_render/macros/src/lib.rs +++ b/crates/bevy_render/macros/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + mod as_bind_group; mod extract_component; mod extract_resource; diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index d159bb94eb0c71..d94c60d14c7257 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + #[cfg(target_pointer_width = "16")] compile_error!("bevy_render cannot compile for a 16-bit platform."); diff --git a/crates/bevy_render/src/mesh/primitives/mod.rs b/crates/bevy_render/src/mesh/primitives/mod.rs index b05b3645cfe18e..de9e7f538984c4 100644 --- a/crates/bevy_render/src/mesh/primitives/mod.rs +++ b/crates/bevy_render/src/mesh/primitives/mod.rs @@ -19,8 +19,6 @@ //! # } //! ``` -#![warn(missing_docs)] - mod dim2; pub use dim2::{CircleMeshBuilder, EllipseMeshBuilder}; diff --git a/crates/bevy_scene/src/lib.rs b/crates/bevy_scene/src/lib.rs index cb4988c8be8b1d..19b18a8f6a9123 100644 --- a/crates/bevy_scene/src/lib.rs +++ b/crates/bevy_scene/src/lib.rs @@ -4,8 +4,6 @@ //! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized, //! for example to save part of the world state to a file. -#![warn(missing_docs)] - mod bundle; mod dynamic_scene; mod dynamic_scene_builder; diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs index 9c085149e610ef..f4f13ceb75a492 100644 --- a/crates/bevy_sprite/src/lib.rs +++ b/crates/bevy_sprite/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + //! Provides 2D sprite rendering functionality. mod bundle; mod dynamic_texture_atlas_builder; diff --git a/crates/bevy_tasks/examples/busy_behavior.rs b/crates/bevy_tasks/examples/busy_behavior.rs index 23a43de017a59a..ee92ec359382ce 100644 --- a/crates/bevy_tasks/examples/busy_behavior.rs +++ b/crates/bevy_tasks/examples/busy_behavior.rs @@ -1,10 +1,10 @@ +//! This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin +//! for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical +//! cores) + use bevy_tasks::TaskPoolBuilder; use web_time::{Duration, Instant}; -// This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin -// for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical -// cores) - fn main() { let pool = TaskPoolBuilder::new() .thread_name("Busy Behavior ThreadPool".to_string()) diff --git a/crates/bevy_tasks/examples/idle_behavior.rs b/crates/bevy_tasks/examples/idle_behavior.rs index 3ce121f989fc35..2887163170875d 100644 --- a/crates/bevy_tasks/examples/idle_behavior.rs +++ b/crates/bevy_tasks/examples/idle_behavior.rs @@ -1,10 +1,10 @@ +//! This sample demonstrates a thread pool with one thread per logical core and only one task +//! spinning. Other than the one thread, the system should remain idle, demonstrating good behavior +//! for small workloads. + use bevy_tasks::TaskPoolBuilder; use web_time::{Duration, Instant}; -// This sample demonstrates a thread pool with one thread per logical core and only one task -// spinning. Other than the one thread, the system should remain idle, demonstrating good behavior -// for small workloads. - fn main() { let pool = TaskPoolBuilder::new() .thread_name("Idle Behavior ThreadPool".to_string()) diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs index 7b998c0db39099..69af666d9a545a 100644 --- a/crates/bevy_tasks/src/lib.rs +++ b/crates/bevy_tasks/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] #![doc = include_str!("../README.md")] mod slice; diff --git a/crates/bevy_text/src/lib.rs b/crates/bevy_text/src/lib.rs index d0b5752266f556..4ff8434cf7369d 100644 --- a/crates/bevy_text/src/lib.rs +++ b/crates/bevy_text/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + mod error; mod font; mod font_atlas; diff --git a/crates/bevy_time/src/lib.rs b/crates/bevy_time/src/lib.rs index fd2134e0f031b7..98c075e9985ff6 100644 --- a/crates/bevy_time/src/lib.rs +++ b/crates/bevy_time/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] #![doc = include_str!("../README.md")] /// Common run conditions diff --git a/crates/bevy_transform/src/lib.rs b/crates/bevy_transform/src/lib.rs index b8c0034355c55f..c44c120b0146ae 100644 --- a/crates/bevy_transform/src/lib.rs +++ b/crates/bevy_transform/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] #![doc = include_str!("../README.md")] pub mod commands; diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs index 8bb1bd20a5b061..7545971e42e058 100644 --- a/crates/bevy_ui/src/lib.rs +++ b/crates/bevy_ui/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + //! 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`] diff --git a/crates/bevy_utils/macros/src/lib.rs b/crates/bevy_utils/macros/src/lib.rs index 4189b432ac6058..9b1fb1cfe5f254 100644 --- a/crates/bevy_utils/macros/src/lib.rs +++ b/crates/bevy_utils/macros/src/lib.rs @@ -1,3 +1,6 @@ +// FIXME(3492): remove once docs are ready +#![allow(missing_docs)] + use proc_macro::TokenStream; use quote::{format_ident, quote}; use syn::{ diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index 37a8380e4d06ab..b70ee02ebe4bc6 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -3,8 +3,6 @@ //! [Bevy]: https://bevyengine.org/ //! -#![warn(missing_docs)] - #[allow(missing_docs)] pub mod prelude { pub use crate::default; diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs index ae83d4f5016b90..0c7eb48e8dc50c 100644 --- a/crates/bevy_window/src/lib.rs +++ b/crates/bevy_window/src/lib.rs @@ -1,4 +1,3 @@ -#![warn(missing_docs)] //! `bevy_window` provides a platform-agnostic interface for windowing in Bevy. //! //! This crate contains types for window management and events, diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index 63d79b1d23d238..2ea7736d1c75fc 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -1,4 +1,3 @@ -#![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 diff --git a/crates/bevy_winit/src/winit_windows.rs b/crates/bevy_winit/src/winit_windows.rs index be7b3ffac2f025..484a7669f4a233 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -1,5 +1,3 @@ -#![warn(missing_docs)] - use accesskit_winit::Adapter; use bevy_a11y::{ accesskit::{NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate}, diff --git a/examples/3d/3d_gizmos.rs b/examples/3d/3d_gizmos.rs index d4a69362437f14..c54c20c2617585 100644 --- a/examples/3d/3d_gizmos.rs +++ b/examples/3d/3d_gizmos.rs @@ -25,7 +25,7 @@ fn main() { struct MyRoundGizmos {} #[derive(Debug, Clone, Resource)] -pub struct PrimitiveSegments(usize); +struct PrimitiveSegments(usize); impl Default for PrimitiveSegments { fn default() -> Self { Self(10) diff --git a/examples/3d/generate_custom_mesh.rs b/examples/3d/generate_custom_mesh.rs index 3169b897e76aa6..1c9cf0d067e908 100644 --- a/examples/3d/generate_custom_mesh.rs +++ b/examples/3d/generate_custom_mesh.rs @@ -1,6 +1,7 @@ -// ! This example demonstrates how to create a custom mesh, -// ! assign a custom UV mapping for a custom texture, -// ! and how to change the UV mapping at run-time. +//! This example demonstrates how to create a custom mesh, +//! assign a custom UV mapping for a custom texture, +//! and how to change the UV mapping at run-time. + use bevy::prelude::*; use bevy::render::{ mesh::{Indices, VertexAttributeValues}, diff --git a/examples/3d/lines.rs b/examples/3d/lines.rs index 5be486169561d4..fa6158aa702599 100644 --- a/examples/3d/lines.rs +++ b/examples/3d/lines.rs @@ -87,8 +87,8 @@ impl Material for LineMaterial { /// A list of lines with a start and end position #[derive(Debug, Clone)] -pub struct LineList { - pub lines: Vec<(Vec3, Vec3)>, +struct LineList { + lines: Vec<(Vec3, Vec3)>, } impl From for Mesh { @@ -108,8 +108,8 @@ impl From for Mesh { /// A list of points that will have a line drawn between each consecutive points #[derive(Debug, Clone)] -pub struct LineStrip { - pub points: Vec, +struct LineStrip { + points: Vec, } impl From for Mesh { diff --git a/examples/3d/spotlight.rs b/examples/3d/spotlight.rs index 533dc9dd2b8179..93cdd3ea6668f8 100644 --- a/examples/3d/spotlight.rs +++ b/examples/3d/spotlight.rs @@ -1,3 +1,5 @@ +//! Illustrates spot lights. + use std::f32::consts::*; use bevy::{ diff --git a/examples/3d/tonemapping.rs b/examples/3d/tonemapping.rs index db4d4a9e230676..9c168415b8de67 100644 --- a/examples/3d/tonemapping.rs +++ b/examples/3d/tonemapping.rs @@ -704,7 +704,7 @@ impl Material for ColorGradientMaterial { } #[derive(Asset, TypePath, AsBindGroup, Debug, Clone)] -pub struct ColorGradientMaterial {} +struct ColorGradientMaterial {} #[derive(Resource)] struct CameraTransform(Transform); diff --git a/examples/animation/cubic_curve.rs b/examples/animation/cubic_curve.rs index 9b20b516181190..fba1dfd34fa549 100644 --- a/examples/animation/cubic_curve.rs +++ b/examples/animation/cubic_curve.rs @@ -6,7 +6,7 @@ use bevy::{ }; #[derive(Component)] -pub struct Curve(CubicCurve); +struct Curve(CubicCurve); fn main() { App::new() @@ -72,11 +72,7 @@ fn setup( }); } -pub fn animate_cube( - time: Res