Fix doc warnings (#3339)

# Objective

- There are a few warnings when building Bevy docs for dead links
- CI seems to not catch those warnings when it should

## Solution

- Enable doc CI on all Bevy workspace
- Fix warnings
- Also noticed plugin GilrsPlugin was not added anymore when feature was enabled


First commit to check that CI would actually fail with it: https://github.com/bevyengine/bevy/runs/4532652688?check_suite_focus=true

Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
This commit is contained in:
François 2021-12-18 00:09:23 +00:00
parent 3974e02fd1
commit 6a0008f3d3
11 changed files with 36 additions and 33 deletions

View File

@ -273,7 +273,7 @@ jobs:
- name: Installs cargo-deadlinks - name: Installs cargo-deadlinks
run: cargo install --force cargo-deadlinks run: cargo install --force cargo-deadlinks
- name: Build and check doc - name: Build and check doc
run: RUSTDOCFLAGS='-D warnings' cargo doc --all-features --no-deps run: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps
- name: Checks dead links - name: Checks dead links
run: cargo deadlinks --dir target/doc/bevy run: cargo deadlinks --dir target/doc/bevy
continue-on-error: true continue-on-error: true

View File

@ -234,9 +234,9 @@ impl ButtonAxisSettings {
} }
} }
/// Monitors gamepad connection and disconnection events, updating the [GamepadLobby] resource accordingly /// Monitors gamepad connection and disconnection events, updating the [`Gamepads`] resource accordingly
/// ///
/// By default, runs during `CoreStage::PreUpdate` when added via [InputPlugin]. /// By default, runs during `CoreStage::PreUpdate` when added via [`InputPlugin`](crate::InputPlugin).
pub fn gamepad_connection_system( pub fn gamepad_connection_system(
mut gamepads: ResMut<Gamepads>, mut gamepads: ResMut<Gamepads>,
mut gamepad_event: EventReader<GamepadEvent>, mut gamepad_event: EventReader<GamepadEvent>,

View File

@ -1,23 +1,23 @@
use bevy_app::{PluginGroup, PluginGroupBuilder}; use bevy_app::{PluginGroup, PluginGroupBuilder};
/// This plugin group will add all the default plugins: /// This plugin group will add all the default plugins:
/// * [`LogPlugin`] /// * [`LogPlugin`](bevy_log::LogPlugin)
/// * [`CorePlugin`] /// * [`CorePlugin`](bevy_core::CorePlugin)
/// * [`TransformPlugin`] /// * [`TransformPlugin`](bevy_transform::TransformPlugin)
/// * [`DiagnosticsPlugin`] /// * [`DiagnosticsPlugin`](bevy_diagnostic::DiagnosticsPlugin)
/// * [`InputPlugin`] /// * [`InputPlugin`](bevy_input::InputPlugin)
/// * [`WindowPlugin`] /// * [`WindowPlugin`](bevy_window::WindowPlugin)
/// * [`AssetPlugin`] /// * [`AssetPlugin`](bevy_asset::AssetPlugin)
/// * [`ScenePlugin`] /// * [`ScenePlugin`](bevy_scene::ScenePlugin)
/// * [`RenderPlugin`] - with feature `bevy_render` /// * [`RenderPlugin`](bevy_render::RenderPlugin) - with feature `bevy_render`
/// * [`SpritePlugin`] - with feature `bevy_sprite` /// * [`SpritePlugin`](bevy_sprite::SpritePlugin) - with feature `bevy_sprite`
/// * [`PbrPlugin`] - with feature `bevy_pbr` /// * [`PbrPlugin`](bevy_pbr::PbrPlugin) - with feature `bevy_pbr`
/// * [`UiPlugin`] - with feature `bevy_ui` /// * [`UiPlugin`](bevy_ui::UiPlugin) - with feature `bevy_ui`
/// * [`TextPlugin`] - with feature `bevy_text` /// * [`TextPlugin`](bevy_text::TextPlugin) - with feature `bevy_text`
/// * [`AudioPlugin`] - with feature `bevy_audio` /// * [`AudioPlugin`](bevy_audio::AudioPlugin) - with feature `bevy_audio`
/// * [`GilrsPlugin`] - with feature `bevy_gilrs` /// * [`GilrsPlugin`](bevy_gilrs::GilrsPlugin) - with feature `bevy_gilrs`
/// * [`GltfPlugin`] - with feature `bevy_gltf` /// * [`GltfPlugin`](bevy_gltf::GltfPlugin) - with feature `bevy_gltf`
/// * [`WinitPlugin`] - with feature `bevy_winit` /// * [`WinitPlugin`](bevy_winit::WinitPlugin) - with feature `bevy_winit`
/// ///
/// See also [`MinimalPlugins`] for a slimmed down option /// See also [`MinimalPlugins`] for a slimmed down option
pub struct DefaultPlugins; pub struct DefaultPlugins;
@ -59,12 +59,15 @@ impl PluginGroup for DefaultPlugins {
#[cfg(feature = "bevy_audio")] #[cfg(feature = "bevy_audio")]
group.add(bevy_audio::AudioPlugin::default()); group.add(bevy_audio::AudioPlugin::default());
#[cfg(feature = "bevy_gilrs")]
group.add(bevy_gilrs::GilrsPlugin::default());
} }
} }
/// Minimal plugin group that will add the following plugins: /// Minimal plugin group that will add the following plugins:
/// * [`CorePlugin`] /// * [`CorePlugin`](bevy_core::CorePlugin)
/// * [`ScheduleRunnerPlugin`] /// * [`ScheduleRunnerPlugin`](bevy_app::ScheduleRunnerPlugin)
/// ///
/// See also [`DefaultPlugins`] for a more complete set of plugins /// See also [`DefaultPlugins`] for a more complete set of plugins
pub struct MinimalPlugins; pub struct MinimalPlugins;

View File

@ -35,7 +35,7 @@ pub struct Mesh {
/// Contains geometry in the form of a mesh. /// Contains geometry in the form of a mesh.
/// ///
/// Often meshes are automatically generated by bevy's asset loaders or primitives, such as /// Often meshes are automatically generated by bevy's asset loaders or primitives, such as
/// [`crate::shape::Cube`] or [`crate::shape::Box`], but you can also construct /// [`shape::Cube`](crate::mesh::shape::Cube) or [`shape::Box`](crate::mesh::shape::Box), but you can also construct
/// one yourself. /// one yourself.
/// ///
/// Example of constructing a mesh: /// Example of constructing a mesh:

View File

@ -38,7 +38,7 @@ pub trait Draw<P: PhaseItem>: Send + Sync + 'static {
pub trait PhaseItem: Send + Sync + 'static { pub trait PhaseItem: Send + Sync + 'static {
/// The type used for ordering the items. The smallest values are drawn first. /// The type used for ordering the items. The smallest values are drawn first.
type SortKey: Ord; type SortKey: Ord;
/// Determines the order in which the items are drawn during the corresponding [`RenderPhase`]. /// Determines the order in which the items are drawn during the corresponding [`RenderPhase`](super::RenderPhase).
fn sort_key(&self) -> Self::SortKey; fn sort_key(&self) -> Self::SortKey;
/// Specifies the [`Draw`] function used to render the item. /// Specifies the [`Draw`] function used to render the item.
fn draw_function(&self) -> DrawFunctionId; fn draw_function(&self) -> DrawFunctionId;

View File

@ -5,7 +5,7 @@ use bevy_utils::tracing::debug;
use std::ops::Range; use std::ops::Range;
use wgpu::{IndexFormat, RenderPass}; use wgpu::{IndexFormat, RenderPass};
/// Tracks the current [`TrackedRenderPipeline`] state to ensure draw calls are valid. /// Tracks the current [`TrackedRenderPass`] state to ensure draw calls are valid.
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct DrawState { pub struct DrawState {
pipeline: Option<RenderPipelineId>, pipeline: Option<RenderPipelineId>,

View File

@ -32,7 +32,7 @@ pub enum ShaderReflectError {
Validation(#[from] naga::valid::ValidationError), Validation(#[from] naga::valid::ValidationError),
} }
/// A shader, as defined by its [ShaderSource] and [ShaderStage] /// A shader, as defined by its [`ShaderSource`] and [`ShaderStage`](naga::ShaderStage)
/// This is an "unprocessed" shader. It can contain preprocessor directives. /// This is an "unprocessed" shader. It can contain preprocessor directives.
#[derive(Debug, Clone, TypeUuid)] #[derive(Debug, Clone, TypeUuid)]
#[uuid = "d95bc916-6c55-4de3-9622-37e7b6969fda"] #[uuid = "d95bc916-6c55-4de3-9622-37e7b6969fda"]

View File

@ -137,12 +137,12 @@ impl RenderDevice {
Sampler::from(wgpu_sampler) Sampler::from(wgpu_sampler)
} }
/// Create a new [`SwapChain`](wgpu::SwapChain) which targets `surface`. /// Initializes [`Surface`](wgpu::Surface) for presentation.
/// ///
/// # Panics /// # Panics
/// ///
/// - A old [`SwapChainFrame`](wgpu::SwapChain) is still alive referencing an old swap chain. /// - A old [`SurfaceTexture`](wgpu::SurfaceTexture) is still alive referencing an old surface.
/// - Texture format requested is unsupported on the swap chain. /// - Texture format requested is unsupported on the surface.
pub fn configure_surface(&self, surface: &wgpu::Surface, config: &wgpu::SurfaceConfiguration) { pub fn configure_surface(&self, surface: &wgpu::Surface, config: &wgpu::SurfaceConfiguration) {
surface.configure(&self.device, config) surface.configure(&self.device, config)
} }

View File

@ -241,7 +241,7 @@ pub trait Volume {
} }
impl Volume for Extent3d { impl Volume for Extent3d {
/// Calculates the volume of the [`Extent3D`]. /// Calculates the volume of the [`Extent3d`].
fn volume(&self) -> usize { fn volume(&self) -> usize {
(self.width * self.height * self.depth_or_array_layers) as usize (self.width * self.height * self.depth_or_array_layers) as usize
} }

View File

@ -43,7 +43,7 @@ pub struct Msaa {
/// The number of samples to run for Multi-Sample Anti-Aliasing. Higher numbers result in /// The number of samples to run for Multi-Sample Anti-Aliasing. Higher numbers result in
/// smoother edges. Note that WGPU currently only supports 1 or 4 samples. /// smoother edges. Note that WGPU currently only supports 1 or 4 samples.
/// Ultimately we plan on supporting whatever is natively supported on a given device. /// Ultimately we plan on supporting whatever is natively supported on a given device.
/// Check out this issue for more info: https://github.com/gfx-rs/wgpu/issues/1832 /// Check out this issue for more info: <https://github.com/gfx-rs/wgpu/issues/1832>
pub samples: u32, pub samples: u32,
} }

View File

@ -552,8 +552,8 @@ pub struct WindowDescriptor {
/// - iOS / Android / Web: Unsupported. /// - iOS / Android / Web: Unsupported.
/// - macOS X: Not working as expected. /// - macOS X: Not working as expected.
/// - Windows 11: Not working as expected /// - Windows 11: Not working as expected
/// macOS X transparent works with winit out of the box, so this issue might be related to: https://github.com/gfx-rs/wgpu/issues/687 /// macOS X transparent works with winit out of the box, so this issue might be related to: <https://github.com/gfx-rs/wgpu/issues/687>
/// Windows 11 is related to https://github.com/rust-windowing/winit/issues/2082 /// Windows 11 is related to <https://github.com/rust-windowing/winit/issues/2082>
pub transparent: bool, pub transparent: bool,
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
pub canvas: Option<String>, pub canvas: Option<String>,