[codex] Structure mobile native static-check failures#3302
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR refactors an internal error class in a development script to use structured fields instead of a plain message string, with an accompanying unit test. No production runtime behavior is affected. You can customize Macroscope's approvability policy. Learn more. |
Summary
Validation
vp test run scripts/mobile-native-static-check.test.ts(1 test)vp run lint:mobilevp checkvp run typecheckNote
Low Risk
Localized change to a dev CLI script’s error modeling and tests; no runtime product or security surface.
Overview
Replaces the generic message-only native static-check failure with a schema-backed
NativeStaticCheckCommandErrorthat carries command, args, cwd, and exitCode whenswiftlint/ktlint/detektexit non-zero.The error’s human-readable text is derived from those fields (e.g. which command failed and the exit code). A small Vitest file asserts the structured shape and message.
Reviewed by Cursor Bugbot for commit c1595e4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure mobile native static-check failures into
NativeStaticCheckCommandErrorReplaces
NativeStaticCheckError(aData.TaggedError) withNativeStaticCheckCommandErrorbuilt usingSchema.TaggedErrorClassin mobile-native-static-check.ts. The new error exposes structured fields (command,args,cwd,exitCode) and a message getter that formats them. Adds a test in mobile-native-static-check.test.ts asserting both the structured fields and the computed message. Behavioral Change: callers now receive a different error type and a different message format when a spawned command exits non-zero.Macroscope summarized c1595e4.