diff --git a/.github/workflows/SwiftLint.yml b/.github/workflows/SwiftLint.yml index 12300cf..d6fce06 100644 --- a/.github/workflows/SwiftLint.yml +++ b/.github/workflows/SwiftLint.yml @@ -2,17 +2,14 @@ name: SwiftLint on: pull_request: - paths: - - '.github/workflows/swiftlint.yml' - - '.swiftlint.yml' - - '**/*.swift' + branches: ['main'] jobs: + # Runs swiftlint on any pull request to main (note: this runs for _all_ files, not only the changed files in the PR!) SwiftLint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Lint changed files - uses: norio-nomura/action-swiftlint@3.2.1 - env: - DIFF_BASE: ${{ github.base_ref }} \ No newline at end of file + - uses: actions/checkout@v4 + - uses: cirruslabs/swiftlint-action@v1 + with: + version: latest \ No newline at end of file diff --git a/PIF/Sources/PIFSupport/PIF.swift b/PIF/Sources/PIFSupport/PIF.swift index dc6dce5..7222b40 100644 --- a/PIF/Sources/PIFSupport/PIF.swift +++ b/PIF/Sources/PIFSupport/PIF.swift @@ -15,7 +15,7 @@ - adjust types to remove external dependencies on SPM */ -// swiftlint:disable file_length type_body_length +// swiftlint:disable file_length type_body_length static_over_final_class import Foundation /// The Project Interchange Format (PIF) is a structured representation of the @@ -900,4 +900,4 @@ private struct UntypedTarget: Decodable { } let contents: TargetContents } -// swiftlint:enable file_length type_body_length +// swiftlint:enable file_length type_body_length static_over_final_class diff --git a/Sources/GenIR/CompilerCommandRunner.swift b/Sources/GenIR/CompilerCommandRunner.swift index 6e25247..2d1e6f3 100644 --- a/Sources/GenIR/CompilerCommandRunner.swift +++ b/Sources/GenIR/CompilerCommandRunner.swift @@ -78,6 +78,7 @@ struct CompilerCommandRunner { /// - name: The name this command relates to, used to create the product folder /// - directory: The directory to run these commands in /// - Returns: The total amount of modules produced for this target + // swiftlint:disable:next function_body_length private func run(commands: [CompilerCommand], for name: String, at directory: URL) throws -> Int { let targetDirectory = directory.appendingPathComponent(name) diff --git a/Sources/GenIR/Extensions/Process+Extension.swift b/Sources/GenIR/Extensions/Process+Extension.swift index c1d2c8e..425ec99 100644 --- a/Sources/GenIR/Extensions/Process+Extension.swift +++ b/Sources/GenIR/Extensions/Process+Extension.swift @@ -118,8 +118,8 @@ extension Process { try? stderrHandle.close() return .init( - stdout: String(data: stdout, encoding: .utf8), - stderr: String(data: stderr, encoding: .utf8), + stdout: String(decoding: stdout, as: UTF8.self), + stderr: String(decoding: stderr, as: UTF8.self), code: process.terminationStatus ) } diff --git a/Sources/GenIR/XcodeLogParser.swift b/Sources/GenIR/XcodeLogParser.swift index 4f26553..8b81dcb 100644 --- a/Sources/GenIR/XcodeLogParser.swift +++ b/Sources/GenIR/XcodeLogParser.swift @@ -70,6 +70,7 @@ class XcodeLogParser { /// Parses an array representing the contents of an Xcode build log /// - Parameters: /// - lines: contents of the Xcode build log lines + // swiftlint:disable:next cyclomatic_complexity private func parseBuildLog(_ lines: [String]) { var currentTarget: String? var seenTargets = Set()