Repository navigation
refactor(scripts): extract nitpick display logic into separate function - #30
Conversation
Refactor submit-pr.sh to improve code organization by extracting nitpick handling into dedicated functions. This makes the script more maintainable and enables consistent nitpick display across different exit paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
📝 WalkthroughWalkthroughAdds two new functions to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2026-01-03T11:38:30.208ZApplied to files:
📚 Learning: 2026-01-04T18:35:42.314ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Comment |
Deploying living-architecture with
|
| Latest commit: |
54657fc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://63b8ab88.living-architecture.pages.dev |
| Branch Preview URL: | https://fix-submit-pr-nitpicks.living-architecture.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
scripts/submit-pr.sh (2)
141-155: Well-structured helper function.The implementation is clean with proper null/zero checking and clear formatting. The advisory message at line 153 provides helpful guidance to users.
Minor note: There's potential for code sharing with
check-coderabbit-review.sh, which has an identicalget_latest_review_bodyfunction (lines 55-58). If these scripts evolve together, consider extracting shared functions to a common utilities file.
100-115: Expand HTML entity handling in the nitpick extraction function.The sed-based parsing works with CodeRabbit's current format but relies on specific HTML structure. Consider extending entity handling beyond
to cover other common HTML entities that may appear in review content:🔎 Suggested improvements for HTML entity handling
if [[ -n "$review_body" ]]; then # Extract content between 🧹 Nitpick comments section # The format is: <summary>🧹 Nitpick comments (N)</summary><blockquote>...content...</blockquote></details> echo "$review_body" | sed -n '/🧹 Nitpick comments/,/<\/details>/p' | \ sed 's/<[^>]*>//g' | \ - sed 's/ / /g' | \ + sed 's/ / /g; s/</</g; s/>/>/g; s/&/\&/g; s/"/"/g' | \ grep -v "^$" | \ grep -v "🧹 Nitpick comments" fiThis ensures code snippets, markdown, and other special characters in nitpick content are properly decoded.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/submit-pr.sh
🧰 Additional context used
🧬 Code graph analysis (1)
scripts/submit-pr.sh (1)
scripts/check-coderabbit-review.sh (1)
get_latest_review_body(56-59)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
scripts/submit-pr.sh (2)
117-139: Clean refactoring to single responsibility.The function now focuses solely on inline comments and actionable count, with nitpick handling properly extracted to
show_nitpicks. The early closure of the conditional at line 138 is correct.
243-243: Excellent integration across all code paths.The
show_nitpicksfunction is correctly wired into all three exit scenarios:
- Changes requested (line 243)
- Success with no changes requested (line 257)
- CI failure (line 264)
This ensures consistent nitpick display regardless of the PR outcome, which improves the user experience and maintainability.
Also applies to: 257-257, 261-269
Sub-agent was summarizing script output instead of passing through the raw output. This caused nitpicks and other details to be lost. Made instructions explicit: use <raw-output> tags and "do not summarize". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|



Refactor submit-pr.sh to improve code organization by extracting nitpick handling into dedicated functions. This makes the script more maintainable and enables consistent nitpick display across different exit paths.
Summary by CodeRabbit
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.