When asking the agent to review your Swift Testing code, it will organize findings by file. For every issue identified, the agent provides:
- The file name and relevant line number(s).
- The specific rule being violated.
- A brief before/after code snippet showing the fix.
Files with no issues are skipped. The report concludes with a prioritized summary of the most impactful changes (e.g., High, Medium, Low priority).
Example Review Output Format
UserTests.swift
Line 5: Use struct, not class, for test suites.
// Before
class UserTests: XCTestCase {
// After
struct UserTests {
Line 12: Use #expect instead of XCTAssertEqual.
// Before
XCTAssertEqual(user.name, "Taylor")
// After
#expect(user.name == "Taylor")
Summary
- Fundamentals (high): Test suite on line 5 should be a struct, not a class.
- Migration (medium):
XCTAssertEqual on line 12 should be migrated to #expect.