fix: show "No ADRs found" fallback in adr-list#136
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesADR List Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
SecKatie
left a comment
There was a problem hiding this comment.
Seems to work and the code looks good to me.
1323fc8 to
9fedc01
Compare
…exist The previous recipe relied on a pipeline of `ls | grep | sort` to decide whether to fall back. When grep matched nothing it exited 1, but `sort` of empty input exits 0, so the pipeline succeeded and the `||` branch never fired — leaving `make adr-list` silent. Capture the filtered list into a variable and branch on whether it's empty instead. Fixes #135 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9fedc01 to
5931027
Compare
|
I'm planning to drop Let's place these changes here on hold, we'll rejoin when we have it set from PR 109 |
Summary
make adr-listwas silent whendocs/adr/contained no numbered ADRs (onlyREADME.mdandtemplate.md). Neither the list nor the "No ADRs found" fallback printed.ls | grep | sortpipeline exit codes. Whengrepmatched nothing it exited 1, butsortof empty input exits 0, so the pipeline succeeded and the||fallback never fired. (Shell precedence also tied the||to the whole pipeline rather than to thecd.)Fixes #135
Test plan
make adr-listwith onlyREADME.md+template.mdpresent → prints "No ADRs found…"make adr-listwith numbered ADRs present → prints sorted listmake adr-listwithdocs/adr/missing → prints "No ADRs found…"🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes