Skip to content

Commit

Permalink
Add a [lints] entry for workspace members missing it (bevyengine#11900
Browse files Browse the repository at this point in the history
)

# 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 <alice.i.cecile@gmail.com>
  • Loading branch information
2 people authored and msvbg committed Feb 26, 2024
1 parent d099f04 commit 6e2c8fd
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions crates/bevy_gizmos/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_gizmos/macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
3 changes: 3 additions & 0 deletions errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ description = "Bevy's error codes"
publish = false
license = "MIT OR Apache-2.0"

[lints]
workspace = true

[dependencies]
bevy = { path = ".." }
4 changes: 4 additions & 0 deletions errors/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
3 changes: 3 additions & 0 deletions tools/build-templated-pages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions tools/build-templated-pages/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Tool used to build the templated pages of the Bevy website.
use bitflags::bitflags;

mod examples;
Expand Down
4 changes: 3 additions & 1 deletion tools/build-wasm-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions tools/build-wasm-example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Tool used to build Bevy examples for wasm.
use std::{fs::File, io::Write};

use clap::{Parser, ValueEnum};
Expand Down
3 changes: 3 additions & 0 deletions tools/ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions tools/ci/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! CI script used for Bevy.
use xshell::{cmd, Shell};

use bitflags::bitflags;
Expand Down
3 changes: 3 additions & 0 deletions tools/example-showcase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 2 additions & 0 deletions tools/example-showcase/src/main.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 6e2c8fd

Please sign in to comment.