Preserve EOF whitespace in apply_patch updates#63
Open
ctkm-aelf wants to merge 17 commits into
Open
Conversation
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.
Changed files
Implemented EOF whitespace preservation for
codex-apply-patchupdate hunks by keeping the original split-line representation through replacement application instead of stripping the terminal empty element and re-adding a newline unconditionally.Updated focused CLI and scenario coverage for files without a final newline and for files with multiple trailing blank lines. The scenario fixture input was extended into scope because the regression requires a no-final-newline source fixture.
Fixes local managed issue #48.
Upstream reference: openai#21121.
Test results
Passed:
just fmtbash -lc 'set -a; if test -f /Users/chronoai/Desktop/codex/.refactor-loop/host.env; then source /Users/chronoai/Desktop/codex/.refactor-loop/host.env; fi; set +a; bash "$CONSENSUS_RND_RUST_GUARD" build'bash -lc 'set -a; if test -f /Users/chronoai/Desktop/codex/.refactor-loop/host.env; then source /Users/chronoai/Desktop/codex/.refactor-loop/host.env; fi; set +a; bash "$CONSENSUS_RND_RUST_GUARD" test'just test -p codex-apply-patchjust test -p codex-core apply_patch_cli_update_preservesjust fix -p codex-apply-patchgit diff --checkCI_GUARDSwas empty in host configuration, so no architecture guard command was configured to run.Deviations
HOST_REFACTOR_COMMENT_POLICYwas empty and normalized tonone, so no refactor self-documentation comments were added.The fixture input path
codex-rs/apply-patch/tests/fixtures/scenarios/014_update_file_appends_trailing_newline/input/no_newline.txtwas modified after emitting a scope-extension record because the scenario regression depends on preserving a no-final-newline input file.No commit was created; changes are staged in the worktree for controller-owned PR publication.
⟦AI:AUTO-LOOP⟧