Repository navigation
fix(plugin): preserve Go declarations after raw strings ending in backslashes - #1235
Merged
Merged
Conversation
mldangelo-oai
approved these changes
Oct 5, 2026
mldangelo-oai
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the focused fix! I reproduced the missing later declaration on current main and confirmed the PR restores it for valid Go raw strings. Reusing the existing raw-string terminator is a simple and appropriate solution.
I checked trailing-backslash parity, multiline strings, same-line braces, comments, interpreted strings, runes, and struct tags, and verified the refreshed branch preserves the PHP heredoc fix. The 88 preview tests and required portable source checks pass; two independent reviews found no code changes needed. I also clarified the reproducing example and validation details in the description.
Approving the refreshed revision. Merge remains subject to the required CI checks.
Merged
3 tasks done
3 tasks done
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
Go raw strings treat backslashes literally. The rank-preview masker previously treated a backslash as an escape, so a raw string ending in an odd number of backslashes could hide later functions and methods. This valid declaration reproduces the problem:
Changes
Route Go backtick strings through the existing raw-string terminator handling. Add a regression test confirming declarations before and after a raw string ending in one backslash appear in the preview.
Testing
python -m pytest plugins/codex-security/tests/test_rank_preview.py -q— 88 passed, including the merged PHP heredoc regressions.python -m ruff check --config plugins/codex-security/pyproject.toml plugins/codex-security— passed.python -m ruff format --check --config plugins/codex-security/pyproject.toml plugins/codex-security— passed.pnpm --dir sdk/typescript run build:ci— passed.node .github/scripts/check_plugin_source_compatibility.mjs— passed.NODE_NO_WARNINGS=1 node --test .github/scripts/test_check_plugin_source_compatibility.mjs— 9 passed. Unrelated local runtime warning output was disabled for the checker's exact-stderr assertions.Risk and rollout
Five implementation lines reuse existing raw-string handling and apply only to Go backtick strings. No public CLI or configuration changes. Refreshed on current main and verified together with the PHP heredoc fix.
Public disclosure review