Skip to content

fix(nodes): enforce LF for .md files and harden doc generator on Windows#1330

Open
joshuadarron wants to merge 1 commit into
developfrom
fix/RR-1329-md-eol-lf-gitattributes
Open

fix(nodes): enforce LF for .md files and harden doc generator on Windows#1330
joshuadarron wants to merge 1 commit into
developfrom
fix/RR-1329-md-eol-lf-gitattributes

Conversation

@joshuadarron

@joshuadarron joshuadarron commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds *.md text eol=lf to .gitattributes so git never checks out Markdown files with CRLF on Windows.
  • Hardens injectBlock in nodes/scripts/gen-node-tables.mjs to normalize \r\n → \n before diffing, making nodes:docs-generate idempotent on Windows regardless of what line endings git placed on disk.

Problem

On Windows, * text=auto in .gitattributes caused git to check out .md files with CRLF. The doc generator reads CRLF, splices in a generated block built from JS template literals (LF only), and writes back a mixed-ending file. Because the content always differed from the original, every build rewrote the file and left it permanently dirty in git status.

Test plan

  • Run node nodes/scripts/gen-node-tables.mjs webhookgit status should show no modifications.
  • Run it again — still clean (idempotency check).
  • Confirm git check-attr eol -- nodes/src/nodes/webhook/README.md returns eol: lf.

Closes #1329

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Configured line ending settings to enforce consistent Unix-style formatting in Markdown files, preventing spurious diffs across platforms.
    • Enhanced documentation generation to normalize line endings consistently for improved cross-platform compatibility.

*.md eol=lf in .gitattributes stops git from converting node READMEs to
CRLF on checkout. injectBlock in gen-node-tables.mjs now normalizes \r\n
before diffing, so the script is idempotent even on repos missing the
gitattributes rule.

Closes #1329

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77e86c8b-948f-46d4-a578-dfdd6ca57d8a

📥 Commits

Reviewing files that changed from the base of the PR and between e1b4da7 and ef394aa.

📒 Files selected for processing (2)
  • .gitattributes
  • nodes/scripts/gen-node-tables.mjs

📝 Walkthrough

Walkthrough

Two files are changed to fix spurious Windows CRLF diffs in generated node README files. .gitattributes adds a rule enforcing LF line endings for all Markdown files. gen-node-tables.mjs normalizes \r\n to \n when reading README content before marker-based injection.

Changes

Windows CRLF Line-Ending Fix

Layer / File(s) Summary
LF enforcement in .gitattributes and injection script
.gitattributes, nodes/scripts/gen-node-tables.mjs
.gitattributes adds *.md text eol=lf to normalize Markdown files to LF; injectBlock() converts \r\n to \n when reading the target README before performing marker replacement.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A CRLF snuck in like a weed,
On Windows it caused files to bleed.
Two lines set things right —
LF shines bright!
Now diffs stay clean, guaranteed. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: enforcing LF for .md files and hardening the doc generator on Windows.
Linked Issues check ✅ Passed The PR fully addresses issue #1329 requirements: adds *.md text eol=lf to .gitattributes and normalizes line endings in the doc generator script.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving the Windows line-ending issue in README.md files; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/RR-1329-md-eol-lf-gitattributes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete.

@joshuadarron joshuadarron enabled auto-merge (squash) June 20, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: node doc generator causes spurious README.md diffs on Windows

1 participant