Repository navigation
fix(next): keep line endings in files paramour init edits - #71
Merged
JasonPaff merged 2 commits intoOct 2, 2026
Conversation
In a CRLF checkout, init compared its LF agents snippet with the CRLF section byte for byte, so it reported "updated" for an unchanged section and wrote LF lines into a CRLF file. addPackageScript and the next.config wrap had the same problem, rewriting CRLF files as LF, and recast also dropped next.config's final newline. Init now compares its section with line endings normalized (sameContent) and writes every edit using the file's own line ending (lineEnding), and the next.config wrap restores the source's final newline. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…-agents-section-in-crlf-files-and
JasonPaff
deleted the
jasonpaff/par-116-init-rewrites-an-unchanged-agents-section-in-crlf-files-and
branch
October 2, 2026 21:40
This branch was successfully deployed
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.
In the Cadence rc trial (PAR-3, Windows,
core.autocrlf=true),paramour initreported "✔ updated paramour section in CLAUDE.md" for a section that hadn't changed. It also left the file with mixed CRLF and LF line endings.upsertAgentsSectioncompared the CRLF section with its LF snippet using===. This is the same class of bug as #58, but in the files init edits rather than the generated artifact.Change
lineEnding(text)next tosameContentinemit.ts. It returns the line ending a user-owned file already uses.sameContent. Adding or updating it uses the file's line ending.addPackageScript: the re-serializedpackage.jsonkeeps the file's line ending.next.configwrap: recast prints new nodes with LF and drops the final newline. The result now uses the source's line ending and keeps its final newline. The final newline was lost even for LF files.Generated files (the artifact, skills) are unchanged and still write LF, as #58 decided.
Verification
init.test.tscases:AGENTS.mdproduce no bare LF.package.jsonstays CRLF.wrap-next-config.test.tscases: CRLF is preserved, the final newline is kept, and no final newline is added when the source had none. These fail without the fix.pnpm test packages/next: 546 passed, 1 skipped. Typecheck and lint are clean.CLAUDE.mdstays CRLF.Fixes PAR-116
🤖 Generated with Claude Code