Repository navigation
Conversation
Heredoc payload lines currently become separate instructions. A FROM inside a RUN body changes parent_images, and replacing the RUN leaves its body behind. Consume bodies and terminators with their RUN, COPY, or ADD header, including ONBUILD instructions. Preserve body content and physical line bounds, and include the bodies in value and JSON output. Recognize quoted and multiple delimiters using Docker's frontend rules [1]. Unterminated bodies fail when reading structure, before edits that depend on that parse write. Reuse WordSplitter with optional separator preservation so operator spacing remains distinguishable without changing existing callers. Align cached line splitting with file reads so literal carriage returns in bodies do not change parsing or edit boundaries when caching is on. Fixes containerbuildsystem#145. Codex-assisted implementation with delegated independent review. [1]: https://docs.docker.com/reference/dockerfile/#here-documents Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Doubled terminal escape characters currently absorb the next Dockerfile instruction and lose a literal character from the value. Use Docker’s continuation rule for both instruction boundaries and value normalization, including the escape directive. Heredoc bodies then start at the same boundary as the builder. Signed-off-by: Tamir Duberstein <tamird@gmail.com>
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.
The parser mistakes FROM text inside a RUN heredoc for another stage, and replacing RUN leaves its body behind. It also swallows a real instruction after a line ending in consecutive escape characters.
Include each heredoc’s body and terminator in its returned value and line range, so edits handle the complete block. A terminal escape continues an instruction only when it is not preceded by another escape. Cached reads preserve physical line boundaries, and reading an unterminated heredoc raises ValueError.
Fixes #145.
Codex-assisted implementation with delegated independent review.