Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SwiftLint Job #67

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading