Repository: cpisciotta/xcbeautify
Pull request #388 (2025-02-22 20:17:58)

Add ExtractAppIntentsMetadataCaptureGroup

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/388?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 86.47%. Comparing base [(`4799eaa`)](https://app.codecov.io/gh/cpisciotta/xcbeautify/commit/4799eaa2fab5d41e1a131b3aa7977cc53ff685eb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Charles+Pisciotta) to head [(`b050af4`)](https://app.codecov.io/gh/cpisciotta/xcbeautify/commit/b050af422de1788f3193878d6cc125f02da523de?dropdown=coverage&el=desc&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     #388      +/-   ##
==========================================
- Coverage   91.45%   86.47%   -4.98%     
==========================================
  Files          18       18              
  Lines        2516     2529      +13     
==========================================
- Hits         2301     2187     -114     
- Misses        215      342     +127     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/cpisciotta/xcbeautify/pull/388?dropdown=coverage&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 abfa8f1..4377575 100644
--- a/Sources/XcbeautifyLib/CaptureGroups.swift
+++ b/Sources/XcbeautifyLib/CaptureGroups.swift
@@ -652,6 +652,22 @@ struct ExplicitDependencyCaptureGroup: CaptureGroup {
     }
 }
 
+struct ExtractAppIntentsMetadataCaptureGroup: CaptureGroup {
+    static var outputType: OutputType = .task
+
+    static var regex = XCRegex(pattern: #"^ExtractAppIntentsMetadata \(in target '(.+)' from project '(.+)'\)$"#)
+
+    let target: String
+    let project: String
+
+    init?(groups: [String]) {
+        assert(groups.count == 2)
+        guard let target = groups[safe: 0], let project = groups[safe: 1] else { return nil }
+        self.target = target
+        self.project = project
+    }
+}
+
 struct FailingTestCaptureGroup: CaptureGroup {
     static let outputType: OutputType = .error
 
diff --git a/Sources/XcbeautifyLib/Formatter.swift b/Sources/XcbeautifyLib/Formatter.swift
index 4df5d9a..56aaf93 100644
--- a/Sources/XcbeautifyLib/Formatter.swift
+++ b/Sources/XcbeautifyLib/Formatter.swift
@@ -100,6 +100,8 @@ package struct Formatter {
             return renderer.formatExecutedWithSkipped(group: group)
         case let group as ExplicitDependencyCaptureGroup:
             return renderer.formatExplicitDependencyCaptureGroup(group: group)
+        case let group as ExtractAppIntentsMetadataCaptureGroup:
+            return renderer.formatExtractAppIntents(group: group)
         case let group as FailingTestCaptureGroup:
             return renderer.formatFailingTest(group: group)
         case let group as FatalErrorCaptureGroup:
diff --git a/Sources/XcbeautifyLib/Parser.swift b/Sources/XcbeautifyLib/Parser.swift
index 4134184..008eab6 100644
--- a/Sources/XcbeautifyLib/Parser.swift
+++ b/Sources/XcbeautifyLib/Parser.swift
@@ -31,6 +31,7 @@ package final class Parser {
         DetectedEncodingCaptureGroup.self,
         EmitSwiftModuleCaptureGroup.self,
         ExplicitDependencyCaptureGroup.self,
+        ExtractAppIntentsMetadataCaptureGroup.self,
         FailingTestCaptureGroup.self,
         UIFailingTestCaptureGroup.self,
         RestartingTestCaptureGroup.self,
diff --git a/Sources/XcbeautifyLib/Renderers/OutputRendering.swift b/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
index fc69dbf..a1d6912 100644
--- a/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
+++ b/Sources/XcbeautifyLib/Renderers/OutputRendering.swift
@@ -35,6 +35,7 @@ protocol OutputRendering {
     func formatExecutedWithoutSkipped(group: ExecutedWithoutSkippedCaptureGroup) -> String
     func formatExecutedWithSkipped(group: ExecutedWithSkippedCaptureGroup) -> String
     func formatExplicitDependencyCaptureGroup(group: ExplicitDependencyCaptureGroup) -> String?
+    func formatExtractAppIntents(group: ExtractAppIntentsMetadataCaptureGroup) -> String
     func formatFailingTest(group: FailingTestCaptureGroup) -> String
     func formatFileMissingError(group: FileMissingErrorCaptureGroup) -> String
     func formatGenerateAssetSymbols(group: GenerateAssetSymbolsCaptureGroup) -> String
@@ -230,6 +231,11 @@ extension OutputRendering {
         nil
     }
 
+    func formatExtractAppIntents(group: ExtractAppIntentsMetadataCaptureGroup) -> String {
+        let target = group.target
+        return colored ? "[\(target.f.Cyan)] \("Extract App Intents Metadata".s.Bold)" : "[\(target)] Extract App Intents Metadata"
+    }
+
     func formatGenerateAssetSymbols(group: GenerateAssetSymbolsCaptureGroup) -> String {
         let filename = group.filename
         let target = group.target


Test patch:
diff --git a/Tests/XcbeautifyLibTests/CaptureGroupTests.swift b/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
index c76c350..22ff96d 100644
--- a/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
+++ b/Tests/XcbeautifyLibTests/CaptureGroupTests.swift
@@ -73,6 +73,14 @@ final class CaptureGroupTests: XCTestCase {
         XCTAssertEqual(groups[5], "BackyardBirdsUI")
     }
 
+    func testMatchExtractAppIntentsMetadata() throws {
+        let input = "ExtractAppIntentsMetadata (in target 'Target' from project 'Project')"
+        let groups = try XCTUnwrap(ExtractAppIntentsMetadataCaptureGroup.regex.captureGroups(for: input))
+        XCTAssertEqual(groups.count, 2)
+        XCTAssertEqual(groups[0], "Target")
+        XCTAssertEqual(groups[1], "Project")
+    }
+
     func testMatchGenerateAssetSymbols() throws {
         let input = #"GenerateAssetSymbols /Backyard-Birds/Widgets/Assets.xcassets (in target 'Widgets' from project 'Backyard Birds')"#
         let groups = try XCTUnwrap(GenerateAssetSymbolsCaptureGroup.regex.captureGroups(for: input))
diff --git a/Tests/XcbeautifyLibTests/ParserTests.swift b/Tests/XcbeautifyLibTests/ParserTests.swift
index b4c5cf4..4ec9a85 100644
--- a/Tests/XcbeautifyLibTests/ParserTests.swift
+++ b/Tests/XcbeautifyLibTests/ParserTests.swift
@@ -86,6 +86,13 @@ final class ParserTests: XCTestCase {
         XCTAssertEqual(captureGroup.project, "BackyardBirdsUI")
     }
 
+    func testMatchExtractAppIntentsMetadata() throws {
+        let input = "ExtractAppIntentsMetadata (in target 'Target' from project 'Project')"
+        let captureGroup = try XCTUnwrap(parser.parse(line: input) as? ExtractAppIntentsMetadataCaptureGroup)
+        XCTAssertEqual(captureGroup.target, "Target")
+        XCTAssertEqual(captureGroup.project, "Project")
+    }
+
     func testGenerateAssetSymbols() throws {
         let input = #"GenerateAssetSymbols /Backyard-Birds/Widgets/An-Asset_Catalog.xcassets (in target 'Some Target' from project 'A_Project')"#
         let captureGroup = try XCTUnwrap(parser.parse(line: input) as? GenerateAssetSymbolsCaptureGroup)
diff --git a/Tests/XcbeautifyLibTests/ParsingTests.swift b/Tests/XcbeautifyLibTests/ParsingTests.swift
index 4fbabcb..f3dd75a 100644
--- a/Tests/XcbeautifyLibTests/ParsingTests.swift
+++ b/Tests/XcbeautifyLibTests/ParsingTests.swift
@@ -26,9 +26,9 @@ final class ParsingTests: XCTestCase {
         // Update this magic number whenever `uncapturedOutput` is less than the current magic number.
         // There's a regression whenever `uncapturedOutput` is greater than the current magic number.
         #if os(macOS)
-        XCTAssertEqual(uncapturedOutput, 48)
+        XCTAssertEqual(uncapturedOutput, 46)
         #else
-        XCTAssertEqual(uncapturedOutput, 64)
+        XCTAssertEqual(uncapturedOutput, 62)
         #endif
     }
 
@@ -56,9 +56,9 @@ final class ParsingTests: XCTestCase {
         // Update this magic number whenever `uncapturedOutput` is less than the current magic number.
         // There's a regression whenever `uncapturedOutput` is greater than the current magic number.
         #if os(macOS)
-        XCTAssertEqual(uncapturedOutput, 1604)
+        XCTAssertEqual(uncapturedOutput, 1540)
         #else
-        XCTAssertEqual(uncapturedOutput, 2172)
+        XCTAssertEqual(uncapturedOutput, 2108)
         #endif
     }
 
diff --git a/Tests/XcbeautifyLibTests/RendererTests/AzureDevOpsPipelinesRendererTests.swift b/Tests/XcbeautifyLibTests/RendererTests/AzureDevOpsPipelinesRendererTests.swift
index a74406a..18ec480 100644
--- a/Tests/XcbeautifyLibTests/RendererTests/AzureDevOpsPipelinesRendererTests.swift
+++ b/Tests/XcbeautifyLibTests/RendererTests/AzureDevOpsPipelinesRendererTests.swift
@@ -244,6 +244,11 @@ final class AzureDevOpsPipelinesRendererTests: XCTestCase {
     }
     #endif
 
+    func testExtractAppIntentsMetadata() {
+        let formatted = logFormatted("ExtractAppIntentsMetadata (in target 'Target' from project 'Project')")
+        XCTAssertEqual(formatted, "[Target] Extract App Intents Metadata")
+    }
+
     func testFailingTest() {
         #if os(Linux)
         let input = "/path/to/Tests.swift:123: error: Suite.testCase : XCTAssertEqual failed: (\"1\") is not equal to (\"2\") -"
diff --git a/Tests/XcbeautifyLibTests/RendererTests/GitHubActionsRendererTests.swift b/Tests/XcbeautifyLibTests/RendererTests/GitHubActionsRendererTests.swift
index b688a0d..e1335d3 100644
--- a/Tests/XcbeautifyLibTests/RendererTests/GitHubActionsRendererTests.swift
+++ b/Tests/XcbeautifyLibTests/RendererTests/GitHubActionsRendererTests.swift
@@ -242,6 +242,11 @@ final class GitHubActionsRendererTests: XCTestCase {
     }
     #endif
 
+    func testExtractAppIntentsMetadata() {
+        let formatted = logFormatted("ExtractAppIntentsMetadata (in target 'Target' from project 'Project')")
+        XCTAssertEqual(formatted, "[Target] Extract App Intents Metadata")
+    }
+
     func testFailingTest() {
         #if os(Linux)
         let input = "/path/to/Tests.swift:123: error: Suite.testCase : XCTAssertEqual failed: (\"1\") is not equal to (\"2\") -"
diff --git a/Tests/XcbeautifyLibTests/RendererTests/TeamCityRendererTests.swift b/Tests/XcbeautifyLibTests/RendererTests/TeamCityRendererTests.swift
index cef5d23..45e912e 100644
--- a/Tests/XcbeautifyLibTests/RendererTests/TeamCityRendererTests.swift
+++ b/Tests/XcbeautifyLibTests/RendererTests/TeamCityRendererTests.swift
@@ -245,6 +245,11 @@ final class TeamCityRendererTests: XCTestCase {
     }
     #endif
 
+    func testExtractAppIntentsMetadata() {
+        let formatted = noColoredFormatted("ExtractAppIntentsMetadata (in target 'Target' from project 'Project')")
+        XCTAssertEqual(formatted, "[Target] Extract App Intents Metadata")
+    }
+
     func testFailingTest() { }
 
     func testFatalError() {
diff --git a/Tests/XcbeautifyLibTests/RendererTests/TerminalRendererTests.swift b/Tests/XcbeautifyLibTests/RendererTests/TerminalRendererTests.swift
index 100cf1b..900e54e 100644
--- a/Tests/XcbeautifyLibTests/RendererTests/TerminalRendererTests.swift
+++ b/Tests/XcbeautifyLibTests/RendererTests/TerminalRendererTests.swift
@@ -242,6 +242,11 @@ final class TerminalRendererTests: XCTestCase {
     }
     #endif
 
+    func testExtractAppIntentsMetadata() {
+        let formatted = noColoredFormatted("ExtractAppIntentsMetadata (in target 'Target' from project 'Project')")
+        XCTAssertEqual(formatted, "[Target] Extract App Intents Metadata")
+    }
+
     func testFailingTest() { }
 
     func testFatalError() {