fix: Preserve trailing newlines instead of adding them unconditionally#29124
fix: Preserve trailing newlines instead of adding them unconditionally#29124Genbox wants to merge 1 commit into
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found a related PR that is worth noting: Related PR:
The other results (PRs #26374, #28622, #28643) are about adding trailing newlines to help output, which is the opposite concern from what PR #29124 addresses. These are not true duplicates, but #20217 represents related work in the area of preserving file formatting characteristics during modifications. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Type of change
What does this PR do?
When opencode makes a change to a file via
apply_patch, it also adds a trailing newline. This unnecessary change causes issues and is not expected. This PR preserves when files contain a trailing newline and does not add new ones to files that are changed.How did you verify your code works?
I've extended the appropriate unit tests to verify that no trailing newlines are added and that existing ones are preserved.
Checklist