[pr-schema-gate fixes](1) A quoted argument spanning lines is one word - #396
Merged
Merged
Conversation
The parser lexed each line alone, so a multi-line quoted argument (a `git commit -m` with a body and trailers) looked like an unclosed quote and the hook reported "could not parse" on an ordinary commit. A line that leaves a quote open now joins the following lines until the quote closes; only a quote that never closes stays unparseable. Only the lexer's own incomplete-input errors mean "keep reading"; anything else propagates. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WSVNdBBo7dFqoR8Tx521EJ
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_8a3b7127-6f6e-46f0-aa3b-5560f94f9ba0) |
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Owner
Author
|
@Mergifyio queue |
Contributor
Merge Queue Status
This pull request spent 5 minutes 8 seconds in the queue, including 3 minutes 36 seconds running CI. Required conditions to merge
|
5 tasks
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
pr-schema-gateno longer says "could not parse" on an ordinary multi-line commit message.The parser read each line on its own, so a quoted argument spanning lines, like a
git commit -mwith a body and trailers, looked like an unclosed quote. Now a line that leaves a quote open joins the next lines until the quote closes.Before and After
The real command that drew the false warning (a heredoc, then
git commit -q -am "<subject>\n\n<trailer>", thengit log), run through the hook from an Invoker checkout, onmainand on this branch:Review Claim
A quoted argument that spans lines is parsed as one word; only a quote that never closes is reported as unparseable.
Review Lane
behavior
Review Unit
engine-runtime
Safety Invariant
Only quoted text spanning lines changes, from "could not parse" to parsed. A quote that never closes is still reported, and the hook never blocks.
Slice Rationale
One parser change plus its test file. The separate
gh apirepo-scope fix is the next PR.Non-goals
Test Plan
Test Plan
python3 -m unittest discover -s engine/hooks/pr-schema-gate/tests -p 'test_multiline_quotes.py'before the fix:FAILED (failures=2, errors=1); after: all pr-schema-gate testsOKmainand on this branch (Before and After above)python3 engine/skills/make-pr/scripts/preflight.py --base origin/main→ok preflight passed.github/workflows/ci.ymlstep at the stack tip: all 14 exit 0 (run_all_tests.sh→OK)Revert Plan
Revert Plan
git revert <sha>, then./install.sh🤖 Generated with Claude Code
https://claude.ai/code/session_01WSVNdBBo7dFqoR8Tx521EJ
Note
Low Risk
Parser-only change in a non-blocking hook; behavior tightens false unparseable warnings without altering validation or command blocking.
Overview
Fixes false “could not parse” advisories in
pr-schema-gatewhen a shell command includes a quoted argument that spans multiple lines (e.g.git commit -am "subject\n\ntrailers").shell_model.pyno longer tokenizes each logical line in isolation. Ifshlexreports an incomplete quote, lines are accumulated until the quote closes, so the multiline string stays a single argv word.parse_commandsstill returnsNonewhen a quote never closes.Docs in
README.mddescribe the new rule.test_multiline_quotes.pycovers the real heredoc + multiline commit payload, single-quoted multiline args, unclosed quotes, and hook silence in scope.Reviewed by Cursor Bugbot for commit e06b578. Bugbot is set up for automated code reviews on this repo. Configure here.