Skip to content

Commit c58cc12

Browse files
committed
docs(plans): 补两条接线行为说明
- lint-staged 在部分暂存时会 stash 未暂存改动,故校验看到的是「即将提交的状态」而非编辑器当前工作树 - countLines 只数 \n,故 CRLF 工作树与 LF 检出行数相同,CI 的 --full 与本地门禁不会打架
1 parent 8ba2cf8 commit c58cc12

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎docs/superpowers/plans/2026-09-11-frontend-redesign-batch0c1-line-limit-governance.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ git commit -m "docs(standards): 重建行数豁免登记为快照表"
551551
```
552552
(脚本忽略传入的文件名参数,只读全树 —— 这是刻意的:漏登与棘轮都是**全树性质**,只看暂存文件会漏。)
553553
554+
> **两点行为说明(写下来避免将来困惑)**:
555+
> 1. **lint-staged 会附带暂存文件名**,脚本予以忽略;且 lint-staged 在**部分暂存**的情况下会把未暂存的改动 stash 起来再跑命令 ⇒ 校验看到的是**"即将提交的状态"**(暂存文件 = 暂存内容,其余 = `HEAD`),**不一定等于你编辑器里的当前工作树**。这是正确行为,但若你看到行数与眼前不符,先想这一点。
556+
> 2. **跨平台行数一致**:Windows 工作树是 CRLF、Linux 检出是 LF,而 `countLines` 只数 `\n` ⇒ 同一提交在两边的行数**相同**(`"a\r\nb\r\n"` 与 `"a\nb\n"` 都得 2)。故 CI 的 `--full` 与本地门禁不会互相打架。
557+
554558
- [ ] **Step 2: 接进 CI**
555559
556560
在 `.github/workflows/pr-check.yml` 的 `jobs:` 下新增一个**无 `needs`/`if`**(每次都跑,约 10 秒)的 job:

0 commit comments

Comments
 (0)