Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

repo: 295 of 416 catalog entries have CRLF line endings and there is no .gitattributes

已關閉
#140 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
52/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
git, javascript
領域
tooling

研究方向

Start by reading site/lib/frontmatter.mjs and markdown.mjs at the cited lines, then inspect validate.mjs, CONTRIBUTING, and .git-blame-ignore-revs. Add a line ending policy, renormalize tracked files, enforce it in validation, and document it. Done when git ls-files --eol shows no CRLF or mixed files and a CRLF fixture fails npm run validate with a clear message.

由索引模型根據 Issue 內容生成。

描述

dx priority: medium

Why it matters

The parsers tolerate \r\n (site/lib/frontmatter.mjs:92, markdown.mjs:104), so nothing breaks today, but the repo has no line-ending policy: git ls-files --eol reports 295 files as i/mixed (CRLF body, LF final line) and 5 as i/crlf, next to 225 i/lf. Contributors on Linux and macOS get whole-file diffs when their editor normalises, npm run new-entry output and hand-edited files disagree, and a future helper that splits on \n alone will silently keep a \r in a field value. It is the kind of friction a first-time contributor hits and gives up on.

Evidence (at 69387df)

$ git ls-files --eol | awk '{print $1}' | sort | uniq -c
    5 i/crlf
  225 i/lf
  295 i/mixed

All 295 mixed files are under catalog/ (tools 65, 3d 60, 2d 49, audio 25, characters 24, fonts 23, shaders-vfx 15, video 13, environment 11, animation 10). No .gitattributes exists; core.autocrlf is unset.

Suggested approach

Add .gitattributes with * text=auto eol=lf plus binary for *.webp, *.png, *.woff2; run git add --renormalize . in one commit titled "Normalise line endings" and list it in .git-blame-ignore-revs. Add a one-line check in validate.mjs that rejects a \r in any catalog or docs file, so the policy is enforced rather than assumed.

Done when

git ls-files --eol shows no i/crlf or i/mixed; a CRLF fixture fails npm run validate with a clear message; CONTRIBUTING mentions the policy in one sentence.

主要語言
JavaScript
星號
58
分支
15
平均合併
16 小時 53 分鐘
30 天內合併 PR
14

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。