From 0a88b72135f70f5b2fd9372455fb6634aac3951b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 24 Aug 2024 13:16:03 +0200 Subject: [PATCH] Use mise for dev tooling --- .github/workflows/test.yml | 12 ++++++++++++ .mise.toml | 3 +++ Makefile | 4 ++-- scripts/lint/swiftformat.sh | 11 ----------- scripts/lint/swiftlint.sh | 11 ----------- 5 files changed, 17 insertions(+), 24 deletions(-) create mode 100644 .mise.toml delete mode 100755 scripts/lint/swiftformat.sh delete mode 100755 scripts/lint/swiftlint.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0183298b..f08631294 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,18 @@ env: periphery_scan: ./.build/debug/periphery scan --quiet --clean-build cache_version: 1 jobs: + lint: + strategy: + fail-fast: true + runs-on: macOS-14 + name: Lint + steps: + - uses: actions/checkout@master + - uses: jdx/mise-action@v2 + - name: SwiftLint + run: make swiftlint + - name: SwiftFormat + run: make swiftformat macOS: strategy: fail-fast: false diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 000000000..4042f0ef6 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,3 @@ +[tools] +swiftlint = "0.56.1" +swiftformat = "0.54.3" diff --git a/Makefile b/Makefile index 540da7571..ba76a779e 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,9 @@ build_release: clean build_x86_64 build_arm64 @strip -rSTX .release/periphery swiftformat: - @./scripts/lint/swiftformat.sh + @mise exec -- swiftformat --quiet --strict . swiftlint: - @./scripts/lint/swiftlint.sh + @mise exec -- swiftlint lint --quiet --strict lint: swiftlint swiftformat \ No newline at end of file diff --git a/scripts/lint/swiftformat.sh b/scripts/lint/swiftformat.sh deleted file mode 100755 index 848ba6890..000000000 --- a/scripts/lint/swiftformat.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -VERSION="0.54.3" -INSTALLED_VERSION=$(swiftformat --version) - -if [[ "$INSTALLED_VERSION" != "$VERSION" ]]; then - echo "ERROR: SwiftFormat ${VERSION} is required, installed version is ${INSTALLED_VERSION}." - exit 1 -fi - -swiftformat --quiet . \ No newline at end of file diff --git a/scripts/lint/swiftlint.sh b/scripts/lint/swiftlint.sh deleted file mode 100755 index 7a47d0dc1..000000000 --- a/scripts/lint/swiftlint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -VERSION="0.56.1" -INSTALLED_VERSION=$(swiftlint --version) - -if [[ "$INSTALLED_VERSION" != "$VERSION" ]]; then - echo "ERROR: SwiftLint ${VERSION} is required, installed version is ${INSTALLED_VERSION}." - exit 1 -fi - -swiftlint lint --quiet \ No newline at end of file