diff --git a/.github/workflows/genesis.yml b/.github/workflows/genesis.yml index 489bb11c1..41a60d178 100644 --- a/.github/workflows/genesis.yml +++ b/.github/workflows/genesis.yml @@ -35,13 +35,13 @@ jobs: - name: Generate Xcode project working-directory: ${{ steps.mktemp.outputs.directory }} run: xcodegen - - name: Download swiftlint binary + - name: Resolve package dependencies working-directory: ${{ steps.mktemp.outputs.directory }} run: swift package resolve - name: Lint working-directory: ${{ steps.mktemp.outputs.directory }} run: > - "$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)" + swift package plugin --allow-writing-to-package-directory swiftlint -- lint --strict --reporter github-actions-logging - name: Resolve package dependencies working-directory: ${{ steps.mktemp.outputs.directory }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 59b68b3a6..866c39386 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,9 +18,9 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v6 - - name: Download swiftlint binary + - name: Resolve package dependencies run: swift package resolve - name: Lint run: > - "$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)" + swift package plugin --allow-writing-to-package-directory swiftlint -- lint --strict --reporter github-actions-logging diff --git a/Package.resolved b/Package.resolved index 907e83e7b..2b451f9f8 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "a5e45172dde18587c57a5dfac3f79aa0d3b0e6522df24d050273b5c59c983838", + "originHash" : "378c28eb13bcc993153ed6296464271659a9c798af2467b887ca8f6459e7a77f", "pins" : [ { "identity" : "codextended", @@ -10,24 +10,6 @@ "version" : "0.3.0" } }, - { - "identity" : "collectionconcurrencykit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", - "state" : { - "revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", - "version" : "0.2.0" - } - }, - { - "identity" : "cryptoswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", - "state" : { - "revision" : "e45a26384239e028ec87fbcc788f513b67e10d8f", - "version" : "1.9.0" - } - }, { "identity" : "cwlcatchexception", "kind" : "remoteSourceControl", @@ -73,15 +55,6 @@ "version" : "1.0.1" } }, - { - "identity" : "sourcekitten", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/SourceKitten.git", - "state" : { - "revision" : "453f75b8a3bb2c3596c0d2dd422c289788233a22", - "version" : "0.37.1" - } - }, { "identity" : "spectre", "kind" : "remoteSourceControl", @@ -150,37 +123,19 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax", "state" : { - "revision" : "1103c45ece4f7fe160b8f75b4ea1ee2e5fac1841", - "version" : "601.0.0" + "revision" : "4799286537280063c85a32f09884cfbca301b1a1", + "version" : "602.0.0" } }, { - "identity" : "swiftlint", + "identity" : "swiftlintplugins", "kind" : "remoteSourceControl", - "location" : "https://github.com/realm/SwiftLint.git", + "location" : "https://github.com/SimplyDanny/SwiftLintPlugins.git", "state" : { - "revision" : "625792423014cc49b0a1e5a1a5c0d6b8b3de10f9", + "revision" : "8545ddf4de043e6f2051c5cf204f39ef778ebf6b", "version" : "0.59.1" } }, - { - "identity" : "swiftytexttable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", - "state" : { - "revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", - "version" : "0.9.0" - } - }, - { - "identity" : "swxmlhash", - "kind" : "remoteSourceControl", - "location" : "https://github.com/drmohundro/SWXMLHash.git", - "state" : { - "revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", - "version" : "7.0.2" - } - }, { "identity" : "xctest-dynamic-overlay", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 143eb8abd..2d10ff593 100644 --- a/Package.swift +++ b/Package.swift @@ -53,7 +53,7 @@ let package = Package( url: "https://github.com/uber/needle.git", exact: "0.25.1"), .package( - url: "https://github.com/realm/SwiftLint.git", + url: "https://github.com/SimplyDanny/SwiftLintPlugins.git", exact: "0.59.1"), .package( url: "https://github.com/Quick/Nimble.git", @@ -127,6 +127,7 @@ package.targets.forEach { target in .regular, .test, .executable, + .macro, ] guard types.contains(target.type) @@ -143,7 +144,7 @@ package.targets.forEach { target in if enableSwiftLintBuildToolPlugin { target.plugins = (target.plugins ?? []) + [ - .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"), + .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins"), ] } } diff --git a/genesis.yml b/genesis.yml index f640652b5..b1025da3e 100644 --- a/genesis.yml +++ b/genesis.yml @@ -899,7 +899,7 @@ files: exact: "{{ nodes }}"), {% endif %} .package( - url: "https://github.com/realm/SwiftLint.git", + url: "https://github.com/SimplyDanny/SwiftLintPlugins.git", exact: "0.59.1"), ] ) @@ -1135,7 +1135,7 @@ files: # https://github.com/realm/SwiftLint/blob/0.52.4/Source/swiftlint/Commands/SwiftLint.swift#L8 unset BUILD_WORKSPACE_DIRECTORY - "$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)" + swift package plugin --allow-writing-to-package-directory swiftlint else echo "SwiftLint is skipped in CI." fi