eb6ef0d7 fix: resolve script spec audit errors#3213
Conversation
### Motivation The repository already has automation for generating `repo.json` and validating pathing JSON structure, but it does not have a dedicated audit layer for README-defined script submission conventions. This PR adds a separate script-spec audit tool to detect naming, metadata, README, manifest, combat signature, and pathing consistency issues without replacing the existing build pipeline. ### Changes - Add `tools/audit_script_specs.py`. - Generate `docs/SCRIPT_SPEC_AUDIT_REPORT.md`. - Scan the following script areas: - `repo/combat` - `repo/pathing` - `repo/js` - Report findings using: - `ERROR` - `WARNING` - `MANUAL_REVIEW` - Add repository-level reporting for category mismatches such as `repo/pathing/食材与炼金`. - Add legacy/pathing special-case handling so historical or non-standard pathing routes are not all treated as hard failures. - Improve pathing quantity detection so valid units such as `只`, `朵`, `条`, and `株` are not incorrectly reported as missing quantity. - Fail early when required scan roots are missing to avoid false “no issues found” results. ### Scope of Checks #### combat - Strict author signature format: `//作者:name` - Non-standard author signature detection - Comment style - Dungeon-only suffix candidates - Role shorthand naming candidates for manual review #### pathing - Filename numbering - Quantity suffix detection - Material-directory consistency - `README.md` casing - JSON parseability - `info.name` / `name` consistency with filename - Special-case handling for historical or non-material routes #### js - `manifest.json` presence - `main.js` presence - `README.md` casing - Folder naming warnings - Resource documentation checks ### Testing - `python -m py_compile tools/audit_script_specs.py` - `python tools/audit_script_specs.py . --report docs/SCRIPT_SPEC_AUDIT_REPORT.md` - `python tools/audit_script_specs.py . --report docs/SCRIPT_SPEC_AUDIT_REPORT.md --fail-on-errors` The generated report includes scan counts, severity counts, rule-level counts, repository-level issues, special-case exclusions, and detailed findings.
已根據 script spec audit 的 ERROR 項完成修復。 本次 commit: `eb6ef0d7 fix: resolve script spec audit errors` 主要處理內容如下: 1. 統一 combat 腳本作者署名格式為 `//作者:xxx` - 對包含原作者、修改者、名稱等資訊的項目,已拆成獨立註解行,避免資訊遺失。 2. 同步 pathing JSON 的 `info.name` - 已使 21 個 pathing JSON 的 `info.name` 與檔案名稱 stem 一致。 - 未重命名 pathing 檔案。 3. 修正 README 大小寫 - `repo/js/ComputerBlower/readme.md` - 已重命名為: - `repo/js/ComputerBlower/README.md` 4. 補齊缺失的 JS README - 已為 32 個缺 README 且存在資源目錄的 JS 腳本新增保守 README。 - README 內容包含腳本用途、資源用途與注意事項。 - 資源說明依據檔名、目錄名與 main.js 引用進行保守推斷。 5. `repo/js/FollowsPet` 未自動建立空 `main.js` - 為避免產生不可執行的假修復,沒有新增空 main.js。 - 已新增 `repo/js/FollowsPet/TODO.md`,提示維護者確認應補充有效 main.js、歸檔或移除該目錄。 未處理項: - `SCRIPT_SPEC_AUDIT_REPORT.md` 中的 WARNING 與 MANUAL_REVIEW 項未處理,符合本次只處理 ERROR 的範圍要求。 測試: - `git diff --cached --check` 通過。 - `python3 tools/audit_script_specs.py . --report /tmp/SCRIPT_SPEC_AUDIT_REPORT_final2.md || true` 已執行,僅剩 `repo/js/FollowsPet` 缺 main.js,已轉人工確認。 - 已對本次修改的 21 個 JSON 檔案進行解析校驗,全部通過。
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the contribution, but we don't think this change provides enough practical benefit to be merged at the moment. |
|
我理解维护者可能认为本 PR 的收益不足以覆盖 review / merge 成本。 但我这次更新的依据是 README 中「因早期对脚本管理较为宽松,因此仓库有部分脚本并不符合命名规范,欢迎通过 PR 规范这些名称」这一条。既然仓库文档明确欢迎通过 PR 规范旧脚本名称,那么我认为这类修正本身应当被视为有维护价值,而不只是“没有实际好处”。 如果当前维护策略已经变更,不再希望接受这类纯规范化 PR,建议同步调整或删除 README 中「欢迎通过 PR 规范这些名称」的描述,以免后续贡献者继续基于该说明提交类似 PR,造成双方时间成本。 当然,如果问题在于本 PR 范围过大、修改方式不符合预期,或只希望分批处理特定目录,也请明确说明,我可以按维护者偏好的范围重新拆分。 |
已根據 script spec audit 的 ERROR 項完成修復。
本次 commit:
eb6ef0d7 fix: resolve script spec audit errors主要處理內容如下:
統一 combat 腳本作者署名格式為
//作者:xxx同步 pathing JSON 的
info.nameinfo.name與檔案名稱 stem 一致。修正 README 大小寫
repo/js/ComputerBlower/readme.mdrepo/js/ComputerBlower/README.md補齊缺失的 JS README
repo/js/FollowsPet未自動建立空main.jsrepo/js/FollowsPet/TODO.md,提示維護者確認應補充有效 main.js、歸檔或移除該目錄。未處理項:
SCRIPT_SPEC_AUDIT_REPORT.md中的 WARNING 與 MANUAL_REVIEW 項未處理,符合本次只處理 ERROR 的範圍要求。測試:
git diff --cached --check通過。python3 tools/audit_script_specs.py . --report /tmp/SCRIPT_SPEC_AUDIT_REPORT_final2.md || true已執行,僅剩repo/js/FollowsPet缺 main.js,已轉人工確認。