Ensure MCP config files end with a trailing newline - #990
Merged
pushpak1300 merged 2 commits intoSep 2, 2026
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.
boost:installwrites MCP config files (.mcp.json,.cursor/mcp.json,.vscode/mcp.json, etc.) without a trailing newline, so the file ends right after the closing}. As a result:\ No newline at end of filemarker in diffs whenever the config file is committed.insert_final_newline, Prettier, etc.) re-add it, producing a noisy one-line diff after everyboost:installrun.This is the same class of issue previously fixed for guideline files in #113 and for skill files in #790 —
Install\Mcp\FileWriterwas the remaining writer without the guard.Changes
FileWriter::writeFile()now ensures the written content ends with a newline, reusing the exactensureTrailingNewline()implementation fromSkillWriter(Fix path separators and trailing newlines in install output #790). Since every write path (new file creation, plain JSON update, JSON5 in-place update) goes throughwriteFile(), all generated configs are covered.AgentTestaccordingly.There is no behavioral change beyond the final byte of the written file — existing configs are parsed and re-written exactly as before.