diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0183298b..7136600b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,24 +5,32 @@ on: - master pull_request: {} env: + MISE_EXPERIMENTAL: 1 swift_package_resolve: swift package resolve swift_build: swift build swift_test: swift test periphery_scan: ./.build/debug/periphery scan --quiet --clean-build cache_version: 1 jobs: + lint: + runs-on: macos-14 + name: Lint + steps: + - uses: actions/checkout@master + - uses: jdx/mise-action@v2 + - run: mise run lint macOS: strategy: fail-fast: false matrix: - xcode: ["16.0", "15.4", "15.2"] + xcode: ["16.1", "15.4", "15.2"] include: - - xcode: "16.0" - macos: macOS-14 + - xcode: "16.1" + macos: macos-14 - xcode: "15.4" - macos: macOS-14 + macos: macos-14 - xcode: "15.2" - macos: macOS-14 + macos: macos-14 runs-on: ${{ matrix.macos }} name: macOS steps: diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 000000000..06a4960fd --- /dev/null +++ b/.mise.toml @@ -0,0 +1,3 @@ +[tools] +swiftformat = "0.54.3" +swiftlint = "0.56.2" diff --git a/.mise/tasks/lint b/.mise/tasks/lint new file mode 100755 index 000000000..a9d02dfc1 --- /dev/null +++ b/.mise/tasks/lint @@ -0,0 +1,8 @@ +#!/bin/bash +# mise description="Lint the project" +set -euo pipefail + +cd $MISE_PROJECT_ROOT + +swiftformat --quiet --strict +swiftlint lint --quiet --strict diff --git a/Makefile b/Makefile index 540da7571..4d6e3a07c 100644 --- a/Makefile +++ b/Makefile @@ -15,11 +15,3 @@ build_release: clean build_x86_64 build_arm64 @mkdir -p .release @lipo -create -output .release/periphery ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64} @strip -rSTX .release/periphery - -swiftformat: - @./scripts/lint/swiftformat.sh - -swiftlint: - @./scripts/lint/swiftlint.sh - -lint: swiftlint swiftformat \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index d3e153878..d9bc4ce3c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -41,17 +41,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ileitch/swift-filename-matcher", "state" : { - "revision" : "17eaeaf60f2703e3ef826de94149c88a78953fd3", - "version" : "0.1.1" + "revision" : "8cc02e902f651bb5812860011ee13707b9e037df", + "version" : "0.1.2" } }, { "identity" : "swift-indexstore", "kind" : "remoteSourceControl", - "location" : "https://github.com/ileitch/swift-indexstore", + "location" : "https://github.com/kateinoigakukun/swift-indexstore", "state" : { - "revision" : "e0046a1704e2e7af88355883247ee1f9d47ed9ee", - "version" : "9.0.4" + "revision" : "9363af98d32247bf953855fc99d1f1f1ef803e43", + "version" : "0.3.0" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/xcodeproj", "state" : { - "revision" : "c15e011dc0ea74f7833bf33c2791483beb9c7577", - "version" : "8.23.1" + "revision" : "a1ff175a2f3bfbec166f33b264263c55f2149720", + "version" : "8.23.2" } }, { diff --git a/Package.swift b/Package.swift index 49835ae94..50426874a 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ var dependencies: [Package.Dependency] = [ .package(url: "https://github.com/jpsim/Yams", from: "5.0.0"), .package(url: "https://github.com/tadija/AEXML", from: "4.0.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), - .package(url: "https://github.com/ileitch/swift-indexstore", from: "9.0.4"), + .package(url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.3.0"), .package(url: "https://github.com/apple/swift-syntax", from: "600.0.0-prerelease-2024-08-14"), .package(url: "https://github.com/ileitch/swift-filename-matcher", from: "0.0.0"), ] diff --git a/Sources/Shared/Logger.swift b/Sources/Shared/Logger.swift index c5821169b..2cff44074 100644 --- a/Sources/Shared/Logger.swift +++ b/Sources/Shared/Logger.swift @@ -195,7 +195,6 @@ public struct ContextualLogger { } #else public struct SignpostInterval { - // swiftlint:disable:next unneeded_synthesized_initializer @usableFromInline init() {} } 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