From f77618eccb2296e5b3a4d7affc162d195f86ed99 Mon Sep 17 00:00:00 2001 From: Kanabenki Date: Mon, 19 Feb 2024 18:09:47 +0100 Subject: [PATCH] Add a `[lints]` entry for workspace members missing it (#11900) # Objective - Some workspace members do not inherit the global lints. ## Solution - Add a `[lints]` entry for all files returned by `rg --files-without-match -F "[lints]" **/Cargo.toml`, except the compile failure tests since these aren't part of the workspace. - Add some docstrings where needed. --------- Co-authored-by: Alice Cecile --- crates/bevy_gizmos/macros/Cargo.toml | 3 +++ crates/bevy_gizmos/macros/src/lib.rs | 3 +++ errors/Cargo.toml | 3 +++ errors/src/lib.rs | 4 ++++ tools/build-templated-pages/Cargo.toml | 3 +++ tools/build-templated-pages/src/main.rs | 2 ++ tools/build-wasm-example/Cargo.toml | 4 +++- tools/build-wasm-example/src/main.rs | 2 ++ tools/ci/Cargo.toml | 3 +++ tools/ci/src/main.rs | 2 ++ tools/example-showcase/Cargo.toml | 3 +++ tools/example-showcase/src/main.rs | 2 ++ 12 files changed, 33 insertions(+), 1 deletion(-) diff --git a/crates/bevy_gizmos/macros/Cargo.toml b/crates/bevy_gizmos/macros/Cargo.toml index b6d6c8cc3d..3110039994 100644 --- a/crates/bevy_gizmos/macros/Cargo.toml +++ b/crates/bevy_gizmos/macros/Cargo.toml @@ -11,6 +11,9 @@ keywords = ["bevy"] [lib] proc-macro = true +[lints] +workspace = true + [dependencies] bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.13.0" } diff --git a/crates/bevy_gizmos/macros/src/lib.rs b/crates/bevy_gizmos/macros/src/lib.rs index 46425ead70..eb2c598c90 100644 --- a/crates/bevy_gizmos/macros/src/lib.rs +++ b/crates/bevy_gizmos/macros/src/lib.rs @@ -1,8 +1,11 @@ +//! Derive implementations for `bevy_gizmos`. + use bevy_macro_utils::BevyManifest; use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, parse_quote, DeriveInput, Path}; +/// Implements the [`GizmoConfigGroup`] trait for a gizmo config group type. #[proc_macro_derive(GizmoConfigGroup)] pub fn derive_gizmo_config_group(input: TokenStream) -> TokenStream { let mut ast = parse_macro_input!(input as DeriveInput); diff --git a/errors/Cargo.toml b/errors/Cargo.toml index 07ad946b1a..01fe856cc7 100644 --- a/errors/Cargo.toml +++ b/errors/Cargo.toml @@ -6,5 +6,8 @@ description = "Bevy's error codes" publish = false license = "MIT OR Apache-2.0" +[lints] +workspace = true + [dependencies] bevy = { path = ".." } diff --git a/errors/src/lib.rs b/errors/src/lib.rs index 4cda972b49..3de403b8d8 100644 --- a/errors/src/lib.rs +++ b/errors/src/lib.rs @@ -1,3 +1,7 @@ +//! Definitions of Bevy's error codes that might occur at runtime. +//! +//! These either manifest as a warning or a panic. + #[doc = include_str!("../B0001.md")] pub struct B0001; diff --git a/tools/build-templated-pages/Cargo.toml b/tools/build-templated-pages/Cargo.toml index a4a0668bbe..5cded55115 100644 --- a/tools/build-templated-pages/Cargo.toml +++ b/tools/build-templated-pages/Cargo.toml @@ -6,6 +6,9 @@ description = "handle templated pages in Bevy repository" publish = false license = "MIT OR Apache-2.0" +[lints] +workspace = true + [dependencies] toml_edit = { version = "0.22", default-features = false, features = ["parse"] } tera = "1.15" diff --git a/tools/build-templated-pages/src/main.rs b/tools/build-templated-pages/src/main.rs index f0f9a95c21..eba6e6f777 100644 --- a/tools/build-templated-pages/src/main.rs +++ b/tools/build-templated-pages/src/main.rs @@ -1,3 +1,5 @@ +//! Tool used to build the templated pages of the Bevy website. + use bitflags::bitflags; mod examples; diff --git a/tools/build-wasm-example/Cargo.toml b/tools/build-wasm-example/Cargo.toml index 6496c0fbb1..511ca208d4 100644 --- a/tools/build-wasm-example/Cargo.toml +++ b/tools/build-wasm-example/Cargo.toml @@ -5,7 +5,9 @@ edition = "2021" description = "Build an example for wasm" publish = false license = "MIT OR Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lints] +workspace = true [dependencies] xshell = "0.2" diff --git a/tools/build-wasm-example/src/main.rs b/tools/build-wasm-example/src/main.rs index 351439a4ff..f121bd63c6 100644 --- a/tools/build-wasm-example/src/main.rs +++ b/tools/build-wasm-example/src/main.rs @@ -1,3 +1,5 @@ +//! Tool used to build Bevy examples for wasm. + use std::{fs::File, io::Write}; use clap::{Parser, ValueEnum}; diff --git a/tools/ci/Cargo.toml b/tools/ci/Cargo.toml index e6ca164b1f..7e6b3e8187 100644 --- a/tools/ci/Cargo.toml +++ b/tools/ci/Cargo.toml @@ -6,6 +6,9 @@ description = "CI script for Bevy" publish = false license = "MIT OR Apache-2.0" +[lints] +workspace = true + [dependencies] xshell = "0.2" bitflags = "2.3" diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index f5828a69c3..173d6af9de 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -1,3 +1,5 @@ +//! CI script used for Bevy. + use xshell::{cmd, Shell}; use bitflags::bitflags; diff --git a/tools/example-showcase/Cargo.toml b/tools/example-showcase/Cargo.toml index 3c1da1cf8b..a7775e0082 100644 --- a/tools/example-showcase/Cargo.toml +++ b/tools/example-showcase/Cargo.toml @@ -6,6 +6,9 @@ description = "Run examples" publish = false license = "MIT OR Apache-2.0" +[lints] +workspace = true + [dependencies] xshell = "0.2" clap = { version = "4.0", features = ["derive"] } diff --git a/tools/example-showcase/src/main.rs b/tools/example-showcase/src/main.rs index 16c1c9b933..cabdd973f2 100644 --- a/tools/example-showcase/src/main.rs +++ b/tools/example-showcase/src/main.rs @@ -1,3 +1,5 @@ +//! Tool to run all examples or generate a showcase page for the Bevy website. + use std::{ collections::{hash_map::DefaultHasher, HashMap}, fmt::Display,