fix(scripts): detect stale contributor doc references - #1531
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe instruction checker extracts CommonMark and MDX code spans, validates contributor-document path and package claims, and builds repository snapshots through an exported ChangesContributor claim validation
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change extends contributor-document checks to catch stale path and package references; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant CLI
participant scan
participant analyse
participant ContributorDocs
participant RepositorySnapshot
CLI->>scan: scan repository root
scan->>ContributorDocs: read contributor Markdown and MDX
scan-->>CLI: return Snapshot
CLI->>analyse: validate Snapshot
analyse->>RepositorySnapshot: resolve paths and packages
RepositorySnapshot-->>analyse: return stale claims
analyse-->>CLI: report validation results
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes extend the existing instructions gate, validate contributor-document paths and npm packages, reuse Markdown parsing, ignore fenced code, add parsing and rule tests, and update the required dependencies. The implementation matches the requirements in issue Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
742fadf to
e9cec8d
Compare
📚 Documentation Preview
|
Description
Contributor docs can keep naming deleted repository paths or removed npm dependencies because inline code still renders normally. This extends the existing
check:instructionsgate to validate path- and package-shaped inline code indocs/contributor/**/*.{md,mdx}and root-level*.mdagainst the working tree and workspace manifests.Note
Bare npm names are indistinguishable from ordinary identifiers without context, so the gate checks scoped names and recognizable package-shaped names rather than treating every inline-code word as a dependency.
Fixes #1499
How to test
Manual smoke test:
`scripts/does-not-exist.ts`to a contributor document.pnpm run check:instructionsand verify the error identifies both the document and missing path.Summary by CodeRabbit
New Features
Bug Fixes
Tests