You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
process: format:check can never be green — committed style diverges from unconfigured prettier #360
git checkout origin/master && npm ci && npm run format:check
→ Code style issues found in 101 files (with src/**/*.ts tests/**/*.ts; the npm script's broader globs report ~120).
Impact
AGENTS.md §7.2 requires re-running format:check after rebase and §7.4 lists it in the auto-merge gate — but the check can never be green without a ~120-file mass reformat, which §7.4 simultaneously forbids ("no mass whitespace/reformat"). The gate is unsatisfiable for every PR.
Sampled divergence: interface members committed at 4-space indent where prettier 3.9.6 (locked version) emits 2-space (e.g. src/truncate-tools.ts:6-13). Repo has NO .prettierrc, no prettier key in package.json, no .editorconfig — so bare defaults apply to a codebase clearly not formatted by bare defaults.
ci.yml runs typecheck/test/build only, so this never surfaced in CI.
Suggested fix (pick one)
(a) Add a prettier config matching the committed style so the check passes without churn (preferred: smallest blast radius);
Repro confirmed: npm run format:check fails with 115 files (prettier 3.9.6, no config anywhere in the repo).
Root cause runs deeper than "missing config": the committed style is not a single style. Grid-searched tabWidth{2,4} × printWidth{80,100,120} × trailingComma{all,es5,none} (+ markdown settings) over all 160 checkable files: the best config passes only 45/160, and 78 of 146 TS files match no config at all (e.g. src/truncate-tools.ts mixes 4-space indents with lines longer than every tested width). So option (a) is impossible as stated — no single config makes the check pass without churn.
Chose (b) + explicit config: pin the exact rule set the check already applied (convergence = zero semantic drift vs. today's check behavior), then one-time prettier --write.
Done (branch 2026-09-23_prettier-converge, commit 08aaaf4, base master b30723f):
.prettierrc.json: {tabWidth:2, printWidth:80, semi:true, singleQuote:false, trailingComma:"all", arrowParens:"always", bracketSpacing:true, endOfLine:"lf"} — explicit pin of the current defaults, immune to future prettier default changes.
.prettierignore: package-lock.json (npm rewrites it in its own format; it can never stay prettier-clean).
One-time convergence: 115 files, whitespace/wrap/punctuation only. package.json diff is indentation-only — no version change, no semantic edits.
.gitignore: added .tmp/ (workspace scratch dir must not be able to break the mandated check).
Gates on the head: format:check ✅ · typecheck ✅ · npm test ✅ 869/869 · build ✅
Behavior changes (old → new):
No prettier config → explicit .prettierrc.json pinning the identical rules as bare defaults (protects against future default drift).
Mixed 2sp/4sp/inconsistent-wrap style → converged to the pinned defaults (~115-file churn; semantics unchanged, proven by the full suite).
format:check: permanently red on master (115 files) → green and satisfiable going forward — unblocks the AGENTS.md §7.2/§7.4 gates.
Markdown docs: table columns padded, some emphasis markers normalized, embedded code in fences reformatted.
package-lock.json excluded from the format check.
Out of scope (your call):ci.yml still runs no format step — adding one would keep this regression-free automatically. Say the word and I'll file a separate issue/PR.
Currently blocked:git ls-remote / git push to origin time out (≥25s probes, exit 124) — the network path to GitHub is down from this environment right now. Everything is committed locally and all gates are green; I'll push 2026-09-23_prettier-converge and open the PR referencing this issue as soon as connectivity recovers, then report back here with the link.
Activity
ranxianglei commentedon Sep 22, 2026
[bot] 🏷 Triage + fix ready (push/PR pending — network to GitHub currently unreachable)
Verification (on
origin/master@ b30723f):npm run format:checkfails with 115 files (prettier 3.9.6, no config anywhere in the repo).src/truncate-tools.tsmixes 4-space indents with lines longer than every tested width). So option (a) is impossible as stated — no single config makes the check pass without churn.prettier --write.Done (branch
2026-09-23_prettier-converge, commit08aaaf4, base master b30723f):.prettierrc.json:{tabWidth:2, printWidth:80, semi:true, singleQuote:false, trailingComma:"all", arrowParens:"always", bracketSpacing:true, endOfLine:"lf"}— explicit pin of the current defaults, immune to future prettier default changes..prettierignore:package-lock.json(npm rewrites it in its own format; it can never stay prettier-clean).package.jsondiff is indentation-only — no version change, no semantic edits..gitignore: added.tmp/(workspace scratch dir must not be able to break the mandated check).format:check✅ ·typecheck✅ ·npm test✅ 869/869 ·build✅Behavior changes (old → new):
.prettierrc.jsonpinning the identical rules as bare defaults (protects against future default drift).format:check: permanently red on master (115 files) → green and satisfiable going forward — unblocks the AGENTS.md §7.2/§7.4 gates.package-lock.jsonexcluded from the format check.Out of scope (your call):
ci.ymlstill runs no format step — adding one would keep this regression-free automatically. Say the word and I'll file a separate issue/PR.Currently blocked:
git ls-remote/git pushto origin time out (≥25s probes, exit 124) — the network path to GitHub is down from this environment right now. Everything is committed locally and all gates are green; I'll push2026-09-23_prettier-convergeand open the PR referencing this issue as soon as connectivity recovers, then report back here with the link.一句话中文摘要:已确认 master 上 format:check 必然红(115 个文件),且已提交代码并非单一风格(网格搜索证明任何单一配置都无法零改动通过),故采用「显式固定当前默认配置 + 一次性 prettier --write 收敛」方案;format/typecheck/869 项测试/build 全部通过;因当前到 GitHub 的网络不通,分支与提交已在本地就绪,网络恢复后即推送并开 PR。
ranxianglei commentedon Sep 22, 2026
[bot] 🏷 网络已恢复,推送和 PR 完成:
PR: #361 (
2026-09-23_prettier-converge→master, commit08aaaf4).prettierrc.json(显式固定当前默认规则)+.prettierignore(排除 npm 管理的 lockfile)+ 一次性prettier --write收敛(115 文件,纯空白/换行/标点)+.gitignore增加.tmp/。format:check✅ ·typecheck✅ ·npm test✅ 869/869 ·build✅。format:check从 master 上永久红(115 文件)变为可持续保持绿,§7.2/§7.4 门禁恢复可满足。version;ci.yml未加 format 步骤——如需,说一声我另开 issue/PR。一句话中文摘要:修复了 format:check 永不绿的问题(显式 prettier 配置+一次性风格收敛),分支已推送、PR #361 已开,等待你 review/合并;合并前我不会自行 merge。
chore: converge on explicit prettier style (#360)