Repository navigation
feat(cli): complete read formats from view profiles (#1844) - #2034
Conversation
Problem: #1844 requires read views and formats to come from view-profile metadata, but read --format still used an ad hoc static tuple even though read-view ids already came from SessionViewProfile.\n\nWhat changed: derive the read format choice set from READ_VIEW_PROFILES, add a read-format shell completer that narrows to the selected --view when present, and cover both direct Click metadata and bash/zsh/fish completion behavior. Regenerated the CLI reference for the changed option surface.\n\nVerification: nix develop --command devtools test tests/unit/cli/test_query_verbs_runtime.py -k 'read_format or read_view' passed 7 selected tests. nix develop --command devtools test tests/unit/cli/test_completion_matrix.py -k 'read_format or static_completers' passed 24 selected tests. nix develop --command devtools verify --quick passed.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe ChangesDynamic
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Problem: deriving read --format choices from SessionViewProfile.formats changed the generated read help output, and showcase-verify caught the stale help-read baseline in CI.\n\nWhat changed: refresh the committed help-read showcase baseline for the profile-derived format list.\n\nVerification: nix develop --command devtools lab-scenario verify-baselines passed. nix develop --command devtools verify --quick passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e27ac3399
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the showcase-baseline finding in commit 5ce405f: refreshed tests/baselines/showcase/help-read.txt and verified with |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Makes
read --formatchoices and shell completions come fromSessionViewProfile.formats, matching the existing profile-backedread --viewbehavior.Problem
#1844 says completion metadata should come from the parser/action/view registries rather than parallel lists.
read --viewalready usedREAD_VIEW_PROFILES, butread --formatstill used an ad hoc static tuple, so a view-profile format rename/add/delete could drift from the CLI option and shell completions.Solution
Derive the read format choice set from the union of
READ_VIEW_PROFILES[*].formats, add a read-format completer that narrows candidates to the selected--viewwhen available, and test both direct Click metadata and bash/zsh/fish completion behavior. The CLI reference was regenerated for the changed option surface.Verification
nix develop --command devtools test tests/unit/cli/test_query_verbs_runtime.py -k 'read_format or read_view'→ 7 passed, 16 deselectednix develop --command devtools test tests/unit/cli/test_completion_matrix.py -k 'read_format or static_completers'→ 24 passed, 64 deselectednix develop --command devtools verify --quick→ exit_code 0Ref #1844
Summary by CodeRabbit
New Features
read --formatnow intelligently filters available formats based on the selected--view.Documentation
readcommand, including plaintext and text options.