chore: normalize line endings to LF via .gitattributes#224
Open
zbl1998-sdjn wants to merge 1 commit into
Open
Conversation
The repository has no `.gitattributes`, so with Git for Windows' default `core.autocrlf=true`, source files check out as CRLF on Windows. This includes the raw-text prompt/skill `.md` files imported as model input (e.g. `packages/agent-core/src/tools/builtin/file/read.ts` does `import readDescriptionTemplate from './read.md'`). A contributor editing and committing such a file on Windows can silently introduce CRLF, which changes the shipped prompt's byte/token footprint. Add `* text=auto eol=lf` (plus explicit `binary` types) so the repository stores and checks out LF on every platform, regardless of a contributor's local `core.autocrlf`. Existing blobs are already LF, so this is a declarative change with no content churn.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked issue. Per CONTRIBUTING this is a small build/repo-hygiene fix that can be opened directly; the problem is explained below.
Problem
The repository has no
.gitattributes. With Git for Windows' defaultcore.autocrlf=true, text files are checked out as CRLF on Windows. This includes the raw-text prompt/skill.mdfiles that are imported as model input — e.g.packages/agent-core/src/tools/builtin/file/read.ts:Two concrete consequences on Windows checkouts:
.mdfiles can silently introduce CRLF, changing the shipped prompt's byte/token footprint..mdcontent carries\r).What changed
Add a
.gitattributesthat pins line endings to LF for all text files (with explicitbinarytypes), so the repository stores and checks out LF on every platform regardless of a contributor's localcore.autocrlfsetting:The repository's existing blobs are already LF, so this change is declarative — it adds one file with no content churn to existing files. Verified after the change on Node 24.16.0 + pnpm 10.33.0:
pnpm lint→ 0 errorspnpm typecheck→ passesThis approach is standard repo hygiene and fits Kimi Code because the prompt/skill
.mdfiles are part of the shipped artifact; guaranteeing LF in the repo prevents accidental CRLF from a Windows contributor altering them.Checklist
gen-changesetsskill, or this PR needs no changeset. — No changeset: no publishable package code/behavior changes.gen-docsskill, or this PR needs no doc update. — No user-facing behavior change.