From 440acd8386cb3bbf2d23480fd79cb67f7d62c0ad Mon Sep 17 00:00:00 2001 From: Coster Date: Tue, 3 Dec 2024 16:44:22 +0000 Subject: [PATCH] Update tools/ci to use newer xshell Xshell 1.0 is not compatible with nightly rust, and may not be comatible with upcoming stable rust versions. See https://github.com/matklad/xshell/pull/97 --- macros/src/abilitylike.rs | 1 - src/premade_pools.rs | 1 - tools/ci/Cargo.toml | 2 +- tools/ci/src/main.rs | 28 ++++++++++++++++++---------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/macros/src/abilitylike.rs b/macros/src/abilitylike.rs index c8eceb4..779a6de 100644 --- a/macros/src/abilitylike.rs +++ b/macros/src/abilitylike.rs @@ -7,7 +7,6 @@ use syn::{DeriveInput, Ident}; /// This approach and implementation is inspired by the `strum` crate, /// Copyright (c) 2019 Peter Glotfelty /// available under the MIT License at https://github.com/Peternator7/strum - pub(crate) fn abilitylike_inner(ast: &DeriveInput) -> TokenStream { // Splitting the abstract syntax tree let enum_name = &ast.ident; diff --git a/src/premade_pools.rs b/src/premade_pools.rs index 03dca1f..23e5cab 100644 --- a/src/premade_pools.rs +++ b/src/premade_pools.rs @@ -37,7 +37,6 @@ pub mod life { /// # Panics /// Panics if `current` is greater than `max`. /// Panics if `current` or max is negative. - pub fn new(current: Life, max: Life, regen_per_second: Life) -> Self { assert!(current <= max); assert!(current >= LifePool::MIN); diff --git a/tools/ci/Cargo.toml b/tools/ci/Cargo.toml index 8f31bd3..bc21900 100644 --- a/tools/ci/Cargo.toml +++ b/tools/ci/Cargo.toml @@ -6,4 +6,4 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -xshell = "0.1" \ No newline at end of file +xshell = "0.2" diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index 37e5945..dd99ad4 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -1,4 +1,4 @@ -use xshell::cmd; +use xshell::{cmd, Shell}; fn main() { // When run locally, results may differ from actual CI runs triggered by @@ -6,29 +6,37 @@ fn main() { // - Official CI runs latest stable // - Local runs use whatever the default Rust is locally + let sh = Shell::new().unwrap(); + // See if any code needs to be formatted - cmd!("cargo fmt --all -- --check") + cmd!(sh, "cargo fmt --all -- --check") .run() .expect("Please run `cargo fmt --all` to format your code."); // See if clippy has any complaints. // - Type complexity must be ignored because we use huge templates for queries - cmd!("cargo clippy --workspace --all-features -- -D warnings -A clippy::type_complexity") - .run() - .expect("Please fix `cargo clippy` errors with all features enabled."); + cmd!( + sh, + "cargo clippy --workspace --all-features -- -D warnings -A clippy::type_complexity" + ) + .run() + .expect("Please fix `cargo clippy` errors with all features enabled."); // Check for errors with no features enabled - cmd!("cargo check --workspace --no-default-features") + cmd!(sh, "cargo check --workspace --no-default-features") .run() .expect("Please fix `cargo check` errors with no features enabled ."); // Check for errors with default features enabled - cmd!("cargo check --workspace") + cmd!(sh, "cargo check --workspace") .run() .expect("Please fix `cargo check` errors with default features enabled."); // Check the examples with clippy - cmd!("cargo clippy --examples -- -D warnings -A clippy::type_complexity") - .run() - .expect("Please fix `cargo clippy` errors for the examples."); + cmd!( + sh, + "cargo clippy --examples -- -D warnings -A clippy::type_complexity" + ) + .run() + .expect("Please fix `cargo clippy` errors for the examples."); }