fix(skills): CodeQL code-quality — missing comma, empty except, unused import - #107
fix(skills): CodeQL code-quality — missing comma, empty except, unused import#107risleylima wants to merge 1 commit into
Conversation
Add the missing list comma to avoid implicit string concatenation, document intentional empty except clauses, and drop unused sys import. Fixes bmad-code-org#106. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
WalkthroughThe changes address CodeQL quality findings across builder skills. They add comments for intentional exception handling, preserve generated output, remove an unused import, and leave runtime behavior unchanged. ChangesCode quality cleanup
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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
🤖 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 `@skills/bmad-agent-builder/assets/init-sanctum-template.py`:
- Line 170: Update the Tools guidance entries in the generated lines list so the
fragments ending with “wrote” and beginning with “and saved” remain one list
element without relying on implicit string concatenation. Preserve the resulting
single-line output when "\n".join(lines) generates CAPABILITIES.md.
🪄 Autofix
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 Plus
Run ID: 20b0551e-188f-4e5a-8f6e-3c9fdb8f1c5b
📒 Files selected for processing (5)
skills/bmad-agent-builder/assets/init-sanctum-template.pyskills/bmad-agent-builder/scripts/render_report.pyskills/bmad-module-builder/scripts/scaffold-standalone-module.pyskills/bmad-workflow-builder/scripts/render_report.pyskills/bmad-workflow-builder/scripts/tests/test_canon_sync.py
💤 Files with no reviewable changes (1)
- skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py
| "## Tools", | ||
| "", | ||
| "Prefer crafting your own tools over depending on external ones. A script you wrote " | ||
| "Prefer crafting your own tools over depending on external ones. A script you wrote ", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep the Tools guidance as one generated line.
The comma on Line 170 makes Line 171 a separate lines element. "\n".join(lines) inserts a newline between wrote and and saved, which changes the generated CAPABILITIES.md content.
Keep both fragments in one list element while avoiding implicit string concatenation.
Proposed fix
- "Prefer crafting your own tools over depending on external ones. A script you wrote ",
- "and saved is more reliable than an external API. Use the file system creatively.",
+ (
+ "Prefer crafting your own tools over depending on external ones. "
+ + "A script you wrote and saved is more reliable than an external API. "
+ + "Use the file system creatively."
+ ),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "Prefer crafting your own tools over depending on external ones. A script you wrote ", | |
| ( | |
| "Prefer crafting your own tools over depending on external ones. " | |
| "A script you wrote and saved is more reliable than an external API. " | |
| "Use the file system creatively." | |
| ), |
🤖 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 `@skills/bmad-agent-builder/assets/init-sanctum-template.py` at line 170,
Update the Tools guidance entries in the generated lines list so the fragments
ending with “wrote” and beginning with “and saved” remain one list element
without relying on implicit string concatenation. Preserve the resulting
single-line output when "\n".join(lines) generates CAPABILITIES.md.
Summary
Fixes #106. Clears the five GitHub Code Quality (CodeQL) findings that consumer repos inherit after installing BMad Builder skills under
.agents/skills.What was wrong
1. Implicit string concatenation in a list (
py/implicit-string-concatenation-in-list) — warningFile:
skills/bmad-agent-builder/assets/init-sanctum-template.pyInside
lines.extend([...]), two adjacent string literals sat next to each other without a comma:In a Python list/tuple display, that is implicit concatenation (one list element), which CodeQL flags because it usually means a missing comma between list items.
Fix: add the comma after the first string so they are two list elements (joined later by
"\n".join(lines)):2. Empty
exceptwithout comment (py/empty-except) — note ×3CodeQL requires an explanatory comment when an
exceptbody is onlypass.bmad-module-builder/scripts/scaffold-standalone-module.pymodule.yamlmetadata is optional; keep marketplace defaults if unreadablebmad-*-builder/scripts/render_report.py(agent + workflow copies)Fix: keep behavior; add one-line comments documenting the intentional swallow.
3. Unused import (
py/unused-import) — noteFile:
skills/bmad-workflow-builder/scripts/tests/test_canon_sync.pyimport syswas never used (__main__only prints and asserts).Fix: remove the import.
Test plan
generate_capabilities_mdTools section still renders as two consecutive lines after"\n".joinpython3 skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py(self-check) still passes when canon copies are presentNotes
These issues were byte-identical on
main/v2.1.0; a BMAD quick-update alone would not have cleared them without this source fix.Made with Cursor
Summary by CodeRabbit
Documentation
Chores