Repository navigation
Studio Terminal: give the heredoc quote scanner its own substitution helper - #17442
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
Source lintfails on main since #17256, and on every PR based on it (seen on #17429 and #17435):These are not two copies of one function. They are two different helpers that ended up with the same name:
$( ... )_quote_end)-1_quote_end, which handles\"and nested$(2>nulrewrite), used by_bash_nul_to_dev_null)len(command)findof the same quoteThe later definition wins at module scope. So since #17256 merged, its
_quote_endhas been running #17010's helper rather than the one written for it, while #17010's nul rewrite keeps its own. The lint is right, and both PRs are correct on their own. The fix is to give #17256's helper its own name.The practical effect is small but real: the two disagree on some quoting. For example,
"( )'$("")"` reads as unterminated with the intended helper and as closed with the shadowing one, which changes how the Terminal heredoc screen splits that command.Change
The helper at line 6738 is renamed
_quoted_substitution_end, and its one caller in_quote_enduses it. That is the function Studio: ask before running Python fed to Terminal through a heredoc #17256 wrote and tested.Studio: stop the Windows Terminal from creating nul files through Git Bash #17010's
_substitution_endand the nul rewrite are untouched.test_the_heredoc_quote_scanner_keeps_its_own_substitution_helperinstudio/backend/tests/test_permission_mode.pypins both contracts:_quoted_substitution_endreturns one past the)and-1when unterminated;_quote_endcloses"$(echo "a)")"at its last quote and keeps the case above unterminated;_substitution_endkeeps the nul rewrite's own return values.It fails on main, where the name is shadowed.
Testing
scripts/lint_duplicate_definitions.pyontools.py: flags main, clean herestudio/backend/tests/test_permission_mode.pyandtest_windows_bash_nul_redirect.py: 2637 passed, 1 skipped. The new test fails on main.tests/test_lint_duplicate_definitions.py: 12 passed