Repository navigation
feat(driver): one subcommand per translation unit - #539
Merged
Merged
Conversation
src/driver/ holds one .cc per clice subcommand; each registers its deco command with the root SubCommander through an add_* builder, and clice.cc shrinks to collection and registration. index and doc join as new stub subcommands alongside lint and format; stubs explain themselves on stderr and exit non-zero. A CLI surface test pins the registration, help paths, stub messages and exit codes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesCLI driver extraction
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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 |
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 `@src/driver/driver.h`:
- Around line 28-33: Update apply_log_level to create a lowercased copy of
level_str and compare that normalized value with "off" when detecting unknown
levels. Preserve the parser’s mixed-case acceptance while keeping the existing
error message’s accepted names aligned with spdlog::level::from_str.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 50e92f55-4b43-4495-be9f-c1eab867b55a
📒 Files selected for processing (11)
CMakeLists.txtsrc/clice.ccsrc/driver/doc.ccsrc/driver/driver.hsrc/driver/format.ccsrc/driver/index.ccsrc/driver/lint.ccsrc/driver/query.ccsrc/driver/serve.ccsrc/driver/worker.cctests/integration/lifecycle/test_subcommands.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Upcoming features (
clice lintwith cross-TU caching, ahead-of-time indexing, documentation data generation) are all CLI applications over the same core, but the CLI surface lived as one monolithicclice.cc. This PR gives every subcommand its own home before those features land.What
src/driver/holds one translation unit per subcommand:serve,query,worker, plus new stubsindex,doc,lint,format. Each file owns its options struct and registers a deco command with the rootSubCommanderthrough anadd_*builder.clice.ccshrinks to collection and registration (206 → ~60 lines). Behavior parity everywhere: dispatch,--version, root/per-command--help, missing/unknown subcommand handling, worker defaults, query port validation.SubCommander(owning overload); help re-constructs a fresh command for usage printing, so no closure captures a moved-from object.tests/integration/lifecycle/test_subcommands.pypins the whole surface: all seven names registered in root usage, stub messages and exit codes, per-command help, unknown-subcommand failure.Tests