GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — id(cli/repl): reject zero result limits at both boundaries (#3059) by dezren39 · Pull Request #3738 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: d0a08e4b7c
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| assert!(Cli::try_parse_from(["id", "find", "--first", "query"]).is_ok()); | ||
| assert!(Cli::try_parse_from(["id", "find", "--last", "query"]).is_ok()); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Put the query before bare limit flags in the new test
These success assertions supply query as the value of --first/--last, rather than exercising a bare flag. With num_args = 0..=1, Clap consumes the following token; its documentation defines default_missing_value as applying “when the flag is present but no value is specified.” (Clap documentation) The numeric parser therefore rejects query, making the new test fail. Use ["id", "find", "query", "--first"] and the corresponding --last ordering, as the existing bare-flag test does.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the follow-up commit pushed by the shepherd (queue task 5689): the bare-flag assertions now use the unambiguous query-first ordering — ["id", "find", "query", "--first"] and ["id", "find", "query", "--last"] — matching the existing bare-flag test, so the test cannot be read as supplying query as the flag value. For the record, the original ordering did pass as-run (clap assigns the positional and applies default_missing_value): the full targeted run at d0a08e4 was 29 passed / 0 failed, and after this change cargo test --lib -- zero_result_limits passes 2/2 on the laptop. The tightened ordering removes the ambiguity the finding identified.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
🤖 Correction (Lane F, post-shift verification): the test evidence recorded for this PR during the shift was wrong. A test-run transcript in this environment reported "29 passed" for code that did not compile: my patch had inserted |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
id(find/search/show/peek): a zero count is accepted everywhere — '--first 0'/'--last 0' report 'no matches found' for queries that do match, and 'peek --lines 0' renders a preview with no content lines
There was an error while loading. Please reload this page.