From 1b210d80a7ac77fb7b1fe434b460714e9ff0a752 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 18 Aug 2024 14:02:35 -0500 Subject: [PATCH] workflow - fix hemtt lint, drop sqflint, fix ext clippy warnings (#10219) --- .github/workflows/arma.yml | 9 --------- .github/workflows/hemtt.yml | 4 ++-- extension/build.rs | 19 +++++++++++-------- extension/src/ballistics/map/model.rs | 4 +++- extension/src/common/types/temperature.rs | 1 + 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index d0649a0ade..3ddfefd63f 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -27,15 +27,6 @@ jobs: - name: Validate function headers run: python3 docs/tools/document_functions.py --debug - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v4 - - name: Lint (sqflint) - uses: arma-actions/sqflint@master - continue-on-error: true # No failure due to many false-positives - build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/hemtt.yml b/.github/workflows/hemtt.yml index 3da672273a..23fad27560 100644 --- a/.github/workflows/hemtt.yml +++ b/.github/workflows/hemtt.yml @@ -33,8 +33,8 @@ jobs: xcopy /e /h /q pullrequest\addons addons\ xcopy /e /h /q pullrequest\optionals optionals\ xcopy /e /h /q pullrequest\include include\ - xcopy /e /h /q pullrequest\ace.dll ace.dll - xcopy /e /h /q pullrequest\ace_x64.dll ace_x64.dll + xcopy /y /h /q pullrequest\ace.dll ace.dll + xcopy /y /h /q pullrequest\ace_x64.dll ace_x64.dll - name: Run HEMTT build run: hemtt build - name: Rename build folder diff --git a/extension/build.rs b/extension/build.rs index 01a8760ddf..ff34330567 100644 --- a/extension/build.rs +++ b/extension/build.rs @@ -1,10 +1,13 @@ fn main() { - let repo = git2::Repository::open("../").expect("Open git repo"); - let head = repo - .head() - .expect("Get HEAD") - .target() - .expect("Get HEAD target"); - let commit = repo.find_commit(head).expect("Find commit"); - println!("cargo:rustc-env=GIT_HASH={}", commit.id()); + if let Ok(repo) = git2::Repository::open("../") { + let head = repo + .head() + .expect("Get HEAD") + .target() + .expect("Get HEAD target"); + let commit = repo.find_commit(head).expect("Find commit"); + println!("cargo:rustc-env=GIT_HASH={}", commit.id()); + } else { + println!("cargo:rustc-env=GIT_HASH=GIT_REPO_FAILURE"); + } } diff --git a/extension/src/ballistics/map/model.rs b/extension/src/ballistics/map/model.rs index 73f0c335db..883076b8d2 100644 --- a/extension/src/ballistics/map/model.rs +++ b/extension/src/ballistics/map/model.rs @@ -1,9 +1,10 @@ #[derive(Debug)] +#[allow(dead_code)] pub struct Map { heights: Vec, building_nums: Vec, surface_is_water: Vec, - size: u32, + size: u32, // unused grids: u32, } @@ -56,6 +57,7 @@ impl Map { self.surface_is_water[index] = is_water; } + #[allow(dead_code)] #[must_use] pub const fn size(&self) -> u32 { self.size diff --git a/extension/src/common/types/temperature.rs b/extension/src/common/types/temperature.rs index 9d6784538a..3b4ab1bb26 100644 --- a/extension/src/common/types/temperature.rs +++ b/extension/src/common/types/temperature.rs @@ -28,6 +28,7 @@ impl Temperature { self.0 } + #[allow(dead_code)] pub fn as_fahrenheit(self) -> f64 { (self.0 - 273.15) * 9.0 / 5.0 + 32.0 }