Repository navigation
feat: add TypeScript stub detector script and pre-commit hook [OMN-5598] - #80
Conversation
Create a grep-based TS/JS stub detector that flags forbidden `// stub:` comments while allowing `// stub-ok:` and `// intentional-skip:` escape hatches. Includes 12-case test suite covering case variations, allowed markers, non-TS files, and node_modules exclusion. Export as `check-ts-stubs` pre-commit hook for downstream repos.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA new pre-commit hook and accompanying Bash script have been added to detect forbidden stub markers in TypeScript and JavaScript files. The implementation includes a bash script that filters files by extension, searches for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
OMN-11497: - Update dod-product-pr-79 receipt to final SHA 763ed90 (mypy fix) - Update contract to reflect final SHA OMN-11502 (new): - Add contract for rich terminal display module (PR #80) - dod-product-pr-80: PR #80 head SHA 8f4827c - dod-unit-tests: full suite pass - dod-occ-self: self-binding to OCC PR #1312 Closes OMN-11497, OMN-11502
* docs(OMN-11497): bind ToolRegistry evidence — PR #79 receipts - contracts/OMN-11497.yaml: contract for in-process ToolRegistry ticket - drift/dod_receipts/OMN-11497/dod-product-pr-79: PR #79 head SHA db84543 - drift/dod_receipts/OMN-11497/dod-unit-tests: 12 tool registry tests pass, 616 total - drift/dod_receipts/OMN-11497/dod-occ-self: self-binding receipt Addresses CodeRabbit review: restricted exec globals + ThreadPoolExecutor timeout. Closes OMN-11497 * docs(OMN-11497): update self-binding receipt with OCC PR #1312 SHA * docs(OMN-11497,OMN-11502): update PR #79 receipt + add PR #80 evidence OMN-11497: - Update dod-product-pr-79 receipt to final SHA 763ed90 (mypy fix) - Update contract to reflect final SHA OMN-11502 (new): - Add contract for rich terminal display module (PR #80) - dod-product-pr-80: PR #80 head SHA 8f4827c - dod-unit-tests: full suite pass - dod-occ-self: self-binding to OCC PR #1312 Closes OMN-11497, OMN-11502 * docs(OMN-11497,OMN-11502): fix receipt schema validation errors - OMN-11497 dod-unit-tests: remove extra "12 passed: true" field (extra_forbidden) - OMN-11497 dod-unit-tests: update commit_sha to final SHA 763ed90 - OMN-11502 dod-unit-tests: add required probe_command + probe_stdout fields - OMN-11502 dod-occ-self: fix commit_sha (was "PENDING"), add probe_command + probe_stdout All 6 receipts validate against ModelDodReceipt schema. Closes OMN-11497, OMN-11502 * fix(OMN-11497,OMN-11502): add contract_sha256 to all receipts (OMN-10421 requirement) Receipts produced after 2026-04-30 must record the contract hash. Added sha256 fingerprint of OMN-11497.yaml and OMN-11502.yaml to all six dod_receipt files for these two tickets.
Summary
scripts/check_ts_stubs.sh-- grep-based TS/JS stub detectortests/test_check_ts_stubs.sh)check-ts-stubspre-commit hook in.pre-commit-hooks.yamlContext
Part of epic OMN-5597 (Stub Remediation and CI Prevention). This script detects forbidden
// stub:markers in TypeScript/JavaScript files while allowing// stub-ok: <reason>and// intentional-skip: <reason>escape hatches. Downstream repos (omnidash) will consume this hook.Test plan
Summary by CodeRabbit
New Features
Tests