Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix(repo): enforce LF checkouts across platforms by yxr-2025 · Pull Request #302 · openpi-dev/openpi · GitHub
Skip to content

fix(repo): enforce LF checkouts across platforms - #302

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts
Aug 31, 2026
Merged

fix(repo): enforce LF checkouts across platforms#302
tt-a1i merged 2 commits into
openpi-dev:mainfrom
yxr-2025:fix/enforce-lf-checkouts

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes#291

Problem

仓库此前没有 .gitattributes 或其他仓库级换行策略,工作树中的行尾由开发者机器的 Git 配置决定。

在 Windows 且系统 Git 使用常见配置 core.autocrlf=true 时,最新 main 的干净 checkout 会出现:

323 files: i/lf w/crlf
0 files: i/lf w/lf

i/lf w/crlf 表示索引保存 LF,但工作树实际使用 CRLF。Git 比较时会自动归一化,因此 git status 仍显示干净,问题很难从工作区状态中发现。

这会直接破坏仓库的本地验证契约。Biome 按实际工作树字节检查格式,因此一个没有源码修改、git status 干净的 Windows checkout 会在 bun run format:check 中报告约 270 个格式错误,建议改动基本都是删除行尾的 \r。Windows 贡献者因而无法在干净 checkout 上可靠执行仓库要求的 bun run check,而自动格式化还可能产生覆盖全仓库的换行噪声。

本问题与 #69 中用户输入包含 CRLF 时 fenced Markdown 的解析问题不同。本 PR 只处理仓库源码的 checkout 策略。

Value

本修复让仓库自身成为换行策略的来源,而不再依赖每位贡献者的全局 Git 配置:

  • Windows、macOS 和 Linux 获得一致的文本文件工作树字节;
  • Windows 的干净 checkout 可以直接通过 Biome 格式检查;
  • 避免自动格式化产生全仓库换行重写,减少无意义 diff 和 review 成本;
  • 提高文本测试、构建输入和 npm 发布输入的跨平台可重复性;
  • 避免 git status 干净但格式检查失败的隐蔽故障。

Approach

在仓库根目录增加:

*text=autoeol=lf

这条规则要求 Git 将识别为文本的文件以 LF 写入工作树,同时继续通过 text=auto 区分文本和二进制文件。

本 PR 没有提交全仓库换行重写,因此不会引入源码内容层面的噪声 diff。提交只包含:

  • 新增根目录 .gitattributes
  • CONTRIBUTING.md 中记录保留旧目录、clone 到新目录的迁移与验证步骤。

如果后续出现确实需要 CRLF 的 Windows 专用文件,可以针对具体路径增加更窄的属性规则。

Validation

验证环境为 Windows,系统 Git 配置 core.autocrlf=true

属性解析:

README.md: text: auto
README.md: eol: lf
CONTRIBUTING.md: text: auto
CONTRIBUTING.md: eol: lf
package.json: text: auto
package.json: eol: lf

应用策略并重新生成当前工作树后:

w/crlf=0
w/lf=323

使用包含本 PR 提交的隔离 checkout,在 core.autocrlf=true 下验证:

w/crlf=0
w/lf=324

仓库检查:

bun run check
✓ config contract
✓ discipline ledger
✓ format:check: Checked 270 files. No fixes applied.
✓ lint: Checked 270 files. No fixes applied.
✓ typecheck

bun run check 完整通过。

Windows 全量测试说明

本地执行 bun run test 时,完整测试集中的三个 Windows 进程终止测试出现了间歇性失败:

kill settles a never-exiting process as killed and resolves after settle; repeat kill is a no-op
concurrent overlapping multi-id kills observe each settlement exactly once
taskkill terminates a Windows descendant process tree

本 PR 不修改运行时代码、进程管理代码或测试代码,这些失败也不经过 .gitattributes 或贡献文档的代码路径。

进一步隔离验证结果:

  • 三个测试分别单独运行:全部通过;
  • 三个测试在同一命令中运行:全部通过;
  • 相关 background-terminals 测试串行运行:全部通过;
  • 失败仅在 Windows 全量测试并行运行多个真实子进程和 taskkill /T 清理流程时出现。

这些测试会真实创建长时间运行的 Node 子进程,并在固定 teardown 时间窗口内调用 taskkill、等待进程树退出和触发 settlement。Node test runner 并行执行多个测试文件时,Windows 的进程调度和清理时序会使这些严格时间窗口产生竞争。

因此这里没有把 bun run test 标记为通过。现有证据表明这是 Windows 全量并行测试的既有时序稳定性问题,而不是本 PR 引入的行为回归。为保持本 PR 聚焦,本次没有夹带测试基础设施改动;相关测试的 Windows 并发控制适合独立处理。

Impact

  • 用户可见行为:文本文件在所有平台统一以 LF 检出。
  • 模型可见上下文或工具:无变化。
  • 运行时与生命周期:无变化。
  • 持久化配置或数据:无变化。
  • 兼容性:覆盖用户全局 core.autocrlf 对本仓库文本 checkout 的影响。
  • 风险:低。二进制文件仍由 text=auto 识别,确需 CRLF 的文件可以增加路径级例外。
  • Diff 范围:仅 .gitattributesCONTRIBUTING.md,没有源码内容重写。

Summary by CodeRabbit

  • Documentation

    • Added guidance on the project’s LF line-ending policy.
    • Included steps for safely normalizing existing checkouts and verifying line endings.
  • Chores

    • Standardized tracked text files to use LF line endings.

Maintainer revision and validation — 2026-08-31

Final head: 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47, rebased onto main@f474f60fb5305a9053609aa0ab569bc22ab951ac.

  • 修正文档中的迁移步骤:已复现旧 CRLF checkout 即使 git status 干净,普通 git restore --source=HEAD --worktree -- . 也不会强制重写文件。现在建议保留旧目录、clone 到一个未使用的新目录;明确未推送提交、未提交改动、未跟踪/忽略文件不会自动迁移。没有添加脚本或运行时机制。
  • 最终 diff 仍仅为 .gitattributesCONTRIBUTING.md,一行原生 Git 策略不变,无源码重写。
  • 本次本地环境:macOS、Node 24.18.0、Bun 1.3.14。bun install --frozen-lockfilebun run checkbun run test 均通过:Node 1086 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • 从最终 head 创建全新隔离 clone(core.autocrlf=true):334 个文本文件均为 i/lf w/lf,0 个 w/crlf,2 个二进制文件字节哈希与 Git blob 一致;新 clone 格式检查 278 files passed,工作树干净。旧 CRLF 复现目录保留不动。
  • 独立 Standards 与 Spec 复核均为 0 项发现。

上述本次验证不是原生 Windows 全量测试验收;前文作者的 Windows 历史验证与失败说明保留。新 head 的 GitHub CI 与实际合并状态另行确认。

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 30, 2026
@coderabbitai

coderabbitaiBot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 184fefb0-9ff7-4582-b7fa-5beba0282228

📥 Commits

Reviewing files that changed from the base of the PR and between 82a2c1b and 70cb520.

📒 Files selected for processing (2)
  • .gitattributes
  • CONTRIBUTING.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The repository now enforces LF line endings for text files. Contributor documentation explains how to normalize an existing checkout and verify its line-ending state.

Changes

LF checkout policy

Layer / File(s)Summary
Enforce and document LF checkouts
.gitattributes, CONTRIBUTING.md
.gitattributes applies automatic text detection with LF line endings. Contributor guidance documents safe checkout restoration and verification with git ls-files --eol.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk:⚪ Minimal · up to 70cb5

The change standardizes text checkouts to LF and documents recovery steps without changing runtime behavior or source contents; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the repository-wide LF checkout policy implemented by the pull request.
Linked Issues check✅ PassedThe pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through `text=…
Out of Scope Changes check✅ PassedAll changes support issue #291 [#291]. The pull request modifies only .gitattributes and CONTRIBUTING.md, with no unrelated source, runtime, or test-code changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The pull request satisfies the coding objectives in issue #291 [#291]. It adds the root * text=auto eol=lf policy, documents recovery and verification steps, preserves binary handling through text=auto, and avoids source rewrites. The provided validation confirms LF checkouts and passing repository checks.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tt-a1i
tt-a1iforce-pushed the fix/enforce-lf-checkouts branch from 70cb520 to 9bb796eCompareAugust 31, 2026 13:21
@tt-a1i

Copy link
Copy Markdown
Collaborator

修订完成,最终 head 9bb796e4a9d3abc2ecfcc3424c19ceb320ceba47

  • 只修正旧 checkout 迁移说明,保留原生 Git 一行 LF 策略;不重写源码、不增加脚本。
  • 本地 check/test、新 clone 在 core.autocrlf=true 下的 LF/格式检查、二进制哈希核对均通过。独立 Standards / Spec 复核均无发现。
  • 新 head 必需 CI 全绿:Node 22.19.0、Node 24、Background terminals (Windows)。运行:https://github.com/openpi-dev/openpi/actions/runs/33396555387
  • 已尝试按 exact head 正常 squash merge;GitHub 因审批规则拒绝(REVIEW_REQUIRED)。目前仍为 OPEN,未使用管理员绕过、未修改保护规则。还需非最后推送者的有 write 权限成员 approve。

@tt-a1i
tt-a1i merged commit b02ed88 into openpi-dev:mainAug 31, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repo): enforce LF checkouts across platforms

2 participants

@yxr-2025@tt-a1i