You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-2Lines changed: 54 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ A Swift command-line tool to parse and format xcodebuild/SPM output for coding a
12
12
-**Structured error reporting** - Clear categorization of errors, warnings, and test failures
13
13
-**File/line number extraction** - Easy navigation to problematic code locations
14
14
-**Build status summary** - Quick overview of build results
15
+
-**Automatic code coverage conversion** - Converts .profraw (SPM) and .xcresult (xcodebuild) to JSON automatically
16
+
-**Target filtering** - Automatically filters xcodebuild coverage to tested target only
17
+
-**Summary-only mode** - Default coverage output includes only percentage (token-efficient)
18
+
-**Quiet mode** - Suppress output when build succeeds with no warnings or errors
15
19
16
20
## Installation
17
21
@@ -74,6 +78,26 @@ xcodebuild build 2>&1 | xcsift
74
78
75
79
# Print detailed warnings list (useful for fixing warnings)
76
80
xcodebuild build 2>&1| xcsift --print-warnings
81
+
xcodebuild build 2>&1| xcsift -w
82
+
83
+
# Quiet mode - suppress output when build succeeds with no warnings or errors
84
+
xcodebuild build 2>&1| xcsift --quiet
85
+
swift build 2>&1| xcsift -q
86
+
87
+
# Code coverage - automatic conversion from .profraw or .xcresult to JSON
88
+
# Default: summary-only mode (line coverage percentage only - token-efficient)
89
+
# xcodebuild automatically searches ~/Library/Developer/Xcode/DerivedData for latest .xcresult
90
+
# and filters to tested target only
91
+
swift test --enable-code-coverage 2>&1| xcsift --coverage
92
+
xcodebuild test -enableCodeCoverage YES 2>&1| xcsift --coverage
93
+
xcodebuild test2>&1| xcsift -c
94
+
95
+
# Show detailed per-file coverage (use when you need file-by-file breakdown)
96
+
swift test --enable-code-coverage 2>&1| xcsift --coverage --coverage-details
97
+
xcodebuild test2>&1| xcsift -c --coverage-details
98
+
99
+
# Specify custom coverage path (optional - auto-detects by default)
100
+
swift test --enable-code-coverage 2>&1| xcsift --coverage --coverage-path .build/arm64-apple-macosx/debug/codecov
77
101
78
102
# Test output parsing
79
103
xcodebuild test2>&1| xcsift
@@ -94,7 +118,9 @@ swift test 2>&1 | xcsift
94
118
"errors": 2,
95
119
"warnings": 1,
96
120
"failed_tests": 2,
97
-
"build_time": "3.2 seconds"
121
+
"passed_tests": 28,
122
+
"build_time": "3.2",
123
+
"coverage_percent": 85.5
98
124
},
99
125
"errors": [
100
126
{
@@ -115,12 +141,37 @@ swift test 2>&1 | xcsift
115
141
"test": "Test assertion",
116
142
"message": "XCTAssertEqual failed: (\"invalid\") is not equal to (\"valid\")"
117
143
}
118
-
]
144
+
],
145
+
"coverage": {
146
+
"line_coverage": 85.5,
147
+
"files": [
148
+
{
149
+
"path": "/path/to/ViewController.swift",
150
+
"name": "ViewController.swift",
151
+
"line_coverage": 92.5,
152
+
"covered_lines": 37,
153
+
"executable_lines": 40
154
+
}
155
+
]
156
+
}
119
157
}
120
158
```
121
159
122
160
**Note on warnings:** By default, only the warning count appears in `summary.warnings`. The detailed `warnings` array (shown above) is only included when using the `--print-warnings` flag. This reduces token usage for coding agents that don't need to process every warning.
123
161
162
+
**Note on coverage:** The `coverage` section is only included when using the `--coverage-details` flag:
163
+
-**Summary-only mode** (default): Only includes coverage percentage in summary for maximum token efficiency
164
+
```json
165
+
{
166
+
"summary": {
167
+
"coverage_percent": 85.5
168
+
}
169
+
}
170
+
```
171
+
-**Details mode** (with `--coverage-details`): Includes full `files` array as shown in the example above
172
+
-**Target filtering** (xcodebuild only): Automatically extracts tested target from stdout and shows coverage for that target only
173
+
- xcsift automatically converts `.profraw` files (SPM) or `.xcresult` bundles (xcodebuild) to JSON format without requiring manual llvm-cov or xccov commands
0 commit comments