Conversation
oech3
reviewed
Sep 21, 2026
| { | ||
| return Err(UUsageError::new(1, translate!("date-error-print-and-set"))); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Is it able to do same things by clap's confliction? Patching error message of GnuTetst is allowed if needed.
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: None
What changed in this PR
Rejects combining --set with date-printing options before date parsing or file access, with coverage for both argument orders.
Changes:
- Adds early conflict validation in
date.rsfor--setwith--date,--file,--reference, or--resolution. - Adds a localized error message for the invalid combination.
- Adds tests covering all four conflicts in both option orders.
| File | Description |
|---|---|
src/uu/date/src/date.rs |
Performs early validation of incompatible options. |
src/uu/date/locales/en-US.ftl |
Adds the conflict error message. |
tests/by-util/test_date.rs |
Tests conflict handling and argument ordering. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
GNU testsuite comparison: |
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.
Reject --set combined with --date, --file, --reference or --resolution before parsing dates or accessing files. Test both argument orders using invalid set input so the tests cannot change the clock.
Fixes #14674.
Validation: 164 date tests passed, 7 ignored; Clippy and rustfmt passed.
AI-assisted with Codex.