Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Leafwing-Studios/leafwing_abilities
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: daa924abcfe25482673ff121be0ef75ed630a9b0
Choose a base ref
..
head repository: Leafwing-Studios/leafwing_abilities
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5634066f4a48a37c38403c99963a61fbc7c3b9d4
Choose a head ref
Showing with 19 additions and 11 deletions.
  1. +1 −1 tools/ci/Cargo.toml
  2. +18 −10 tools/ci/src/main.rs
2 changes: 1 addition & 1 deletion tools/ci/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
xshell = "0.2"
28 changes: 18 additions & 10 deletions tools/ci/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
use xshell::cmd;
use xshell::{cmd, Shell};

fn main() {
// When run locally, results may differ from actual CI runs triggered by
// .github/workflows/ci.yml
// - 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.");
}