eb6ef0d7 fix: resolve script spec audit errors#3213
Open
crazysmile-PhD wants to merge 8 commits into
Open
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 檔案進行解析校驗,全部通過。
Contributor
|
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 |
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.
已根據 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,已轉人工確認。