Skip to content

Commit

Permalink
Merge pull request #67 from veracode/fix-swift-lint
Browse files Browse the repository at this point in the history
Fix SwiftLint Job
  • Loading branch information
NinjaLikesCheez authored Sep 9, 2024
2 parents d367ac3 + 59fffc7 commit 026abf8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/SwiftLint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
env:
DIFF_BASE: ${{ github.base_ref }}
- uses: actions/checkout@v4
- uses: cirruslabs/swiftlint-action@v1
with:
version: latest
4 changes: 2 additions & 2 deletions PIF/Sources/PIFSupport/PIF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions Sources/GenIR/CompilerCommandRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions Sources/GenIR/Extensions/Process+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down
1 change: 1 addition & 0 deletions Sources/GenIR/XcodeLogParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>()
Expand Down

0 comments on commit 026abf8

Please sign in to comment.