From 0f4799e5960cab8728c9ece9d030722c67e2be37 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Thu, 26 Sep 2024 10:50:06 -0700 Subject: [PATCH] (Chore): Re-enable squawk linux arm tests (#877) Follow-up to #875. They now support it in [v1.4.0](https://github.com/sbdchd/squawk/releases/tag/v1.4.0)! --- linters/squawk/plugin.yaml | 6 +++--- linters/squawk/squawk.test.ts | 9 +++++++-- ...2_basic.check.shot => squawk_v1.4.0_basic.check.shot} | 0 3 files changed, 10 insertions(+), 5 deletions(-) rename linters/squawk/test_data/{squawk_v1.1.2_basic.check.shot => squawk_v1.4.0_basic.check.shot} (100%) diff --git a/linters/squawk/plugin.yaml b/linters/squawk/plugin.yaml index 013084ff0..23ad5f8ac 100644 --- a/linters/squawk/plugin.yaml +++ b/linters/squawk/plugin.yaml @@ -4,8 +4,8 @@ tools: - name: squawk runtime: node package: squawk-cli - # First version to include Windows install. - known_good_version: 1.2.0 + # First version to include Windows install and linux arm64 + known_good_version: 1.4.0 shims: [squawk] lint: definitions: @@ -13,7 +13,7 @@ lint: description: A linter for Postgres migrations files: [sql] tools: [squawk] - known_good_version: 1.2.0 + known_good_version: 1.4.0 suggest_if: config_present direct_configs: [.squawk.toml] commands: diff --git a/linters/squawk/squawk.test.ts b/linters/squawk/squawk.test.ts index 84ccbe43a..f279b9c19 100644 --- a/linters/squawk/squawk.test.ts +++ b/linters/squawk/squawk.test.ts @@ -1,7 +1,12 @@ +import semver from "semver"; import { linterCheckTest } from "tests"; -// No release for squawk on arm64 linux https://github.com/sbdchd/squawk/issues/372 +// Squawk first supported linux arm in 1.4.0 https://github.com/sbdchd/squawk/issues/372 linterCheckTest({ linterName: "squawk", - skipTestIf: () => process.arch === "arm64" && process.platform === "linux", + skipTestIf: (version) => + process.arch === "arm64" && + process.platform === "linux" && + version !== undefined && + semver.lt(version, "1.4.0"), }); diff --git a/linters/squawk/test_data/squawk_v1.1.2_basic.check.shot b/linters/squawk/test_data/squawk_v1.4.0_basic.check.shot similarity index 100% rename from linters/squawk/test_data/squawk_v1.1.2_basic.check.shot rename to linters/squawk/test_data/squawk_v1.4.0_basic.check.shot