fix(cli): onboarding config rewrites survive comments with apostrophes#70
Merged
Merged
Conversation
findMatchingBrace tracked quote state but not comments, so an apostrophe in a comment (// don't pin a simulator model) flipped it into inside-string mode and swallowed real braces: onboarding failed on legal configs, and with certain comment arrangements rewrote the WRONG project's appium:app while reporting success. Line and block comments are now skipped like strings.
79fae53 to
02fba50
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
findMatchingBrace(the parser behind onboarding'snativeproof.config.tsrewrites) tracked quote state but not comments. An apostrophe in a comment —// don't pin a simulator model— flipped the tracker into "inside string" mode and swallowed real braces. Confirmed effects on legal configs: onboarding failed with "could not update the ios project", and with apostrophes in more than one project's comments it could rewrite the wrong project's"appium:app"while reporting success.//) and block (/* */) comments are now skipped the same way strings are; unterminated comments return "no match" and surface the existing clear error rather than corrupting.Proof
npm run checkfix/config-comment-parsing.npm testtest/cli.test.ts.Risk
Notes
/{2}/) remain a theoretical desync; tracked separately rather than growing this parser further.PR Proof Law
.agents/DEFINITION_OF_DONE.mdand.agents/skills/pr-inline-screenshot-proof/SKILL.md., or the proof section saysNot applicablewith the technical reason.