Skip to content

Add .gitattributes to enforce LF line endings for Markdown and source files #124

@abeltrano

Description

@abeltrano

Problem

The repo has no .gitattributes file, so line endings depend on each contributor's local core.autocrlf setting. This leads to CRLF line endings appearing in Markdown files when authored on Windows, causing noisy diffs and inconsistency with existing files (which use LF).

Observed in #120 where a new protocol file was committed with CRLF and required manual conversion.

Proposed Fix

Add a .gitattributes file at the repo root:

# Normalize all text files to LF
* text=auto eol=lf

# Explicitly mark file types
*.md text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.json text eol=lf
*.py text eol=lf

This ensures all text files are stored as LF in the repo regardless of the contributor's OS or git config. Existing files that already use LF won't be affected.

Additional Consideration

After adding .gitattributes, run git add --renormalize . to fix any existing files with wrong line endings in a single commit.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions