diff --git a/.github/workflows/SwiftLint.yml b/.github/workflows/SwiftLint.yml new file mode 100644 index 00000000..9dcebf18 --- /dev/null +++ b/.github/workflows/SwiftLint.yml @@ -0,0 +1,22 @@ +name: SwiftLint + +on: + push: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' + pull_request: + paths: + - '**/*.swift' + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + env: + DIFF_BASE: ${{ github.base_ref }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 955c99b5..c9e7fb4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,11 +34,6 @@ jobs: fi shell: zsh {0} - - name: SwiftLint - uses: norio-nomura/action-swiftlint@3.2.1 - env: - DIFF_BASE: ${{ github.base_ref }} - - name: Debug Build run: | xcodebuild -workspace HeliPort.xcworkspace -scheme HeliPort -configuration Debug -derivedDataPath build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} diff --git a/HeliPort/Supporting files/BugReporter.swift b/HeliPort/Supporting files/BugReporter.swift index 838faf51..9c3c9e91 100644 --- a/HeliPort/Supporting files/BugReporter.swift +++ b/HeliPort/Supporting files/BugReporter.swift @@ -61,8 +61,8 @@ class BugReporter { let masterPort = IOServiceGetMatchingService(kIOMasterPortDefault, nil) let gOptionsRef = IORegistryEntryFromPath(masterPort, "IODeviceTree:/options") let keyRef = CFStringCreateWithCString(kCFAllocatorDefault, - "boot-args", - CFStringBuiltInEncodings.UTF8.rawValue) + "boot-args", + CFStringBuiltInEncodings.UTF8.rawValue) if let valueRef = IORegistryEntryCreateCFProperty(gOptionsRef, keyRef, kCFAllocatorDefault, 0) { var bootArgs: String? @@ -71,7 +71,7 @@ class BugReporter { } else { bootArgs = valueRef.takeRetainedValue() as? String } - if bootArgs?.contains("msgbuf=1048576") != nil { + if bootArgs != nil, bootArgs!.contains("msgbuf=1048576") { // boot-args is available, get dmesg logs response = NSAppleScript(source: """