Repository navigation
fix(scripts): 统一索引格式,避免机器人改动产生无关差异 - #2
Merged
Merged
Conversation
- formatIndex:两格缩进、纯值列表写在一行;track-releases 写回时使用 - validate-index 检查格式,--write-format 自动整理 - 文档补充格式化命令 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
问题
首次实测
Track plugin releases(追踪 Lua Support 0.2.0)时,脚本用JSON.stringify(index, null, 2)写回索引,把tags、platforms等短列表全部展开成多行,PR 里出现大量与新版本无关的差异,不便审查。改动
scripts/validate-index.mjs:新增formatIndex(两格缩进、只含纯值的数组写在一行);校验时要求索引是统一格式,新增--write-format自动整理。scripts/track-releases.mjs:写回索引时使用formatIndex,追踪 PR 只包含新增的版本条目。scripts/store.test.mjs:新增格式往返测试与“已发布索引符合统一格式”测试(共 30 个用例全部通过)。docs/publishing.md:本地校验步骤加入--write-format。验证
bot/track-releases分支索引运行--write-format后,与main的差异只剩新增的 0.2.0 版本块。main的索引已符合统一格式,无需改动数据。另:已在仓库创建 issue 模板与追踪工作流使用的
submission、report、new-version标签。🤖 Generated with Claude Code