Skip to content

chore(git): add .gitattributes with LF line ending normalization#5

Closed
algorithmpoet wants to merge 1 commit into
mainfrom
bgagent/01KQ131SED9HAZ7XB24QXV2FVB/add-a-gitattributes-file-with-lf-line-en
Closed

chore(git): add .gitattributes with LF line ending normalization#5
algorithmpoet wants to merge 1 commit into
mainfrom
bgagent/01KQ131SED9HAZ7XB24QXV2FVB/add-a-gitattributes-file-with-lf-line-en

Conversation

@algorithmpoet
Copy link
Copy Markdown
Collaborator

Summary

  • Add .gitattributes file to enforce LF line endings for all text files
  • Sets * text=auto eol=lf as the global default for automatic normalization
  • Explicitly declares common text file types (.md, .json, .yaml, .yml, .toml, .py, .js, .cjs, .ts, .sh, etc.) with eol=lf
  • Marks binary files (images, archives) to prevent modification

Motivation

Without .gitattributes, contributors on Windows may commit files with CRLF line endings, causing noisy diffs and potential CI failures. This file ensures consistent LF endings across all platforms and contributors.

Build and test results

  • mise run buildPASSED (lint, fmt:check, validate, security all green)
  • mise run lintPASSED
  • No test suite failures; this is a configuration-only change

Decisions made

  • Used * text=auto eol=lf as the catch-all rule so Git auto-detects text vs. binary files and normalizes to LF
  • Explicitly listed common text extensions for clarity and to override any ambiguity
  • Binary extensions (images, archives) are marked binary to prevent any line-ending conversion

Agent notes

What went well: The task was straightforward — the repo had no existing .gitattributes, so there were no conflicts. The mise run build command provided a convenient one-stop check for lint, formatting, validation, and security.

What was difficult: Nothing significant — clean codebase with well-organized tooling.

Patterns/conventions discovered:

  • The repo uses mise for all task running; always use mise run <task> rather than raw tool commands
  • Commit messages follow conventional commits format: <type>(<module>): description
  • The build task runs lint + fmt:check + validate + security in sequence
  • dprint is used for formatting; .gitattributes is not a file type dprint touches, so no fmt issues

Suggestions for future tasks:

  • Consider adding .editorconfig alongside .gitattributes for consistent editor settings
  • The mise run pre-commit task runs pre-commit hooks — worth verifying hooks include line-ending checks after this change

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Add a .gitattributes file to enforce LF line endings across all text
files, preventing CRLF issues on Windows and ensuring consistent
formatting across contributors and CI environments.

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

Task-Id: 01KQ131SED9HAZ7XB24QXV2FVB
Prompt-Version: 1c9c10e027a2
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

This pull request is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

@github-actions github-actions Bot added the stale label May 9, 2026
@github-actions
Copy link
Copy Markdown

Closing this pull request as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

@github-actions github-actions Bot closed this May 11, 2026
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.

1 participant