Skip to content

Add .gitattributes for consistent line endings and GGUF binary handling#68

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/fix-crlf-line-endings-JmxnW
May 17, 2026
Merged

Add .gitattributes for consistent line endings and GGUF binary handling#68
bernardladenthin merged 1 commit into
mainfrom
claude/fix-crlf-line-endings-JmxnW

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Add .gitattributes file to enforce LF line endings across the repository and mark GGUF model files as binary
  • Ensures consistent line endings in version control regardless of platform (Windows/Unix/macOS)
  • Prevents Git from attempting to normalize or diff GGUF binary model files

Test plan

  • CI is green on this branch

Related issues / PRs

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes (if there are, I have notified the maintainer privately per SECURITY.md)

https://claude.ai/code/session_01Kp7cLit81aXEcw2ttAjPdb

… binary

Add * text=auto eol=lf to enforce LF for all text files, matching the
.editorconfig policy. Mark *.gguf as binary so git never attempts
line-ending conversion on LLM weight files.
@sonarqubecloud

Copy link
Copy Markdown

@bernardladenthin
bernardladenthin merged commit c8cd52d into main May 17, 2026
8 of 10 checks passed
@bernardladenthin
bernardladenthin deleted the claude/fix-crlf-line-endings-JmxnW branch May 17, 2026 19:48
@claude

claude Bot commented May 17, 2026

Copy link
Copy Markdown

Code Review: PR #68

Summary

✅ This PR is well-executed and addresses an important cross-platform concern. The .gitattributes file is minimal, correct, and follows repository conventions.

Strengths

  1. Correct directives

    • * text=auto eol=lf properly enforces LF line endings for all text files
    • *.gguf binary correctly marks binary model files to prevent Git from attempting text normalization
  2. Follows repository conventions

    • SPDX license header matches project style
    • Apache 2.0 license declaration is consistent with existing files
    • Aligns with the REUSE compliance check in CI
  3. Solves a real problem

    • Prevents line ending inconsistencies on Windows/Unix/macOS
    • Protects binary GGUF model files (including src/test/resources/SmolLM2-135M-Instruct-Q3_K_M.gguf) from accidental corruption
    • Reduces friction for contributors on different platforms
  4. Security / Hygiene

    • Helps mitigate CRLF injection vectors on Windows
    • Prevents unintended modifications to binary artifacts in version control

Observations

  • The order of directives is semantically correct (general rule, then specific override)
  • Consider documenting in CONTRIBUTING.md that contributors should not manually normalize line endings, as Git will handle it automatically now

No Issues Found

No bugs, security issues, or code quality concerns detected.

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.

2 participants