From 6fb1c70136446e9fc336b5783e2aeceeaea6ada6 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Fri, 26 Apr 2024 11:27:41 +0100 Subject: [PATCH] Add swiftlint --- .github/workflows/pull-request.yml | 15 +++++++++++++++ Package.swift | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index bd5a175..d14dd42 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -27,3 +27,18 @@ jobs: run: swift build -v - name: Run tests run: swift test -v + + swift-lint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + # TODO: enable these settings: + # env: + # DIFF_BASE: ${{ github.base_ref }} + # with: + # args: --strict diff --git a/Package.swift b/Package.swift index 84a8f31..7bed2ab 100644 --- a/Package.swift +++ b/Package.swift @@ -11,10 +11,15 @@ let package = Package( .target( name: "FlagsmithClient", dependencies: [], - path: "FlagsmithClient/Classes"), + path: "FlagsmithClient/Classes" + plugins: [ + .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]), .testTarget( name: "FlagsmitClientTests", dependencies: ["FlagsmithClient"], path: "FlagsmithClient/Tests"), + ], + dependencies: [ + .package(url: "https://github.com/realm/SwiftLint.git", from: "0.54.0") ] )