Repository: cpisciotta/xcbeautify
Pull request #259 (2024-02-29 04:26:07)

Add SwiftDriverJobDiscoveryEmittingModuleCaptureGroup

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) Report
Attention: Patch coverage is `22.22222%` with `7 lines` in your changes are missing coverage. Please review.
> Project coverage is 75.55%. Comparing base [(`eae9f85`)](https://app.codecov.io/gh/cpisciotta/xcbeautify/commit/eae9f85238c95e818ea5dabadddd07b7a60a2bf6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) to head [(`30f5f34`)](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta).

| [Files](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) | Patch % | Lines |
|---|---|---|
| [Sources/XcbeautifyLib/CaptureGroups.swift](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta#diff-U291cmNlcy9YY2JlYXV0aWZ5TGliL0NhcHR1cmVHcm91cHMuc3dpZnQ=) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) |
| [...rces/XcbeautifyLib/Renderers/OutputRendering.swift](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta#diff-U291cmNlcy9YY2JlYXV0aWZ5TGliL1JlbmRlcmVycy9PdXRwdXRSZW5kZXJpbmcuc3dpZnQ=) | 25.00% | [3 Missing :warning: ](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
- Coverage   85.09%   75.55%   -9.54%     
==========================================
  Files          14       14              
  Lines        1476     1485       +9     
==========================================
- Hits         1256     1122     -134     
- Misses        220      363     +143     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/259?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta).


Patch:
diff --git a/Sources/XcbeautifyLib/CaptureGroups.swift b/Sources/XcbeautifyLib/CaptureGroups.swift
index 2dbc590..44bf98b 100644
--- a/Sources/XcbeautifyLib/CaptureGroups.swift
+++ b/Sources/XcbeautifyLib/CaptureGroups.swift
@@ -1703,3 +1703,11 @@ struct CompilationResultCaptureGroup: CaptureGroup {
 
     init?(groups: [String]) { }
 }
+
+struct SwiftDriverJobDiscoveryEmittingModuleCaptureGroup: CaptureGroup {
+    static let outputType: OutputType = .task
+
+    static let regex = Regex(pattern: #"SwiftDriverJobDiscovery \w+ \w+ Emitting module for .* \(in target '.*' from project '.*'\)"#)
+
+    init?(groups: [String]) { }
+}
diff --git a/Sources/XcbeautifyLib/Parser.swift b/Sources/XcbeautifyLib/Parser.swift
index b3179cc..a99af7c 100644
--- a/Sources/XcbeautifyLib/Parser.swift
+++ b/Sources/XcbeautifyLib/Parser.swift
@@ -97,6 +97,7 @@ package class Parser {
         PackageGraphResolvingEndedCaptureGroup.self,
         PackageGraphResolvedItemCaptureGroup.self,
         DuplicateLocalizedStringKeyCaptureGroup.self,
+        SwiftDriverJobDiscoveryEmittingModuleCaptureGroup.self,
     ]
 
     // MARK: - Init
diff --git a/Sources/XcbeautifyLib/Renderers/OutputRendering.swift b/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
index 27df691..6c018d2 100644
--- a/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
+++ b/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
@@ -76,6 +76,7 @@ protocol OutputRendering {
     func formatWillNotBeCodesignWarning(group: WillNotBeCodeSignedCaptureGroup) -> String
     func formatWriteAuxiliaryFile(group: WriteAuxiliaryFileCaptureGroup) -> String?
     func formatWriteFile(group: WriteFileCaptureGroup) -> String?
+    func formatSwiftDriverJobDiscoveryEmittingModule(group: SwiftDriverJobDiscoveryEmittingModuleCaptureGroup) -> String?
 }
 
 extension OutputRendering {
@@ -266,6 +267,8 @@ extension OutputRendering {
             return formatWriteFile(group: group)
         case let group as XcodebuildErrorCaptureGroup:
             return formatError(group: group)
+        case let group as SwiftDriverJobDiscoveryEmittingModuleCaptureGroup:
+            return formatSwiftDriverJobDiscoveryEmittingModule(group: group)
         default:
             assertionFailure()
             return nil
@@ -525,4 +528,8 @@ extension OutputRendering {
     func formatWriteFile(group: WriteFileCaptureGroup) -> String? {
         nil
     }
+
+    func formatSwiftDriverJobDiscoveryEmittingModule(group: SwiftDriverJobDiscoveryEmittingModuleCaptureGroup) -> String? {
+        nil
+    }
 }
diff --git a/Sources/XcbeautifyLib/String+CapturedGroups.swift b/Sources/XcbeautifyLib/String+CapturedGroups.swift
index abe02ff..71551a1 100644
--- a/Sources/XcbeautifyLib/String+CapturedGroups.swift
+++ b/Sources/XcbeautifyLib/String+CapturedGroups.swift
@@ -89,6 +89,7 @@ extension String {
         PackageGraphResolvingEndedCaptureGroup.self,
         PackageGraphResolvedItemCaptureGroup.self,
         XcodebuildErrorCaptureGroup.self,
+        SwiftDriverJobDiscoveryEmittingModuleCaptureGroup.self,
     ]
 
     func captureGroup(with pattern: String) -> CaptureGroup? {


Test patch:
diff --git a/Tests/XcbeautifyLibTests/CaptureGroupTests.swift b/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
index b2dd398..503d990 100644
--- a/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
+++ b/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
@@ -26,4 +26,9 @@ final class CaptureGroupTests: XCTestCase {
         let input = #"/* com.apple.actool.compilation-results */"#
         XCTAssertTrue(CompilationResultCaptureGroup.regex.match(string: input))
     }
+
+    func testMatchSwiftDriverJobDiscoveryEmittingModule() {
+        let input = #"SwiftDriverJobDiscovery normal arm64 Emitting module for Widgets (in target 'Widgets' from project 'Backyard Birds')"#
+        XCTAssertTrue(SwiftDriverJobDiscoveryEmittingModuleCaptureGroup.regex.match(string: input))
+    }
 }