Skip to content

chore: add .gitattributes to enforce consistent line endings - #78

Open
TanmayLimje wants to merge 1 commit into
pavanvamsi3:mainfrom
TanmayLimje:chore/add-gitattributes
Open

chore: add .gitattributes to enforce consistent line endings#78
TanmayLimje wants to merge 1 commit into
pavanvamsi3:mainfrom
TanmayLimje:chore/add-gitattributes

Conversation

@TanmayLimje

Copy link
Copy Markdown

Summary

Adds a .gitattributes file to enforce LF line endings across all platforms.

Fixes #64

Changes

  • * text=auto eol=lf auto-detect text files and normalize to LF
  • Explicit LF rules for .sh, .ts, .js, .json, .yml, .yaml, .md, .css, .html
  • CRLF preserved for .cmd files (required by Windows batch interpreter)
  • Binary rules for image files (.png, .jpg, .jpeg, .gif, .ico, .svg)

Why

  • Prevents spurious whitespace-only diffs from Windows contributors
  • Standard practice for cross-platform Node.js projects
  • Config-only change, no code modifications

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repository-level .gitattributes to normalize line endings (primarily enforcing LF) across platforms to reduce whitespace-only diffs and avoid script issues on Windows checkouts.

Changes:

  • Introduces * text=auto eol=lf as a baseline for LF normalization.
  • Adds explicit per-extension EOL rules, including preserving CRLF for .cmd.
  • Marks common image formats as binary.
Show a summary per file
File Description
.gitattributes Establishes consistent line-ending and binary/text handling rules across the repo.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread .gitattributes
Comment on lines +5 to +8
*.sh text eol=lf
*.ts text eol=lf
*.js text eol=lf
*.json text eol=lf
Comment thread .gitattributes
Comment on lines +11 to +22
*.md text eol=lf
*.css text eol=lf
*.html text eol=lf
*.cmd text eol=crlf

# Binary files — do not modify
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add .gitattributes to enforce consistent line endings

2 participants