docs(sort): keep the binary name out of per-argument help - #670
Conversation
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
WalkthroughThe ChangesSort command help
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #670 +/- ##
==========================================
- Coverage 93.96% 93.94% -0.03%
==========================================
Files 178 178
Lines 108043 108058 +15
==========================================
- Hits 101528 101517 -11
- Misses 6515 6541 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 57 minutes. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
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/lib/commands/sort.rs`:
- Around line 741-744: Update the assertion in the per-argument help test to
detect `fgumi` as a standalone token using token-boundary matching, including
when followed by punctuation or end-of-string. Preserve the existing failure
message and ensure binary-name occurrences embedded within larger words are not
rejected.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: ba5c4140-6862-4157-83ac-f758f942184a
📒 Files selected for processing (1)
src/lib/commands/sort.rs
|
@coderabbitai pause |
✅ Action performedReviews paused. |
`Sort` is pulled into other binaries with `#[command(flatten)]`, so its
per-argument help renders under a program name that is not `fgumi`. The
`--sort-threads` help embedded a worked
`bwa mem -t 32 ... | fgumi sort -@ 8 --sort-threads 4` pipeline, which
tells those users to run a command they do not have. It was also the only
per-argument doc carrying a concrete invocation; every other one already
lives in the command-level EXAMPLES block.
Move the pipeline to EXAMPLES and leave the flag help describing the
flag. The replacement also states why the merge can stay wide -- it
cannot start until the input is exhausted, by which point the producer
has finished writing -- which the previous "the merge does not" left
implicit. `enter_output_phase` is called exactly once, immediately after
ingest completes, so that holds for every sort path.
`--order` had a milder version of the same thing ("fgumi emits
`queryname:lexicographical` in @hd SS"); it is now written passively,
which stays true of any binary embedding the engine.
A new test walks every argument's help and rejects the binary name so
this cannot creep back. The match is on identifier-shaped tokens rather
than the literal `"fgumi "`, so a trailing, backticked, or punctuated
mention is caught too, while `fgumidocs` and `fgumi_sort` are not.
Command-level `long_about` is deliberately exempt and is not walked: a
wrapper replaces it wholesale, so it remains the right home for worked
`fgumi sort` invocations.
3840bf9 to
b16ace6
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Sortis designed to be pulled into other binaries with#[command(flatten)], which means its per-argument help renders under a program name that is notfgumi. So a concretefgumi ...invocation in per-argument help tells those users to run a command they do not have.--sort-threads(added in #608) was doing exactly that:It was also the only per-argument doc in
Sortcarrying a concrete invocation — every other one already lives in the command-level EXAMPLES block. So this is a consistency fix rather than a special case.What changed
The pipeline example moves to EXAMPLES, alongside the other twelve invocations:
The flag help now describes the flag, and states the mechanism the old text left implicit (
the merge does not):That rationale is checked against the engine, not assumed:
RawExternalSorter::enter_output_phaseis called "exactly once, immediately after ingest completes," so it holds on every sort path, not just the spilling one.--orderhad a milder version of the same thing —`queryname::lexicographical` Alias; fgumi emits `queryname:lexicographical` in @HD SS— now written passively (Alias; written as ...). Same information, and it stays true of any binary embedding the engine.Regression guard
test_arg_help_does_not_name_the_binarywalks every argument's short and long help and rejects the binary name, so this cannot creep back in. It asserts a non-trivial arg count first, so an empty walk cannot pass vacuously.I confirmed the test has teeth by temporarily reintroducing
fgumi sortinto the--sort-threadshelp: it fails and names the offending flag.What is deliberately left alone
The command-level
long_aboutstill contains manyfgumi sortinvocations, and the test does not walk it. A wrapper replaceslong_aboutwholesale, so it never reaches a downstream--help— which makes it the correct home for worked invocations. The exemption is documented on the test so the asymmetry reads as a decision rather than an oversight.Verification
Docs-only change to user-facing help text plus one new test; no behavior change.
grep -rn sort-threads docs/is empty, so there is no mdbook copy of this text to keep in sync.Motivation
Surfaced while bumping the downstream
makosorter (a thinSort-flattening wrapper) to fgumi 0.5.0:mako --helpbegan advertising afgumi sortinvocation. Before this change its--helpcontained one such invocation; after, none — every remaining mention is inlong_about, whichmakoreplaces.Summary by CodeRabbit
Documentation
sortcommand help text with clearer examples and improved wording for--orderand--sort-threadsoptions.Tests