fix: avoid false positive error/warning detection from echoed source code #218
+99
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
grepWarningsAndErrorsregex inbuild-utils.tsmatched any line containingerror:orwarning:, producing false positives when xcodebuild echoes Swift source lines during compilation (e.g.var authError: Error?,private(set) var error: WalletError?)error: msg,warning: msg,fatal error: msg/path/File.swift:42:10: error: msgld: warning: msg,clang: error: msgMotivation
When building a Swift project containing variables or properties with names like
authError,loadError,lastError, or type annotations likevar error: WalletError?, the build output would incorrectly flag these echoed source lines as errors or warnings. This cluttered the build results with spurious diagnostics.Changes
src/utils/build-utils.ts— 2-line regex change + 3-line comment:The pattern handles three diagnostic formats:
^— standalone at line start (error: build failed,fatal error: too many errors)^\w+:\s+— tool-prefixed (ld: warning: ...,clang: error: ...):\d+:\s+— file-located (/path/File.swift:42:10: error: ...)The error regex also includes
(?:fatal )?to match clang'sfatal error:diagnostic level.src/utils/__tests__/build-utils-suppress-warnings.test.ts— 2 new tests:var authError: Error?,var error: WalletError?,fatalError("crash"), etc.fatal error:variantsTest plan
var authError: Error?are NOT flaggedfatalError("crash")is NOT flaggederror: build failed,warning: deprecated API(standalone)/path:42:10: error: ...,/path:15:5: warning: ...(file-located)ld: warning: directory not found,clang: error: linker command failed(tool-prefixed)fatal error: too many errors,/path:1:9: fatal error: 'Header.h' not found(fatal error)🤖 Generated with Claude Code