chore: use local rumdl version if exist#10
Conversation
Time Submission Status
Submit or update total time with: Add time on top of previous submission with: See available commands to help comply with our Guidelines. |
WalkthroughThe markdown-check composite action now conditionally installs Changesrumdl install and resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/actions/base/markdown-check/action.yml (2)
75-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffPackage-manager switch duplicated.
The pnpm/npm/bun branching here repeats the pattern already used elsewhere (e.g.
base/prettier,base/commit-check). Not blocking, but worth extracting to a shared script/composite step if this pattern grows further.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/actions/base/markdown-check/action.yml around lines 75 - 99, The pnpm/npm/bun branching in the markdown-check action is duplicated across the install steps and should be consolidated. Update the Install dependencies and Install rumdl (fallback) logic in action.yml to reuse the same package-manager handling pattern already used by the shared base actions, preferably by extracting it into a shared script or composite step so the branching is defined once and reused.
63-73: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winNaive grep can false-positive on non-dependency fields.
grep -q '"rumdl"' package.jsonmatches any quoted occurrence ofrumdl, including e.g. a"keywords": ["rumdl"]entry, not just an actual dependency declaration. A false positive routes to the full-deps install path unnecessarily (harmless but wasteful), while a false negative (rumdl declared but not matched due to formatting) silently falls back to global install, diverging from the pinned version — defeating the PR's goal.Prefer a structured check via
nodeorjqagainstdependencies/devDependencieskeys specifically.♻️ Proposed fix using node (no extra dependency needed in most runners)
- if [ -f package.json ] && grep -q '"rumdl"' package.json; then + if [ -f package.json ] && node -e ' + const pkg = require("./package.json"); + const deps = { ...pkg.dependencies, ...pkg.devDependencies }; + process.exit(deps.rumdl ? 0 : 1); + ' 2>/dev/null; then echo "has-rumdl=true" >> "$GITHUB_OUTPUT"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/actions/base/markdown-check/action.yml around lines 63 - 73, The rumdl detection step in the markdown-check action is using a raw grep on package.json, which can match unrelated fields and miss real dependency declarations. Update the check in the Detect rumdl in package.json step to use a structured lookup with node or jq against the dependencies/devDependencies entries in package.json, and keep the has-rumdl output tied only to an actual package dependency.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ACTIONS.md`:
- Around line 83-85: The ACTIONS.md entry has Markdown lines that exceed the
repo’s 80-character limit, triggering MD013. Reflow the three bullet points in
this section so they wrap cleanly under 80 characters while keeping the same
meaning, and preserve the wording around rumdl, package.json, and
./node_modules/.bin/rumdl.
---
Nitpick comments:
In @.github/actions/base/markdown-check/action.yml:
- Around line 75-99: The pnpm/npm/bun branching in the markdown-check action is
duplicated across the install steps and should be consolidated. Update the
Install dependencies and Install rumdl (fallback) logic in action.yml to reuse
the same package-manager handling pattern already used by the shared base
actions, preferably by extracting it into a shared script or composite step so
the branching is defined once and reused.
- Around line 63-73: The rumdl detection step in the markdown-check action is
using a raw grep on package.json, which can match unrelated fields and miss real
dependency declarations. Update the check in the Detect rumdl in package.json
step to use a structured lookup with node or jq against the
dependencies/devDependencies entries in package.json, and keep the has-rumdl
output tied only to an actual package dependency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5058dadf-219f-48e6-935c-5eb8bfd45c6f
📒 Files selected for processing (2)
.github/actions/base/markdown-check/action.ymlACTIONS.md
|
@holdex pr submit-time 30m |
|
@holdex pr submit-time 5m |
resolves #9
Summary by CodeRabbit