fix: avoid false positive error/warning detection from echoed source code#218
Open
nebooz wants to merge 1 commit intogetsentry:mainfrom
Open
fix: avoid false positive error/warning detection from echoed source code#218nebooz wants to merge 1 commit intogetsentry:mainfrom
nebooz wants to merge 1 commit intogetsentry:mainfrom
Conversation
59c6d86 to
ecf49be
Compare
ecf49be to
bd4dfad
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
bd4dfad to
3f4a4dd
Compare
…code The `grepWarningsAndErrors` regex matched any line containing `error:` or `warning:`, which produced false positives when xcodebuild echoes Swift source lines during compilation (e.g. `var authError: Error?`, `private(set) var error: WalletError?`). Tighten the regex to require `error:`/`warning:` at the start of the line or after a file:line:col location prefix (`:<digits>: `), matching only real xcodebuild diagnostic output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3f4a4dd to
2dceacb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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