Skip to content

Commit 694c06f

Browse files
authored
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.
1 parent 55493a8 commit 694c06f

File tree

85 files changed

+149
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+149
-123
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ map_flatten = "warn"
4242

4343
[workspace.lints.rust]
4444
unsafe_op_in_unsafe_fn = "warn"
45+
missing_docs = "warn"
4546

4647
[lints]
4748
workspace = true

crates/bevy_a11y/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Accessibility for Bevy
22
3-
#![warn(missing_docs)]
43
#![forbid(unsafe_code)]
54

65
use std::sync::{

crates/bevy_animation/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Animation for the game engine Bevy
22
3-
#![warn(missing_docs)]
4-
53
mod animatable;
64
mod util;
75

crates/bevy_app/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
22
3-
#![warn(missing_docs)]
4-
53
mod app;
64
mod main_schedule;
75
mod plugin;

crates/bevy_asset/macros/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
use bevy_macro_utils::BevyManifest;
25
use proc_macro::{Span, TokenStream};
36
use quote::{format_ident, quote};

crates/bevy_asset/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
pub mod io;
25
pub mod meta;
36
pub mod processor;

crates/bevy_audio/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
//! ```
2222
2323
#![forbid(unsafe_code)]
24-
#![warn(missing_docs)]
2524

2625
mod audio;
2726
mod audio_output;

crates/bevy_core/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![warn(missing_docs)]
2-
31
//! This crate provides core functionality for Bevy Engine.
42
53
mod name;

crates/bevy_core_pipeline/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
pub mod blit;
25
pub mod bloom;
36
pub mod contrast_adaptive_sharpening;

crates/bevy_derive/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
extern crate proc_macro;
25

36
mod app_plugin;

crates/bevy_diagnostic/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
//! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/).
25
//! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing
36
//! their ability to monitor and optimize their game's.

crates/bevy_dylib/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
#![allow(clippy::single_component_path_imports)]
32

43
//! Forces dynamic linking of Bevy.

crates/bevy_dynamic_plugin/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// FIXME(11590): remove this once the lint is fixed
22
#![allow(unsafe_op_in_unsafe_fn)]
3+
// FIXME(3492): remove once docs are ready
4+
#![allow(missing_docs)]
35

46
mod loader;
57

crates/bevy_ecs/examples/change_detection.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
//! In this example we will simulate a population of entities. In every tick we will:
2+
//! 1. spawn a new entity with a certain possibility
3+
//! 2. age all entities
4+
//! 3. despawn entities with age > 2
5+
//!
6+
//! To demonstrate change detection, there are some console outputs based on changes in
7+
//! the `EntityCounter` resource and updated Age components
8+
19
use bevy_ecs::prelude::*;
210
use rand::Rng;
311
use std::ops::Deref;
412

5-
// In this example we will simulate a population of entities. In every tick we will:
6-
// 1. spawn a new entity with a certain possibility
7-
// 2. age all entities
8-
// 3. despawn entities with age > 2
9-
//
10-
// To demonstrate change detection, there are some console outputs based on changes in
11-
// the EntityCounter resource and updated Age components
1213
fn main() {
1314
// Create a new empty World to hold our Entities, Components and Resources
1415
let mut world = World::new();

crates/bevy_ecs/examples/events.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
//! In this example a system sends a custom event with a 50/50 chance during any frame.
2+
//! If an event was send, it will be printed by the console in a receiving system.
3+
14
use bevy_ecs::prelude::*;
25

3-
// In this example a system sends a custom event with a 50/50 chance during any frame.
4-
// If an event was send, it will be printed by the console in a receiving system.
56
fn main() {
67
// Create a new empty world and add the event as a resource
78
let mut world = World::new();

crates/bevy_ecs/examples/resources.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
//! In this example we add a counter resource and increase it's value in one system,
2+
//! while a different system prints the current count to the console.
3+
14
use bevy_ecs::prelude::*;
25
use rand::Rng;
36
use std::ops::Deref;
47

5-
// In this example we add a counter resource and increase it's value in one system,
6-
// while a different system prints the current count to the console.
78
fn main() {
89
// Create a world
910
let mut world = World::new();

crates/bevy_ecs/macros/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
extern crate proc_macro;
25

36
mod component;

crates/bevy_ecs/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// FIXME(11590): remove this once the lint is fixed
22
#![allow(unsafe_op_in_unsafe_fn)]
3-
#![warn(missing_docs)]
43
#![doc = include_str!("../README.md")]
54

65
#[cfg(target_pointer_width = "16")]

crates/bevy_encase_derive/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
use bevy_macro_utils::BevyManifest;
25
use encase_derive_impl::{implement, syn};
36

crates/bevy_gilrs/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! This crate is built on top of [GilRs](gilrs), a library
44
//! that handles abstracting over platform-specific gamepad APIs.
55
6-
#![warn(missing_docs)]
7-
86
mod converter;
97
mod gilrs_system;
108
mod rumble;

crates/bevy_gizmos/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![warn(missing_docs)]
2-
31
//! This crate adds an immediate mode drawing api to Bevy for visual debugging.
42
//!
53
//! # Example
@@ -79,7 +77,7 @@ use bevy_render::{
7977
renderer::RenderDevice,
8078
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
8179
};
82-
use bevy_utils::{tracing::warn, HashMap};
80+
use bevy_utils::HashMap;
8381
use config::{
8482
DefaultGizmoConfigGroup, GizmoConfig, GizmoConfigGroup, GizmoConfigStore, GizmoMeshConfig,
8583
};

crates/bevy_gltf/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//!
44
//! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files.
55
6-
#![warn(missing_docs)]
7-
86
#[cfg(feature = "bevy_animation")]
97
use bevy_animation::AnimationClip;
108
use bevy_utils::HashMap;

crates/bevy_hierarchy/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
//! Parent-child relationships for Bevy entities.
32
//!
43
//! You should use the tools in this crate

crates/bevy_input/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![warn(missing_docs)]
2-
31
//! Input functionality for the [Bevy game engine](https://bevyengine.org/).
42
//!
53
//! # Supported input devices

crates/bevy_internal/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly
32
43
/// `use bevy::prelude::*;` to import common components, bundles, and plugins.

crates/bevy_log/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org)
32
//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android).
43
//!

crates/bevy_macro_utils/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
#![deny(unsafe_code)]
32
//! A collection of helper types and functions for working on macros within the Bevy ecosystem.
43

crates/bevy_math/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
55
//! like [`Quat`].
66
7-
#![warn(missing_docs)]
8-
97
mod affine3;
108
mod aspect_ratio;
119
pub mod bounding;

crates/bevy_mikktspace/examples/generate.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
//! This example demonstrates how to generate a mesh.
2+
13
#![allow(clippy::bool_assert_comparison, clippy::useless_conversion)]
24

35
use glam::{Vec2, Vec3};
46

5-
pub type Face = [u32; 3];
7+
type Face = [u32; 3];
68

79
#[derive(Debug)]
810
struct Vertex {

crates/bevy_mikktspace/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
clippy::all,
44
clippy::undocumented_unsafe_blocks
55
)]
6+
// FIXME(3492): remove once docs are ready
7+
#![allow(missing_docs)]
68

79
use glam::{Vec2, Vec3};
810

crates/bevy_pbr/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
pub mod wireframe;
25

36
mod alpha;

crates/bevy_ptr/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc = include_str!("../README.md")]
22
#![no_std]
3-
#![warn(missing_docs)]
43

54
use core::fmt::{self, Formatter, Pointer};
65
use core::{

crates/bevy_reflect/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
//! Reflection in Rust.
25
//!
36
//! [Reflection] is a powerful tool provided within many programming languages

crates/bevy_reflect/src/path/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![warn(missing_docs)]
2-
31
pub mod access;
42
pub use access::*;
53

crates/bevy_render/macros/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
mod as_bind_group;
25
mod extract_component;
36
mod extract_resource;

crates/bevy_render/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
#[cfg(target_pointer_width = "16")]
25
compile_error!("bevy_render cannot compile for a 16-bit platform.");
36

crates/bevy_render/src/mesh/primitives/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
//! # }
2020
//! ```
2121
22-
#![warn(missing_docs)]
23-
2422
mod dim2;
2523
pub use dim2::{CircleMeshBuilder, EllipseMeshBuilder};
2624

crates/bevy_scene/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized,
55
//! for example to save part of the world state to a file.
66
7-
#![warn(missing_docs)]
8-
97
mod bundle;
108
mod dynamic_scene;
119
mod dynamic_scene_builder;

crates/bevy_sprite/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
//! Provides 2D sprite rendering functionality.
25
mod bundle;
36
mod dynamic_texture_atlas_builder;

crates/bevy_tasks/examples/busy_behavior.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
//! This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin
2+
//! for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical
3+
//! cores)
4+
15
use bevy_tasks::TaskPoolBuilder;
26
use web_time::{Duration, Instant};
37

4-
// This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin
5-
// for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical
6-
// cores)
7-
88
fn main() {
99
let pool = TaskPoolBuilder::new()
1010
.thread_name("Busy Behavior ThreadPool".to_string())

crates/bevy_tasks/examples/idle_behavior.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
//! This sample demonstrates a thread pool with one thread per logical core and only one task
2+
//! spinning. Other than the one thread, the system should remain idle, demonstrating good behavior
3+
//! for small workloads.
4+
15
use bevy_tasks::TaskPoolBuilder;
26
use web_time::{Duration, Instant};
37

4-
// This sample demonstrates a thread pool with one thread per logical core and only one task
5-
// spinning. Other than the one thread, the system should remain idle, demonstrating good behavior
6-
// for small workloads.
7-
88
fn main() {
99
let pool = TaskPoolBuilder::new()
1010
.thread_name("Idle Behavior ThreadPool".to_string())

crates/bevy_tasks/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
#![doc = include_str!("../README.md")]
32

43
mod slice;

crates/bevy_text/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
mod error;
25
mod font;
36
mod font_atlas;

crates/bevy_time/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
#![doc = include_str!("../README.md")]
32

43
/// Common run conditions

crates/bevy_transform/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
#![doc = include_str!("../README.md")]
32

43
pub mod commands;

crates/bevy_ui/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
//! This crate contains Bevy's UI system, which can be used to create UI for both 2D and 3D games
25
//! # Basic usage
36
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]

crates/bevy_utils/macros/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME(3492): remove once docs are ready
2+
#![allow(missing_docs)]
3+
14
use proc_macro::TokenStream;
25
use quote::{format_ident, quote};
36
use syn::{

crates/bevy_utils/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! [Bevy]: https://bevyengine.org/
44
//!
55
6-
#![warn(missing_docs)]
7-
86
#[allow(missing_docs)]
97
pub mod prelude {
108
pub use crate::default;

crates/bevy_window/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![warn(missing_docs)]
21
//! `bevy_window` provides a platform-agnostic interface for windowing in Bevy.
32
//!
43
//! This crate contains types for window management and events,

0 commit comments

Comments
 (0)