From 694c06f3d03c4435dd07aa946cc58d6eaf17cbc7 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 88df3f64f9..8a3dbed40f 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 44e4f5cb90..53a515c7ee 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 43d66fd2d8..5771e2e9da 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 dfcd0dc99d..8f6ba7972f 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 952cf8d7d7..8dc8975f23 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 49703ff3ec..4f0d259d45 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 ecba57bf0d..c096877598 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 708b006d7d..eff6851e30 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 5aad6703ed..af59f5f110 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 18d61262ee..fda825dc16 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 e16360a2d4..095eed2e71 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 a950f985d6..9aefb17ace 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 76a593de45..0a86b83b8a 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 8bfa18d735..0f49c5e709 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 7be6795880..f75ca81b50 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 b1f170ef9d..e8d6a9bc10 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 f9d3f0314b..43b1fe6591 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 4f527bfd96..6b63156d48 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 d57be9f85c..e09bc4b247 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 46867b73a2..b48256b8db 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 41022bcf4c..70e3afd11d 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 0e7e882d23..5e8d8e3f1c 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 da4b33f341..83c0a10569 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 d08ed93ce8..e6841ace81 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 98dc5eeb3b..04d3644938 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 b60c154dc6..791b156536 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 d14a2c6db7..443313f8e8 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 0fd8717964..d4ac8b6158 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 a8cefb8809..6ca3fa36df 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 50cf1ea7d5..b7d43a79da 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 c1556c8d36..7a3edeb1b6 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 861219155e..73a0ab5555 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 9447cd41a6..15d61b1bba 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 4f08805a9d..ce22d86e5c 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 c0d04e6c77..43af3eff89 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 d159bb94eb..d94c60d14c 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 b05b3645cf..de9e7f5389 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 cb4988c8be..19b18a8f6a 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 9c085149e6..f4f13ceb75 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 23a43de017..ee92ec3593 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 3ce121f989..2887163170 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 7b998c0db3..69af666d9a 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 d0b5752266..4ff8434cf7 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 fd2134e0f0..98c075e998 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 b8c0034355..c44c120b01 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 8bb1bd20a5..7545971e42 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 4189b432ac..9b1fb1cfe5 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 37a8380e4d..b70ee02ebe 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 ae83d4f501..0c7eb48e8d 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 63d79b1d23..2ea7736d1c 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 be7b3ffac2..484a7669f4 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 d4a6936243..c54c20c261 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 3169b897e7..1c9cf0d067 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 5be4861695..fa6158aa70 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 533dc9dd2b..93cdd3ea66 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 db4d4a9e23..9c168415b8 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 9b20b51618..fba1dfd34f 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