From 61ed2b905d61a3c451789a9f2c5fa5fe5f287f2b Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sun, 24 Apr 2022 17:07:43 +0100 Subject: [PATCH] Allow warnings when developing, but still fail CI --- agb/.cargo/config.toml | 2 +- .../the-hat-chooses-the-wizard/src/level_display.rs | 10 ++-------- justfile | 5 +++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/agb/.cargo/config.toml b/agb/.cargo/config.toml index 2b290d66..54493f4b 100644 --- a/agb/.cargo/config.toml +++ b/agb/.cargo/config.toml @@ -6,5 +6,5 @@ build-std-features = ["compiler-builtins-mem"] target = "thumbv4t-none-eabi" [target.thumbv4t-none-eabi] -rustflags = ["-Clink-arg=-Tgba.ld", "-Ctarget-cpu=arm7tdmi", "-Dwarnings", "-Dclippy::all", "-Aclippy::empty-loop"] +rustflags = ["-Clink-arg=-Tgba.ld", "-Ctarget-cpu=arm7tdmi"] runner = "mgba-test-runner" diff --git a/examples/the-hat-chooses-the-wizard/src/level_display.rs b/examples/the-hat-chooses-the-wizard/src/level_display.rs index 4019ad55..990e7635 100644 --- a/examples/the-hat-chooses-the-wizard/src/level_display.rs +++ b/examples/the-hat-chooses-the-wizard/src/level_display.rs @@ -30,16 +30,10 @@ pub fn write_level( map.set_tile( vram, (i as u16, 0).into(), - &tileset, + tileset, TileSetting::from_raw(tile), ); } - map.set_scroll_pos( - ( - -(WIDTH / 2 - 7 as i32 * 8 / 2) as u16, - -(HEIGHT / 2 - 4) as u16, - ) - .into(), - ); + map.set_scroll_pos((-(WIDTH / 2 - 7 * 8 / 2) as u16, -(HEIGHT / 2 - 4) as u16).into()); } diff --git a/justfile b/justfile index b0d6b9d3..a5467f61 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,5 @@ export CARGO_TARGET_DIR := env_var_or_default('CARGO_TARGET_DIR', justfile_directory() + "/target") +CLIPPY_ARGUMENTS := "-Dwarnings -Dclippy::all -Aclippy::empty-loop" build: build-roms @@ -61,7 +62,7 @@ _build-rom folder name: TARGET_FOLDER="${CARGO_TARGET_DIR:-$GAME_FOLDER/target}" GBA_FILE="$TARGET_FOLDER/$GAME_NAME.gba" - (cd "$GAME_FOLDER" && cargo build --release --target thumbv4t-none-eabi && cargo clippy --release --target thumbv4t-none-eabi) + (cd "$GAME_FOLDER" && cargo build --release --target thumbv4t-none-eabi && cargo clippy --release --target thumbv4t-none-eabi -- {{CLIPPY_ARGUMENTS}}) mkdir -p examples/target/examples @@ -87,7 +88,7 @@ _test-debug crate: just _build-debug {{crate}} (cd "{{crate}}" && cargo test) _clippy crate: - (cd "{{crate}}" && cargo clippy --examples --tests) + (cd "{{crate}}" && cargo clippy --examples --tests -- {{CLIPPY_ARGUMENTS}}) _clean crate: (cd "{{crate}}" && cargo clean)