From fc7e8baa7efb732c8404c11b674bba1762c16e67 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 21:54:31 -0300 Subject: [PATCH 01/24] Create a justfile template --- justfile | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 0000000000000..77f1dedae65ea --- /dev/null +++ b/justfile @@ -0,0 +1,65 @@ +export RUSTFLAGS := "-Dwarnings" + +[doc("Runs clippy on all of Bevy's crates (TODO)")] +[group("ci")] +clippy: + @just bevy_app + @just bevy_ecs + + +# Runs clippy on `bevy_ecs`, with all this permutations of features +# * --no-default-features +# * --no-default-features --features="*each feature in Cargo.toml individually*" +# * "default features" +# * --all-features +# +# Some of the features require that either `bevy_reflect/auto_register_inventory` or +# `bevy_reflect/auto_register_static` be enabled. +[doc("Runs clippy for `bevy_app`")] +[group("clippy")] +bevy_app: + cargo clippy -p bevy_app --no-default-features + cargo clippy -p bevy_app --no-default-features --features="bevy_reflect" + cargo clippy -p bevy_app --no-default-features --features="reflect_functions" + cargo clippy -p bevy_app --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_inventory" + cargo clippy -p bevy_app --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_static" + cargo clippy -p bevy_app --no-default-features --features="trace" + cargo clippy -p bevy_app --no-default-features --features="bevy_debug_stepping" + cargo clippy -p bevy_app --no-default-features --features="error_panic_hook" + cargo clippy -p bevy_app --no-default-features --features="std" + cargo clippy -p bevy_app --no-default-features --features="critical-section" + cargo clippy -p bevy_app --no-default-features --features="web" + cargo clippy -p bevy_app --no-default-features --features="hotpatching" + cargo clippy -p bevy_app + cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_inventory" + cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_static" + +# Runs clippy on `bevy_ecs`, with all this permutations of features +# * --no-default-features +# * --no-default-features --features="*each feature in Cargo.toml individually*" +# * "default features" +# * --all-features +# +# Some of the features require that either `bevy_reflect/auto_register_inventory` or +# `bevy_reflect/auto_register_static` be enabled. +[doc("Runs clippy for `bevy_ecs`")] +[group("clippy")] +bevy_ecs: + cargo clippy -p bevy_ecs --no-default-features + cargo clippy -p bevy_ecs --no-default-features --features="multi_threaded" + cargo clippy -p bevy_ecs --no-default-features --features="serialize" + cargo clippy -p bevy_ecs --no-default-features --features="bevy_reflect" + cargo clippy -p bevy_ecs --no-default-features --features="reflect_functions" + cargo clippy -p bevy_ecs --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_inventory" + cargo clippy -p bevy_ecs --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_static" + cargo clippy -p bevy_ecs --no-default-features --features="backtrace" + cargo clippy -p bevy_ecs --no-default-features --features="trace" + cargo clippy -p bevy_ecs --no-default-features --features="detailed_trace" + cargo clippy -p bevy_ecs --no-default-features --features="track_location" + cargo clippy -p bevy_ecs --no-default-features --features="async_executor" + cargo clippy -p bevy_ecs --no-default-features --features="std" + cargo clippy -p bevy_ecs --no-default-features --features="critical-section" + cargo clippy -p bevy_ecs --no-default-features --features="hotpatching" + cargo clippy -p bevy_ecs + cargo clippy -p bevy_ecs --all-features --features="bevy_reflect/auto_register_inventory" + cargo clippy -p bevy_ecs --all-features --features="bevy_reflect/auto_register_static" From 20d76db888f1804f9ec0aed7dc19f537da7f7289 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 22:02:10 -0300 Subject: [PATCH 02/24] Wrong name on comment --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 77f1dedae65ea..193b5c3758235 100644 --- a/justfile +++ b/justfile @@ -7,7 +7,7 @@ clippy: @just bevy_ecs -# Runs clippy on `bevy_ecs`, with all this permutations of features +# Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" # * "default features" From 9d4e3e399bc0fcca76fc3f38cba0ddbdc771a4dd Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 22:05:40 -0300 Subject: [PATCH 03/24] Add `bevy_a11y` --- justfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/justfile b/justfile index 193b5c3758235..a573b3271e94d 100644 --- a/justfile +++ b/justfile @@ -3,9 +3,25 @@ export RUSTFLAGS := "-Dwarnings" [doc("Runs clippy on all of Bevy's crates (TODO)")] [group("ci")] clippy: + @just bevy_a11y @just bevy_app @just bevy_ecs +# Runs clippy on `bevy_a11y`, with all this permutations of features +# * --no-default-features +# * --no-default-features --features="*each feature in Cargo.toml individually*" +# * "default features" +# * --all-features +[doc("Runs clippy for `bevy_a11y`")] +[group("clippy")] +bevy_a11y: + cargo clippy -p bevy_a11y --no-default-features + cargo clippy -p bevy_a11y --no-default-features --features="bevy_reflect" + cargo clippy -p bevy_a11y --no-default-features --features="serialize" + cargo clippy -p bevy_a11y --no-default-features --features="std" + cargo clippy -p bevy_a11y --no-default-features --features="critical-section" + cargo clippy -p bevy_a11y + cargo clippy -p bevy_a11y --all-features # Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features From 567814f46ac01060f594946d7f664f67fb6503f3 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 22:19:13 -0300 Subject: [PATCH 04/24] Add `bevy_android` and meta `clippy_android` recipes --- justfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/justfile b/justfile index a573b3271e94d..0fa5a62e82faf 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,7 @@ export RUSTFLAGS := "-Dwarnings" +default_android_target := "aarch64-linux-android" + [doc("Runs clippy on all of Bevy's crates (TODO)")] [group("ci")] clippy: @@ -7,6 +9,11 @@ clippy: @just bevy_app @just bevy_ecs +[doc("Runs clippy on all of Bevy's crates for Android targets (TODO)")] +[group("ci")] +clippy_android $TARGET=default_android_target: + @just bevy_android {{TARGET}} + # Runs clippy on `bevy_a11y`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" @@ -23,6 +30,19 @@ bevy_a11y: cargo clippy -p bevy_a11y cargo clippy -p bevy_a11y --all-features +# Runs clippy on `bevy_android`, with all this permutations of features +# * --no-default-features +# * "default features" +# * --all-features +# +# `bevy_android` only exists for `target_os="android"`. +[doc("Runs clippy for `bevy_android`")] +[group("clippy")] +bevy_android $TARGET=default_android_target: + cargo clippy -p bevy_android --no-default-features --target="{{TARGET}}" + cargo clippy -p bevy_android --target="{{TARGET}}" + cargo clippy -p bevy_android --all-features --target="{{TARGET}}" + # Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" From 60ffb87eb2116e344b2d4a9f4b79b5f5ec06e995 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 22:35:43 -0300 Subject: [PATCH 05/24] Adjustments to parameters and docs on android recipes --- justfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/justfile b/justfile index 0fa5a62e82faf..533c7d0b1b9c2 100644 --- a/justfile +++ b/justfile @@ -11,8 +11,8 @@ clippy: [doc("Runs clippy on all of Bevy's crates for Android targets (TODO)")] [group("ci")] -clippy_android $TARGET=default_android_target: - @just bevy_android {{TARGET}} +clippy_android target=default_android_target: + @just bevy_android {{target}} # Runs clippy on `bevy_a11y`, with all this permutations of features # * --no-default-features @@ -35,13 +35,16 @@ bevy_a11y: # * "default features" # * --all-features # -# `bevy_android` only exists for `target_os="android"`. +# `bevy_android` only exists for `target_os="android"`. Which means that it +# requires either one of these targets: +# * aarch64-linux-android +# * List is not exhaustive [doc("Runs clippy for `bevy_android`")] [group("clippy")] -bevy_android $TARGET=default_android_target: - cargo clippy -p bevy_android --no-default-features --target="{{TARGET}}" - cargo clippy -p bevy_android --target="{{TARGET}}" - cargo clippy -p bevy_android --all-features --target="{{TARGET}}" +bevy_android target=default_android_target: + cargo clippy -p bevy_android --no-default-features --target="{{target}}" + cargo clippy -p bevy_android --target="{{target}}" + cargo clippy -p bevy_android --all-features --target="{{target}}" # Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features From 7115e9cde65909c8d5fc3bc682572a137eca0f64 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 22:39:13 -0300 Subject: [PATCH 06/24] Add `bevy_animation` --- justfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/justfile b/justfile index 533c7d0b1b9c2..1ddd5a2bb51fd 100644 --- a/justfile +++ b/justfile @@ -7,6 +7,7 @@ default_android_target := "aarch64-linux-android" clippy: @just bevy_a11y @just bevy_app + @just bevy_animation @just bevy_ecs [doc("Runs clippy on all of Bevy's crates for Android targets (TODO)")] @@ -46,6 +47,17 @@ bevy_android target=default_android_target: cargo clippy -p bevy_android --target="{{target}}" cargo clippy -p bevy_android --all-features --target="{{target}}" +# Runs clippy on `bevy_animation`, with all this permutations of features +# * --no-default-features +# * "default features" +# * --all-features +[doc("Runs clippy for `bevy_animation`")] +[group("clippy")] +bevy_animation: + cargo clippy -p bevy_animation --no-default-features + cargo clippy -p bevy_animation + cargo clippy -p bevy_animation --all-features + # Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" From 5f43af808e43a3d55b548bf1e33d3cd4eb526514 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 23:08:27 -0300 Subject: [PATCH 07/24] Add `bevy_anti_alias` --- justfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/justfile b/justfile index 1ddd5a2bb51fd..523afa2394c9e 100644 --- a/justfile +++ b/justfile @@ -8,6 +8,7 @@ clippy: @just bevy_a11y @just bevy_app @just bevy_animation + @just bevy_anti_alias @just bevy_ecs [doc("Runs clippy on all of Bevy's crates for Android targets (TODO)")] @@ -58,6 +59,29 @@ bevy_animation: cargo clippy -p bevy_animation cargo clippy -p bevy_animation --all-features +# Runs clippy on `bevy_anti_alias`, with all this permutations of features +# * --no-default-features +# * --no-default-features --features="*each feature in Cargo.toml individually*" +# * "default features" +# * --all-features +# +# Some of the features require that either `bevy_image/zstd_rust` or +# `bevy_image/zstd_c` be enabled. +# +# The `dlss` feature, without the `force_disable_dlss`, requires the environment +# variable `DLSS_SDK`. See `dlss_wgpu` README for more information. +[doc("Runs clippy for `bevy_anti_alias`")] +[group("clippy")] +bevy_anti_alias: + cargo clippy -p bevy_anti_alias --no-default-features + cargo clippy -p bevy_anti_alias --no-default-features --features="trace" + cargo clippy -p bevy_anti_alias --no-default-features --features="smaa_luts bevy_image/zstd_rust" + cargo clippy -p bevy_anti_alias --no-default-features --features="smaa_luts bevy_image/zstd_c" + cargo clippy -p bevy_anti_alias --no-default-features --features="dlss force_disable_dlss" + cargo clippy -p bevy_anti_alias + cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_rust" + cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_c" + # Runs clippy on `bevy_app`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" From 7c3261c196fd3ffa1a65b1e927d40e4d8efd628c Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 20 Sep 2025 23:11:25 -0300 Subject: [PATCH 08/24] Add a ci recipe for crates/features that require `DLSS_SDK` --- justfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/justfile b/justfile index 523afa2394c9e..d668870e14fca 100644 --- a/justfile +++ b/justfile @@ -16,6 +16,12 @@ clippy: clippy_android target=default_android_target: @just bevy_android {{target}} +# These are crates that have features that require `DLSS_SDK`. +[doc("Runs clippy on all of Bevy's crates that use DLSS (TODO)")] +[group("ci")] +clippy_dlss: + cargo clippy -p bevy_anti_alias --no-default-features --features="dlss" + # Runs clippy on `bevy_a11y`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" From e3f2549b816fb1372b77f46731a354c412a083ba Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:23:12 -0300 Subject: [PATCH 09/24] Convert `bevy_ecs` recipe into `ci` tool --- justfile | 30 -------- .../release-notes/pedantic_ci_commands.md | 29 +++++++ tools/ci/src/ci.rs | 5 ++ tools/ci/src/commands/bevy_ecs.rs | 38 +++++++++ tools/ci/src/commands/clippy_permutations.rs | 77 +++++++++++++++++++ tools/ci/src/commands/clippys.rs | 17 ++++ tools/ci/src/commands/mod.rs | 5 ++ 7 files changed, 171 insertions(+), 30 deletions(-) create mode 100644 release-content/release-notes/pedantic_ci_commands.md create mode 100644 tools/ci/src/commands/bevy_ecs.rs create mode 100644 tools/ci/src/commands/clippy_permutations.rs create mode 100644 tools/ci/src/commands/clippys.rs diff --git a/justfile b/justfile index d668870e14fca..14cc9e6e15699 100644 --- a/justfile +++ b/justfile @@ -114,33 +114,3 @@ bevy_app: cargo clippy -p bevy_app cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_inventory" cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_static" - -# Runs clippy on `bevy_ecs`, with all this permutations of features -# * --no-default-features -# * --no-default-features --features="*each feature in Cargo.toml individually*" -# * "default features" -# * --all-features -# -# Some of the features require that either `bevy_reflect/auto_register_inventory` or -# `bevy_reflect/auto_register_static` be enabled. -[doc("Runs clippy for `bevy_ecs`")] -[group("clippy")] -bevy_ecs: - cargo clippy -p bevy_ecs --no-default-features - cargo clippy -p bevy_ecs --no-default-features --features="multi_threaded" - cargo clippy -p bevy_ecs --no-default-features --features="serialize" - cargo clippy -p bevy_ecs --no-default-features --features="bevy_reflect" - cargo clippy -p bevy_ecs --no-default-features --features="reflect_functions" - cargo clippy -p bevy_ecs --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_inventory" - cargo clippy -p bevy_ecs --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_static" - cargo clippy -p bevy_ecs --no-default-features --features="backtrace" - cargo clippy -p bevy_ecs --no-default-features --features="trace" - cargo clippy -p bevy_ecs --no-default-features --features="detailed_trace" - cargo clippy -p bevy_ecs --no-default-features --features="track_location" - cargo clippy -p bevy_ecs --no-default-features --features="async_executor" - cargo clippy -p bevy_ecs --no-default-features --features="std" - cargo clippy -p bevy_ecs --no-default-features --features="critical-section" - cargo clippy -p bevy_ecs --no-default-features --features="hotpatching" - cargo clippy -p bevy_ecs - cargo clippy -p bevy_ecs --all-features --features="bevy_reflect/auto_register_inventory" - cargo clippy -p bevy_ecs --all-features --features="bevy_reflect/auto_register_static" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md new file mode 100644 index 0000000000000..e8ebde92fba9a --- /dev/null +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -0,0 +1,29 @@ +--- +title: Pedantic CI commands +authors: ["@hukasu"] +pull_requests: [todo] +--- + +New commands were added to CI tool to allow running clippy with multiple permutations of +features. For a crate it is run with: +* `--no-default-features` +* Multiple `--no-default-features --features="..."` +* Default features +* Multiple `--all-features --features="..."` + +There are crates that are run with multiple `--all-features` due to them depending +another crate that has a switchable features. Examples are `bevy_image/zstd_c` or +`bevy_image/zstd_rust`, or `bevy_reflect/auto_register_inventory` or `bevy_reflect/auto_register_static`. + +## Commands +### `clippys` + +This is a meta commands that runs the other clippy permutation commands. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. + +### `bevy_ecs` + +Runs clippy on `bevy_ecs` with multiple feature permutations. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_ecs`. \ No newline at end of file diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index 8b8556d90ac05..43b9bf1fdd76e 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -75,6 +75,7 @@ impl CI { let mut cmds = vec![]; cmds.append(&mut commands::FormatCommand::default().prepare(sh, args)); cmds.append(&mut commands::ClippyCommand::default().prepare(sh, args)); + cmds.append(&mut commands::ClippysCommand::default().prepare(sh, args)); cmds.append(&mut commands::TestCommand::default().prepare(sh, args)); cmds.append(&mut commands::TestCheckCommand::default().prepare(sh, args)); cmds.append(&mut commands::IntegrationTestCommand::default().prepare(sh, args)); @@ -105,6 +106,7 @@ enum Commands { Lints(commands::LintsCommand), Doc(commands::DocCommand), Compile(commands::CompileCommand), + Clippys(commands::ClippysCommand), // Actual subcommands Format(commands::FormatCommand), Clippy(commands::ClippyCommand), @@ -119,6 +121,7 @@ enum Commands { CompileFail(commands::CompileFailCommand), BenchCheck(commands::BenchCheckCommand), ExampleCheck(commands::ExampleCheckCommand), + BevyEcs(commands::BevyEcs), } impl Prepare for Commands { @@ -127,6 +130,7 @@ impl Prepare for Commands { Commands::Lints(subcommand) => subcommand.prepare(sh, args), Commands::Doc(subcommand) => subcommand.prepare(sh, args), Commands::Compile(subcommand) => subcommand.prepare(sh, args), + Commands::Clippys(subcommand) => subcommand.prepare(sh, args), Commands::Format(subcommand) => subcommand.prepare(sh, args), Commands::Clippy(subcommand) => subcommand.prepare(sh, args), @@ -141,6 +145,7 @@ impl Prepare for Commands { Commands::CompileFail(subcommand) => subcommand.prepare(sh, args), Commands::BenchCheck(subcommand) => subcommand.prepare(sh, args), Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), + Commands::BevyEcs(subcommand) => subcommand.prepare(sh, args), } } } diff --git a/tools/ci/src/commands/bevy_ecs.rs b/tools/ci/src/commands/bevy_ecs.rs new file mode 100644 index 0000000000000..099c7c95ca1b3 --- /dev/null +++ b/tools/ci/src/commands/bevy_ecs.rs @@ -0,0 +1,38 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_ecs`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_ecs")] +pub struct BevyEcs {} + +impl Prepare for BevyEcs { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + ClippyPermutations { + crate_name: "bevy_ecs", + features: &[ + //"multi_threaded", + "serialize", + "bevy_reflect", + "reflect_functions", + "reflect_auto_register bevy_reflect/auto_register_inventory", + "reflect_auto_register bevy_reflect/auto_register_static", + "backtrace", + "trace", + "detailed_trace", + "track_location", + "async_executor", + "std", + "critical-section", + "hotpatching", + ], + all_features_features: &[ + "bevy_reflect/auto_register_inventory", + "bevy_reflect/auto_register_static", + ], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippy_permutations.rs b/tools/ci/src/commands/clippy_permutations.rs new file mode 100644 index 0000000000000..45b179c30ec03 --- /dev/null +++ b/tools/ci/src/commands/clippy_permutations.rs @@ -0,0 +1,77 @@ +use crate::{args::Args, PreparedCommand}; +use argh::SubCommand; +use xshell::cmd; + +/// Prepares the clippy permutations of a crate. +pub(super) struct ClippyPermutations { + /// Crate name + pub crate_name: &'static str, + /// Features used when running clippy with no default features + pub features: &'static [&'static str], + /// Features used when running clippy with all features + pub all_features_features: &'static [&'static str], +} + +impl ClippyPermutations { + pub fn build<'a, T: SubCommand>( + self, + sh: &'a xshell::Shell, + args: Args, + ) -> Vec> { + let jobs = args.build_jobs(); + let jobs_ref = jobs.as_ref(); + let crate_name = self.crate_name; + + let mut permutations = + Vec::with_capacity(2 + self.features.len() + self.all_features_features.len().min(1)); + + // No default features + permutations.push(PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p {crate_name} --no-default-features {jobs_ref...}" + ), + "Please fix clippy errors in output above.", + )); + // Feature permutations + for feature in self.features { + permutations.push(PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p {crate_name} --no-default-features --features={feature} {jobs_ref...}" + ), + "Please fix clippy errors in output above.", + )); + } + // Default features + permutations.push(PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p {crate_name} --no-default-features {jobs_ref...}" + ), + "Please fix clippy errors in output above.", + )); + // All features + if self.all_features_features.is_empty() { + permutations.push(PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p {crate_name} --all-features {jobs_ref...}" + ), + "Please fix clippy errors in output above.", + )); + } else { + for feature in self.all_features_features { + permutations.push(PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p {crate_name} --all-features --features={feature} {jobs_ref...}" + ), + "Please fix clippy errors in output above.", + )); + } + } + + permutations + } +} diff --git a/tools/ci/src/commands/clippys.rs b/tools/ci/src/commands/clippys.rs new file mode 100644 index 0000000000000..4266b5f6f1b3f --- /dev/null +++ b/tools/ci/src/commands/clippys.rs @@ -0,0 +1,17 @@ +use crate::{args::Args, commands::BevyEcs, Prepare, PreparedCommand}; +use argh::FromArgs; + +/// Check for clippy warnings and errors running multiple permutations of features. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "clippys")] +pub struct ClippysCommand {} + +impl Prepare for ClippysCommand { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + let mut commands = Vec::new(); + + commands.append(&mut BevyEcs::default().prepare(sh, args)); + + commands + } +} diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index 9247ab201627b..960a8c859dda0 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,5 +1,7 @@ pub use bench_check::*; +pub use bevy_ecs::*; pub use clippy::*; +pub use clippys::*; pub use compile::*; pub use compile_check::*; pub use compile_fail::*; @@ -16,7 +18,10 @@ pub use test::*; pub use test_check::*; mod bench_check; +mod bevy_ecs; mod clippy; +mod clippy_permutations; +mod clippys; mod compile; mod compile_check; mod compile_fail; From 5131e7b3a96ba4bd8fcbede69ae28845e0d7325b Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:29:24 -0300 Subject: [PATCH 10/24] Convert `bevy_app` recipe into `ci` tool --- justfile | 27 -------------- .../release-notes/pedantic_ci_commands.md | 6 ++++ tools/ci/src/ci.rs | 2 ++ tools/ci/src/commands/bevy_app.rs | 35 +++++++++++++++++++ tools/ci/src/commands/clippys.rs | 7 +++- tools/ci/src/commands/mod.rs | 2 ++ 6 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 tools/ci/src/commands/bevy_app.rs diff --git a/justfile b/justfile index 14cc9e6e15699..9f3e18edec880 100644 --- a/justfile +++ b/justfile @@ -87,30 +87,3 @@ bevy_anti_alias: cargo clippy -p bevy_anti_alias cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_rust" cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_c" - -# Runs clippy on `bevy_app`, with all this permutations of features -# * --no-default-features -# * --no-default-features --features="*each feature in Cargo.toml individually*" -# * "default features" -# * --all-features -# -# Some of the features require that either `bevy_reflect/auto_register_inventory` or -# `bevy_reflect/auto_register_static` be enabled. -[doc("Runs clippy for `bevy_app`")] -[group("clippy")] -bevy_app: - cargo clippy -p bevy_app --no-default-features - cargo clippy -p bevy_app --no-default-features --features="bevy_reflect" - cargo clippy -p bevy_app --no-default-features --features="reflect_functions" - cargo clippy -p bevy_app --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_inventory" - cargo clippy -p bevy_app --no-default-features --features="reflect_auto_register bevy_reflect/auto_register_static" - cargo clippy -p bevy_app --no-default-features --features="trace" - cargo clippy -p bevy_app --no-default-features --features="bevy_debug_stepping" - cargo clippy -p bevy_app --no-default-features --features="error_panic_hook" - cargo clippy -p bevy_app --no-default-features --features="std" - cargo clippy -p bevy_app --no-default-features --features="critical-section" - cargo clippy -p bevy_app --no-default-features --features="web" - cargo clippy -p bevy_app --no-default-features --features="hotpatching" - cargo clippy -p bevy_app - cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_inventory" - cargo clippy -p bevy_app --all-features --features="bevy_reflect/auto_register_static" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index e8ebde92fba9a..0483af185c39b 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -22,6 +22,12 @@ This is a meta commands that runs the other clippy permutation commands. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. +### `bevy_app` + +Runs clippy on `bevy_app` with multiple feature permutations. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_app`. + ### `bevy_ecs` Runs clippy on `bevy_ecs` with multiple feature permutations. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index 43b9bf1fdd76e..cc094266d94dc 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -121,6 +121,7 @@ enum Commands { CompileFail(commands::CompileFailCommand), BenchCheck(commands::BenchCheckCommand), ExampleCheck(commands::ExampleCheckCommand), + BevyApp(commands::BevyApp), BevyEcs(commands::BevyEcs), } @@ -145,6 +146,7 @@ impl Prepare for Commands { Commands::CompileFail(subcommand) => subcommand.prepare(sh, args), Commands::BenchCheck(subcommand) => subcommand.prepare(sh, args), Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), + Commands::BevyApp(subcommand) => subcommand.prepare(sh, args), Commands::BevyEcs(subcommand) => subcommand.prepare(sh, args), } } diff --git a/tools/ci/src/commands/bevy_app.rs b/tools/ci/src/commands/bevy_app.rs new file mode 100644 index 0000000000000..606400cf57271 --- /dev/null +++ b/tools/ci/src/commands/bevy_app.rs @@ -0,0 +1,35 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_app`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_app")] +pub struct BevyApp {} + +impl Prepare for BevyApp { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + ClippyPermutations { + crate_name: "bevy_app", + features: &[ + "bevy_reflect", + "reflect_functions", + "reflect_auto_register bevy_reflect/auto_register_inventory", + "reflect_auto_register bevy_reflect/auto_register_static", + "trace", + "bevy_debug_stepping", + "error_panic_hook", + "std", + "critical-section", + "web", + "hotpatching", + ], + all_features_features: &[ + "bevy_reflect/auto_register_inventory", + "bevy_reflect/auto_register_static", + ], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippys.rs b/tools/ci/src/commands/clippys.rs index 4266b5f6f1b3f..090a536289ccd 100644 --- a/tools/ci/src/commands/clippys.rs +++ b/tools/ci/src/commands/clippys.rs @@ -1,4 +1,8 @@ -use crate::{args::Args, commands::BevyEcs, Prepare, PreparedCommand}; +use crate::{ + args::Args, + commands::{BevyApp, BevyEcs}, + Prepare, PreparedCommand, +}; use argh::FromArgs; /// Check for clippy warnings and errors running multiple permutations of features. @@ -10,6 +14,7 @@ impl Prepare for ClippysCommand { fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { let mut commands = Vec::new(); + commands.append(&mut BevyApp::default().prepare(sh, args)); commands.append(&mut BevyEcs::default().prepare(sh, args)); commands diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index 960a8c859dda0..84acd29298e43 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,4 +1,5 @@ pub use bench_check::*; +pub use bevy_app::*; pub use bevy_ecs::*; pub use clippy::*; pub use clippys::*; @@ -18,6 +19,7 @@ pub use test::*; pub use test_check::*; mod bench_check; +mod bevy_app; mod bevy_ecs; mod clippy; mod clippy_permutations; From 9a4c2ee50d56008e559bbcda288418eba1f0406d Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:33:24 -0300 Subject: [PATCH 11/24] Convert `bevy_animation` recipe into `ci` tool --- justfile | 11 ---------- .../release-notes/pedantic_ci_commands.md | 6 ++++++ tools/ci/src/ci.rs | 2 ++ tools/ci/src/commands/bevy_animation.rs | 20 +++++++++++++++++++ tools/ci/src/commands/clippys.rs | 3 ++- tools/ci/src/commands/mod.rs | 2 ++ 6 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 tools/ci/src/commands/bevy_animation.rs diff --git a/justfile b/justfile index 9f3e18edec880..cbc6e385a03ed 100644 --- a/justfile +++ b/justfile @@ -54,17 +54,6 @@ bevy_android target=default_android_target: cargo clippy -p bevy_android --target="{{target}}" cargo clippy -p bevy_android --all-features --target="{{target}}" -# Runs clippy on `bevy_animation`, with all this permutations of features -# * --no-default-features -# * "default features" -# * --all-features -[doc("Runs clippy for `bevy_animation`")] -[group("clippy")] -bevy_animation: - cargo clippy -p bevy_animation --no-default-features - cargo clippy -p bevy_animation - cargo clippy -p bevy_animation --all-features - # Runs clippy on `bevy_anti_alias`, with all this permutations of features # * --no-default-features # * --no-default-features --features="*each feature in Cargo.toml individually*" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index 0483af185c39b..dfd4f6b322152 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -22,6 +22,12 @@ This is a meta commands that runs the other clippy permutation commands. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. +### `bevy_animation` + +Runs clippy on `bevy_animation` with multiple feature permutations. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_animation`. + ### `bevy_app` Runs clippy on `bevy_app` with multiple feature permutations. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index cc094266d94dc..eb3d719ac257c 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -121,6 +121,7 @@ enum Commands { CompileFail(commands::CompileFailCommand), BenchCheck(commands::BenchCheckCommand), ExampleCheck(commands::ExampleCheckCommand), + BevyAnimation(commands::BevyAnimation), BevyApp(commands::BevyApp), BevyEcs(commands::BevyEcs), } @@ -146,6 +147,7 @@ impl Prepare for Commands { Commands::CompileFail(subcommand) => subcommand.prepare(sh, args), Commands::BenchCheck(subcommand) => subcommand.prepare(sh, args), Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), + Commands::BevyAnimation(subcommand) => subcommand.prepare(sh, args), Commands::BevyApp(subcommand) => subcommand.prepare(sh, args), Commands::BevyEcs(subcommand) => subcommand.prepare(sh, args), } diff --git a/tools/ci/src/commands/bevy_animation.rs b/tools/ci/src/commands/bevy_animation.rs new file mode 100644 index 0000000000000..425790ca9e155 --- /dev/null +++ b/tools/ci/src/commands/bevy_animation.rs @@ -0,0 +1,20 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_animation`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_animation")] +pub struct BevyAnimation {} + +impl Prepare for BevyAnimation { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + ClippyPermutations { + crate_name: "bevy_animation", + features: &[], + all_features_features: &[], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippys.rs b/tools/ci/src/commands/clippys.rs index 090a536289ccd..8d8e4eb93e2d7 100644 --- a/tools/ci/src/commands/clippys.rs +++ b/tools/ci/src/commands/clippys.rs @@ -1,6 +1,6 @@ use crate::{ args::Args, - commands::{BevyApp, BevyEcs}, + commands::{BevyAnimation, BevyApp, BevyEcs}, Prepare, PreparedCommand, }; use argh::FromArgs; @@ -14,6 +14,7 @@ impl Prepare for ClippysCommand { fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { let mut commands = Vec::new(); + commands.append(&mut BevyAnimation::default().prepare(sh, args)); commands.append(&mut BevyApp::default().prepare(sh, args)); commands.append(&mut BevyEcs::default().prepare(sh, args)); diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index 84acd29298e43..a6c4cc4e41a6a 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,4 +1,5 @@ pub use bench_check::*; +pub use bevy_animation::*; pub use bevy_app::*; pub use bevy_ecs::*; pub use clippy::*; @@ -19,6 +20,7 @@ pub use test::*; pub use test_check::*; mod bench_check; +mod bevy_animation; mod bevy_app; mod bevy_ecs; mod clippy; From 9abcb305cb17a11f679c5759ac72a2b8278f6ff8 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:38:15 -0300 Subject: [PATCH 12/24] Convert `bevy_a11y` recipe into `ci` tool --- justfile | 16 --------------- .../release-notes/pedantic_ci_commands.md | 6 ++++++ tools/ci/src/ci.rs | 2 ++ tools/ci/src/commands/bevy_a11y.rs | 20 +++++++++++++++++++ tools/ci/src/commands/clippys.rs | 7 ++----- tools/ci/src/commands/mod.rs | 2 ++ 6 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 tools/ci/src/commands/bevy_a11y.rs diff --git a/justfile b/justfile index cbc6e385a03ed..7f931787cb043 100644 --- a/justfile +++ b/justfile @@ -22,22 +22,6 @@ clippy_android target=default_android_target: clippy_dlss: cargo clippy -p bevy_anti_alias --no-default-features --features="dlss" -# Runs clippy on `bevy_a11y`, with all this permutations of features -# * --no-default-features -# * --no-default-features --features="*each feature in Cargo.toml individually*" -# * "default features" -# * --all-features -[doc("Runs clippy for `bevy_a11y`")] -[group("clippy")] -bevy_a11y: - cargo clippy -p bevy_a11y --no-default-features - cargo clippy -p bevy_a11y --no-default-features --features="bevy_reflect" - cargo clippy -p bevy_a11y --no-default-features --features="serialize" - cargo clippy -p bevy_a11y --no-default-features --features="std" - cargo clippy -p bevy_a11y --no-default-features --features="critical-section" - cargo clippy -p bevy_a11y - cargo clippy -p bevy_a11y --all-features - # Runs clippy on `bevy_android`, with all this permutations of features # * --no-default-features # * "default features" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index dfd4f6b322152..581b1baa171ab 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -22,6 +22,12 @@ This is a meta commands that runs the other clippy permutation commands. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. +### `bevy_a11y` + +Runs clippy on `bevy_a11y` with multiple feature permutations. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_a11y`. + ### `bevy_animation` Runs clippy on `bevy_animation` with multiple feature permutations. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index eb3d719ac257c..2e067022200a3 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -121,6 +121,7 @@ enum Commands { CompileFail(commands::CompileFailCommand), BenchCheck(commands::BenchCheckCommand), ExampleCheck(commands::ExampleCheckCommand), + BevyA11y(commands::BevyA11y), BevyAnimation(commands::BevyAnimation), BevyApp(commands::BevyApp), BevyEcs(commands::BevyEcs), @@ -147,6 +148,7 @@ impl Prepare for Commands { Commands::CompileFail(subcommand) => subcommand.prepare(sh, args), Commands::BenchCheck(subcommand) => subcommand.prepare(sh, args), Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), + Commands::BevyA11y(subcommand) => subcommand.prepare(sh, args), Commands::BevyAnimation(subcommand) => subcommand.prepare(sh, args), Commands::BevyApp(subcommand) => subcommand.prepare(sh, args), Commands::BevyEcs(subcommand) => subcommand.prepare(sh, args), diff --git a/tools/ci/src/commands/bevy_a11y.rs b/tools/ci/src/commands/bevy_a11y.rs new file mode 100644 index 0000000000000..17e12bbf01120 --- /dev/null +++ b/tools/ci/src/commands/bevy_a11y.rs @@ -0,0 +1,20 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_a11y`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_a11y")] +pub struct BevyA11y {} + +impl Prepare for BevyA11y { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + ClippyPermutations { + crate_name: "bevy_a11y", + features: &["bevy_reflect", "serialize", "std", "critical-section"], + all_features_features: &[], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippys.rs b/tools/ci/src/commands/clippys.rs index 8d8e4eb93e2d7..cb72842ad148c 100644 --- a/tools/ci/src/commands/clippys.rs +++ b/tools/ci/src/commands/clippys.rs @@ -1,8 +1,4 @@ -use crate::{ - args::Args, - commands::{BevyAnimation, BevyApp, BevyEcs}, - Prepare, PreparedCommand, -}; +use crate::{args::Args, commands::*, Prepare, PreparedCommand}; use argh::FromArgs; /// Check for clippy warnings and errors running multiple permutations of features. @@ -14,6 +10,7 @@ impl Prepare for ClippysCommand { fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { let mut commands = Vec::new(); + commands.append(&mut BevyA11y::default().prepare(sh, args)); commands.append(&mut BevyAnimation::default().prepare(sh, args)); commands.append(&mut BevyApp::default().prepare(sh, args)); commands.append(&mut BevyEcs::default().prepare(sh, args)); diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index a6c4cc4e41a6a..d51781bac4644 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,4 +1,5 @@ pub use bench_check::*; +pub use bevy_a11y::*; pub use bevy_animation::*; pub use bevy_app::*; pub use bevy_ecs::*; @@ -20,6 +21,7 @@ pub use test::*; pub use test_check::*; mod bench_check; +mod bevy_a11y; mod bevy_animation; mod bevy_app; mod bevy_ecs; From 2ffddb0242eee293145cc16bfbed5d9003232f5a Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:45:09 -0300 Subject: [PATCH 13/24] Convert `bevy_anti_alias` recipe into `ci` tool --- justfile | 22 ---------------- .../release-notes/pedantic_ci_commands.md | 6 +++++ tools/ci/src/ci.rs | 2 ++ tools/ci/src/commands/bevy_anti_alias.rs | 25 +++++++++++++++++++ tools/ci/src/commands/clippys.rs | 1 + tools/ci/src/commands/mod.rs | 2 ++ 6 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 tools/ci/src/commands/bevy_anti_alias.rs diff --git a/justfile b/justfile index 7f931787cb043..4ca95088b2b50 100644 --- a/justfile +++ b/justfile @@ -38,25 +38,3 @@ bevy_android target=default_android_target: cargo clippy -p bevy_android --target="{{target}}" cargo clippy -p bevy_android --all-features --target="{{target}}" -# Runs clippy on `bevy_anti_alias`, with all this permutations of features -# * --no-default-features -# * --no-default-features --features="*each feature in Cargo.toml individually*" -# * "default features" -# * --all-features -# -# Some of the features require that either `bevy_image/zstd_rust` or -# `bevy_image/zstd_c` be enabled. -# -# The `dlss` feature, without the `force_disable_dlss`, requires the environment -# variable `DLSS_SDK`. See `dlss_wgpu` README for more information. -[doc("Runs clippy for `bevy_anti_alias`")] -[group("clippy")] -bevy_anti_alias: - cargo clippy -p bevy_anti_alias --no-default-features - cargo clippy -p bevy_anti_alias --no-default-features --features="trace" - cargo clippy -p bevy_anti_alias --no-default-features --features="smaa_luts bevy_image/zstd_rust" - cargo clippy -p bevy_anti_alias --no-default-features --features="smaa_luts bevy_image/zstd_c" - cargo clippy -p bevy_anti_alias --no-default-features --features="dlss force_disable_dlss" - cargo clippy -p bevy_anti_alias - cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_rust" - cargo clippy -p bevy_anti_alias --all-features --features="bevy_image/zstd_c" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index 581b1baa171ab..e4835d9367ea8 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -34,6 +34,12 @@ Runs clippy on `bevy_animation` with multiple feature permutations. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_animation`. +### `bevy_anti_alias` + +Runs clippy on `bevy_anti_alias` with multiple feature permutations. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_anti_alias`. + ### `bevy_app` Runs clippy on `bevy_app` with multiple feature permutations. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index 2e067022200a3..ab00b6564f835 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -123,6 +123,7 @@ enum Commands { ExampleCheck(commands::ExampleCheckCommand), BevyA11y(commands::BevyA11y), BevyAnimation(commands::BevyAnimation), + BevyAntiAlias(commands::BevyAntiAlias), BevyApp(commands::BevyApp), BevyEcs(commands::BevyEcs), } @@ -150,6 +151,7 @@ impl Prepare for Commands { Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), Commands::BevyA11y(subcommand) => subcommand.prepare(sh, args), Commands::BevyAnimation(subcommand) => subcommand.prepare(sh, args), + Commands::BevyAntiAlias(subcommand) => subcommand.prepare(sh, args), Commands::BevyApp(subcommand) => subcommand.prepare(sh, args), Commands::BevyEcs(subcommand) => subcommand.prepare(sh, args), } diff --git a/tools/ci/src/commands/bevy_anti_alias.rs b/tools/ci/src/commands/bevy_anti_alias.rs new file mode 100644 index 0000000000000..c39ccf3c06f13 --- /dev/null +++ b/tools/ci/src/commands/bevy_anti_alias.rs @@ -0,0 +1,25 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_anti_alias`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_anti_alias")] +pub struct BevyAntiAlias {} + +impl Prepare for BevyAntiAlias { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + ClippyPermutations { + crate_name: "bevy_anti_alias", + features: &[ + "trace", + "smaa_luts bevy_image/zstd_rust", + "smaa_luts bevy_image/zstd_c", + "dlss force_disable_dlss", + ], + all_features_features: &["bevy_image/zstd_rust", "bevy_image/zstd_c"], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippys.rs b/tools/ci/src/commands/clippys.rs index cb72842ad148c..fa0f85405cabb 100644 --- a/tools/ci/src/commands/clippys.rs +++ b/tools/ci/src/commands/clippys.rs @@ -12,6 +12,7 @@ impl Prepare for ClippysCommand { commands.append(&mut BevyA11y::default().prepare(sh, args)); commands.append(&mut BevyAnimation::default().prepare(sh, args)); + commands.append(&mut BevyAntiAlias::default().prepare(sh, args)); commands.append(&mut BevyApp::default().prepare(sh, args)); commands.append(&mut BevyEcs::default().prepare(sh, args)); diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index d51781bac4644..095d6fbdb4441 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,6 +1,7 @@ pub use bench_check::*; pub use bevy_a11y::*; pub use bevy_animation::*; +pub use bevy_anti_alias::*; pub use bevy_app::*; pub use bevy_ecs::*; pub use clippy::*; @@ -23,6 +24,7 @@ pub use test_check::*; mod bench_check; mod bevy_a11y; mod bevy_animation; +mod bevy_anti_alias; mod bevy_app; mod bevy_ecs; mod clippy; From 1f74c2f5ba78ad27bd26f581df900fabd6957b62 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 09:51:38 -0300 Subject: [PATCH 14/24] Convert `clippy_dlss` recipe into `ci` tool --- justfile | 6 ----- .../release-notes/pedantic_ci_commands.md | 6 +++++ tools/ci/src/ci.rs | 2 ++ tools/ci/src/commands/clippy_dlss.rs | 22 +++++++++++++++++++ tools/ci/src/commands/mod.rs | 2 ++ 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 tools/ci/src/commands/clippy_dlss.rs diff --git a/justfile b/justfile index 4ca95088b2b50..76a948aabb2b2 100644 --- a/justfile +++ b/justfile @@ -16,12 +16,6 @@ clippy: clippy_android target=default_android_target: @just bevy_android {{target}} -# These are crates that have features that require `DLSS_SDK`. -[doc("Runs clippy on all of Bevy's crates that use DLSS (TODO)")] -[group("ci")] -clippy_dlss: - cargo clippy -p bevy_anti_alias --no-default-features --features="dlss" - # Runs clippy on `bevy_android`, with all this permutations of features # * --no-default-features # * "default features" diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index e4835d9367ea8..64d32c93924ca 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -22,6 +22,12 @@ This is a meta commands that runs the other clippy permutation commands. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. +### `clippy_dlss` + +Runs clippy on crates and features that require the Dlss SDK. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippy_dlss`. + ### `bevy_a11y` Runs clippy on `bevy_a11y` with multiple feature permutations. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index ab00b6564f835..8c82710d7a8b5 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -110,6 +110,7 @@ enum Commands { // Actual subcommands Format(commands::FormatCommand), Clippy(commands::ClippyCommand), + ClippyDlss(commands::ClippyDlssCommand), Test(commands::TestCommand), TestCheck(commands::TestCheckCommand), IntegrationTest(commands::IntegrationTestCommand), @@ -138,6 +139,7 @@ impl Prepare for Commands { Commands::Format(subcommand) => subcommand.prepare(sh, args), Commands::Clippy(subcommand) => subcommand.prepare(sh, args), + Commands::ClippyDlss(subcommand) => subcommand.prepare(sh, args), Commands::Test(subcommand) => subcommand.prepare(sh, args), Commands::TestCheck(subcommand) => subcommand.prepare(sh, args), Commands::IntegrationTest(subcommand) => subcommand.prepare(sh, args), diff --git a/tools/ci/src/commands/clippy_dlss.rs b/tools/ci/src/commands/clippy_dlss.rs new file mode 100644 index 0000000000000..3256f329db83b --- /dev/null +++ b/tools/ci/src/commands/clippy_dlss.rs @@ -0,0 +1,22 @@ +use crate::{args::Args, Prepare, PreparedCommand}; +use argh::FromArgs; +use xshell::cmd; + +/// Check for clippy warnings and errors for crates/features that require Dlss SDK. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "clippy_dlss")] +pub struct ClippyDlssCommand {} + +impl Prepare for ClippyDlssCommand { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + let jobs = args.build_jobs(); + + vec![PreparedCommand::new::( + cmd!( + sh, + "cargo clippy -p bevy_anti_alias --no-default-features --features=dlss {jobs...} -- -Dwarnings" + ), + "Please fix clippy errors in output above.", + )] + } +} diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index 095d6fbdb4441..3470a9547d078 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -5,6 +5,7 @@ pub use bevy_anti_alias::*; pub use bevy_app::*; pub use bevy_ecs::*; pub use clippy::*; +pub use clippy_dlss::*; pub use clippys::*; pub use compile::*; pub use compile_check::*; @@ -28,6 +29,7 @@ mod bevy_anti_alias; mod bevy_app; mod bevy_ecs; mod clippy; +mod clippy_dlss; mod clippy_permutations; mod clippys; mod compile; From 389ef9cc111105f43f885f9e3e8c041e96d3c834 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:01:06 -0300 Subject: [PATCH 15/24] Fixes to `clippy_permutations` --- tools/ci/src/commands/clippy_permutations.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ci/src/commands/clippy_permutations.rs b/tools/ci/src/commands/clippy_permutations.rs index 45b179c30ec03..728f369dca5c2 100644 --- a/tools/ci/src/commands/clippy_permutations.rs +++ b/tools/ci/src/commands/clippy_permutations.rs @@ -29,7 +29,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --no-default-features {jobs_ref...}" + "cargo clippy -p {crate_name} --no-default-features {jobs_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -38,7 +38,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --no-default-features --features={feature} {jobs_ref...}" + "cargo clippy -p {crate_name} --no-default-features --features={feature} {jobs_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -47,7 +47,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --no-default-features {jobs_ref...}" + "cargo clippy -p {crate_name} {jobs_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -56,7 +56,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --all-features {jobs_ref...}" + "cargo clippy -p {crate_name} --all-features {jobs_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -65,7 +65,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --all-features --features={feature} {jobs_ref...}" + "cargo clippy -p {crate_name} --all-features --features={feature} {jobs_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); From 9bf737787daec8055b51d03899ac23a610526d90 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:32:27 -0300 Subject: [PATCH 16/24] Add `target` argument --- tools/ci/src/args.rs | 11 +++++++++++ tools/ci/src/ci.rs | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/tools/ci/src/args.rs b/tools/ci/src/args.rs index 574d98f192ca3..64b76eb77d54a 100644 --- a/tools/ci/src/args.rs +++ b/tools/ci/src/args.rs @@ -6,6 +6,7 @@ pub struct Args { keep_going: bool, test_threads: Option, build_jobs: Option, + target: Option<&'static str>, } impl Args { @@ -24,6 +25,12 @@ impl Args { self.test_threads .map(|threads| format!("--test-threads={threads}")) } + + #[inline(always)] + pub fn target(&self) -> Option { + self.target + .map(|threads| format!("--test-threads={threads}")) + } } impl From<&CI> for Args { @@ -32,6 +39,10 @@ impl From<&CI> for Args { keep_going: value.keep_going, test_threads: value.test_threads, build_jobs: value.build_jobs, + target: value.target.as_ref().map(|string| { + let s: &'static str = string.clone().leak(); + s + }), } } } diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index 8c82710d7a8b5..5c920c56f2631 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -22,6 +22,10 @@ pub struct CI { /// number of build jobs #[argh(option)] pub(crate) build_jobs: Option, + + /// target to compile to + #[argh(option)] + pub(crate) target: Option, } impl CI { From 6d65af0342738e68136769772245c8d6101f510e Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:33:55 -0300 Subject: [PATCH 17/24] Fix wrong paramenter returned for `target` --- tools/ci/src/args.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci/src/args.rs b/tools/ci/src/args.rs index 64b76eb77d54a..4c23a78364222 100644 --- a/tools/ci/src/args.rs +++ b/tools/ci/src/args.rs @@ -28,8 +28,7 @@ impl Args { #[inline(always)] pub fn target(&self) -> Option { - self.target - .map(|threads| format!("--test-threads={threads}")) + self.target.map(|target| format!("--target={target}")) } } From 0b2e1fd4e3689fd6fa6dcb95fc843c800e30a550 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:38:04 -0300 Subject: [PATCH 18/24] Add helper to test if target is Android --- tools/ci/src/args.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/ci/src/args.rs b/tools/ci/src/args.rs index 4c23a78364222..bdc603d4251bf 100644 --- a/tools/ci/src/args.rs +++ b/tools/ci/src/args.rs @@ -1,5 +1,11 @@ use crate::CI; +/// Android targets +const ANDROID_TARGETS: &[&str] = &[ + "aarch64-linux-android", + // Help expand this +]; + /// Arguments that are available to CI commands. #[derive(Copy, Clone, PartialEq, Eq)] pub struct Args { @@ -30,6 +36,15 @@ impl Args { pub fn target(&self) -> Option { self.target.map(|target| format!("--target={target}")) } + + /// Tests if the target is an android target + pub fn is_android_target(&self) -> bool { + if let Some(target) = &self.target { + ANDROID_TARGETS.contains(target) + } else { + cfg!(target_os = "android") + } + } } impl From<&CI> for Args { From 8fb76e751605c8340bd721cc0cd255054e9f61e1 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:41:05 -0300 Subject: [PATCH 19/24] Convert `clippy_android` and `bevy_android` recipes into `ci` tools --- justfile | 34 ------------------- .../release-notes/pedantic_ci_commands.md | 6 ++++ tools/ci/src/ci.rs | 4 +++ tools/ci/src/commands/bevy_android.rs | 24 +++++++++++++ tools/ci/src/commands/clippy_android.rs | 21 ++++++++++++ tools/ci/src/commands/mod.rs | 4 +++ 6 files changed, 59 insertions(+), 34 deletions(-) delete mode 100644 justfile create mode 100644 tools/ci/src/commands/bevy_android.rs create mode 100644 tools/ci/src/commands/clippy_android.rs diff --git a/justfile b/justfile deleted file mode 100644 index 76a948aabb2b2..0000000000000 --- a/justfile +++ /dev/null @@ -1,34 +0,0 @@ -export RUSTFLAGS := "-Dwarnings" - -default_android_target := "aarch64-linux-android" - -[doc("Runs clippy on all of Bevy's crates (TODO)")] -[group("ci")] -clippy: - @just bevy_a11y - @just bevy_app - @just bevy_animation - @just bevy_anti_alias - @just bevy_ecs - -[doc("Runs clippy on all of Bevy's crates for Android targets (TODO)")] -[group("ci")] -clippy_android target=default_android_target: - @just bevy_android {{target}} - -# Runs clippy on `bevy_android`, with all this permutations of features -# * --no-default-features -# * "default features" -# * --all-features -# -# `bevy_android` only exists for `target_os="android"`. Which means that it -# requires either one of these targets: -# * aarch64-linux-android -# * List is not exhaustive -[doc("Runs clippy for `bevy_android`")] -[group("clippy")] -bevy_android target=default_android_target: - cargo clippy -p bevy_android --no-default-features --target="{{target}}" - cargo clippy -p bevy_android --target="{{target}}" - cargo clippy -p bevy_android --all-features --target="{{target}}" - diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index 64d32c93924ca..f52dd863412e2 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -22,6 +22,12 @@ This is a meta commands that runs the other clippy permutation commands. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. +### `clippy_android` + +Runs clippy on crates for Android targets. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippy_android`. + ### `clippy_dlss` Runs clippy on crates and features that require the Dlss SDK. diff --git a/tools/ci/src/ci.rs b/tools/ci/src/ci.rs index 5c920c56f2631..ea87616895311 100644 --- a/tools/ci/src/ci.rs +++ b/tools/ci/src/ci.rs @@ -114,6 +114,7 @@ enum Commands { // Actual subcommands Format(commands::FormatCommand), Clippy(commands::ClippyCommand), + ClippyAndroid(commands::ClippyAndroidCommand), ClippyDlss(commands::ClippyDlssCommand), Test(commands::TestCommand), TestCheck(commands::TestCheckCommand), @@ -127,6 +128,7 @@ enum Commands { BenchCheck(commands::BenchCheckCommand), ExampleCheck(commands::ExampleCheckCommand), BevyA11y(commands::BevyA11y), + BevyAndroid(commands::BevyAndroid), BevyAnimation(commands::BevyAnimation), BevyAntiAlias(commands::BevyAntiAlias), BevyApp(commands::BevyApp), @@ -143,6 +145,7 @@ impl Prepare for Commands { Commands::Format(subcommand) => subcommand.prepare(sh, args), Commands::Clippy(subcommand) => subcommand.prepare(sh, args), + Commands::ClippyAndroid(subcommand) => subcommand.prepare(sh, args), Commands::ClippyDlss(subcommand) => subcommand.prepare(sh, args), Commands::Test(subcommand) => subcommand.prepare(sh, args), Commands::TestCheck(subcommand) => subcommand.prepare(sh, args), @@ -156,6 +159,7 @@ impl Prepare for Commands { Commands::BenchCheck(subcommand) => subcommand.prepare(sh, args), Commands::ExampleCheck(subcommand) => subcommand.prepare(sh, args), Commands::BevyA11y(subcommand) => subcommand.prepare(sh, args), + Commands::BevyAndroid(subcommand) => subcommand.prepare(sh, args), Commands::BevyAnimation(subcommand) => subcommand.prepare(sh, args), Commands::BevyAntiAlias(subcommand) => subcommand.prepare(sh, args), Commands::BevyApp(subcommand) => subcommand.prepare(sh, args), diff --git a/tools/ci/src/commands/bevy_android.rs b/tools/ci/src/commands/bevy_android.rs new file mode 100644 index 0000000000000..6e4774ae6bff8 --- /dev/null +++ b/tools/ci/src/commands/bevy_android.rs @@ -0,0 +1,24 @@ +use crate::{ + args::Args, commands::clippy_permutations::ClippyPermutations, Prepare, PreparedCommand, +}; +use argh::FromArgs; + +/// Check for clippy warnings and errors on `bevy_android`. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "bevy_android")] +pub struct BevyAndroid {} + +impl Prepare for BevyAndroid { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + if !args.is_android_target() { + panic!("BevyAndroid requires an Android target."); + } + + ClippyPermutations { + crate_name: "bevy_android", + features: &[], + all_features_features: &[], + } + .build::(sh, args) + } +} diff --git a/tools/ci/src/commands/clippy_android.rs b/tools/ci/src/commands/clippy_android.rs new file mode 100644 index 0000000000000..e90bea60db608 --- /dev/null +++ b/tools/ci/src/commands/clippy_android.rs @@ -0,0 +1,21 @@ +use crate::{args::Args, commands::BevyAndroid, Prepare, PreparedCommand}; +use argh::FromArgs; + +/// Check for clippy warnings and errors for Android targets. +#[derive(FromArgs, Default)] +#[argh(subcommand, name = "clippy_android")] +pub struct ClippyAndroidCommand {} + +impl Prepare for ClippyAndroidCommand { + fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec> { + if !args.is_android_target() { + panic!("ClippyAndroidCommand requires an Android target."); + } + + let mut commands = Vec::new(); + + commands.append(&mut BevyAndroid::default().prepare(sh, args)); + + commands + } +} diff --git a/tools/ci/src/commands/mod.rs b/tools/ci/src/commands/mod.rs index 3470a9547d078..dc8e80f981478 100644 --- a/tools/ci/src/commands/mod.rs +++ b/tools/ci/src/commands/mod.rs @@ -1,10 +1,12 @@ pub use bench_check::*; pub use bevy_a11y::*; +pub use bevy_android::*; pub use bevy_animation::*; pub use bevy_anti_alias::*; pub use bevy_app::*; pub use bevy_ecs::*; pub use clippy::*; +pub use clippy_android::*; pub use clippy_dlss::*; pub use clippys::*; pub use compile::*; @@ -24,11 +26,13 @@ pub use test_check::*; mod bench_check; mod bevy_a11y; +mod bevy_android; mod bevy_animation; mod bevy_anti_alias; mod bevy_app; mod bevy_ecs; mod clippy; +mod clippy_android; mod clippy_dlss; mod clippy_permutations; mod clippys; From 7cfcb2a878aa077c46b32ab9d51e3c6b55871216 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:46:23 -0300 Subject: [PATCH 20/24] Add `bevy_android` to release notes --- .../release-notes/pedantic_ci_commands.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index f52dd863412e2..6ae34e297ceb9 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -24,9 +24,10 @@ If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippys`. ### `clippy_android` -Runs clippy on crates for Android targets. +Runs clippy on crates for Android targets. Requires an Android +target. -If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 clippy_android`. +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 --target aarch64-linux-android clippy_android`. ### `clippy_dlss` @@ -40,6 +41,13 @@ Runs clippy on `bevy_a11y` with multiple feature permutations. If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_a11y`. +### `bevy_android` + +Runs clippy on `bevy_android` with multiple feature permutations. Requires an Android +target. + +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 --target aarch64-linux-android bevy_android`. + ### `bevy_animation` Runs clippy on `bevy_animation` with multiple feature permutations. From 9950c9f5b96d9972466f8ecd125aa35668aefa36 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:46:54 -0300 Subject: [PATCH 21/24] Use `target` on clippy permutations --- tools/ci/src/commands/clippy_permutations.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/ci/src/commands/clippy_permutations.rs b/tools/ci/src/commands/clippy_permutations.rs index 728f369dca5c2..6000c194767a4 100644 --- a/tools/ci/src/commands/clippy_permutations.rs +++ b/tools/ci/src/commands/clippy_permutations.rs @@ -20,6 +20,8 @@ impl ClippyPermutations { ) -> Vec> { let jobs = args.build_jobs(); let jobs_ref = jobs.as_ref(); + let target = args.target(); + let target_ref = target.as_ref(); let crate_name = self.crate_name; let mut permutations = @@ -29,7 +31,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --no-default-features {jobs_ref...} -- -Dwarnings" + "cargo clippy -p {crate_name} --no-default-features {jobs_ref...} {target_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -38,7 +40,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --no-default-features --features={feature} {jobs_ref...} -- -Dwarnings" + "cargo clippy -p {crate_name} --no-default-features --features={feature} {jobs_ref...} {target_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -47,7 +49,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} {jobs_ref...} -- -Dwarnings" + "cargo clippy -p {crate_name} {jobs_ref...} {target_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -56,7 +58,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --all-features {jobs_ref...} -- -Dwarnings" + "cargo clippy -p {crate_name} --all-features {jobs_ref...} {target_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); @@ -65,7 +67,7 @@ impl ClippyPermutations { permutations.push(PreparedCommand::new::( cmd!( sh, - "cargo clippy -p {crate_name} --all-features --features={feature} {jobs_ref...} -- -Dwarnings" + "cargo clippy -p {crate_name} --all-features --features={feature} {jobs_ref...} {target_ref...} -- -Dwarnings" ), "Please fix clippy errors in output above.", )); From e2daf76ff082649d7ba3018f43e9dee1c4ba8d48 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:52:05 -0300 Subject: [PATCH 22/24] Super linter --- release-content/release-notes/pedantic_ci_commands.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index 6ae34e297ceb9..7a8cfdfa89591 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -6,6 +6,7 @@ pull_requests: [todo] New commands were added to CI tool to allow running clippy with multiple permutations of features. For a crate it is run with: + * `--no-default-features` * Multiple `--no-default-features --features="..."` * Default features @@ -16,6 +17,7 @@ another crate that has a switchable features. Examples are `bevy_image/zstd_c` o `bevy_image/zstd_rust`, or `bevy_reflect/auto_register_inventory` or `bevy_reflect/auto_register_static`. ## Commands + ### `clippys` This is a meta commands that runs the other clippy permutation commands. From 2d2e208183193d3898aff5d1807fa0faea6b5b3c Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 10:52:31 -0300 Subject: [PATCH 23/24] Add PR number --- release-content/release-notes/pedantic_ci_commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index 7a8cfdfa89591..b1eebb07efc3a 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -1,7 +1,7 @@ --- title: Pedantic CI commands authors: ["@hukasu"] -pull_requests: [todo] +pull_requests: [21145] --- New commands were added to CI tool to allow running clippy with multiple permutations of From 6ce3f9a91d9d44e2b0ef325958a4764640f50631 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sun, 21 Sep 2025 14:02:00 -0300 Subject: [PATCH 24/24] Linter --- release-content/release-notes/pedantic_ci_commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-content/release-notes/pedantic_ci_commands.md b/release-content/release-notes/pedantic_ci_commands.md index b1eebb07efc3a..727077282bd8f 100644 --- a/release-content/release-notes/pedantic_ci_commands.md +++ b/release-content/release-notes/pedantic_ci_commands.md @@ -72,4 +72,4 @@ If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_app`. Runs clippy on `bevy_ecs` with multiple feature permutations. -If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_ecs`. \ No newline at end of file +If you are on the workspace, run `cargo run -p ci -- --build-jobs 4 bevy_ecs`.