Skip to content

relative: accept hence after a relative time - #331

Merged
sylvestre merged 1 commit into
uutils:mainfrom
ddy314:fix/relative-hence
Sep 21, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
ddy314:fix/relative-hence

Conversation

@ddy314

@ddy314 ddy314 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Accept hence after a relative unit without reversing its sign, including fractional seconds. Tests cover case folding, signed and zero amounts, implicit amounts, ordinals, and invalid suffixes.

Refs uutils/coreutils#14683; coreutils will need a release/dependency update to receive this parser fix.

Validation: 416 tests and 2 doctests passed; Clippy and rustfmt passed.

AI-assisted with Codex.

Copilot AI lite review requested due to automatic review settings September 21, 2026 12:50
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (fdd87ce) to head (7dcf044).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
+ Coverage   97.47%   97.48%   +0.01%     
==========================================
  Files          21       21              
  Lines        4237     4258      +21     
  Branches      136      136              
==========================================
+ Hits         4130     4151      +21     
  Misses        106      106              
  Partials        1        1              
Flag Coverage Δ
macos_latest 97.48% <100.00%> (+0.01%) ⬆️
ubuntu_latest 97.48% <100.00%> (+0.01%) ⬆️
windows_latest 12.16% <24.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: 1 Low severity

Open (1)
What changed in this PR

This PR extends relative datetime parsing to accept hence as a future-oriented suffix while preserving explicit signs, including fractional seconds.

Changes:

  • Replaces the optional ago parser with a direction parser supporting both ago and hence.
  • Updates the relative-date grammar and README documentation.
  • Adds tests covering suffix case folding, signed and fractional amounts, implicit amounts, ordinals, and invalid suffixes.
File Description
src/​lib.rs Adds coverage for hence parsing and invalid suffixes.
src/​items/​relative.rs Parses ago and hence suffixes while applying the correct sign.
src/​items/​mod.rs Updates the relative-date grammar documentation.
README.md Documents hence as the future-relative suffix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/items/relative.rs
Comment on lines +88 to 90
direction,
)
.verify_map(|(sign, (sec, nsec), _, ago)| {
@sylvestre
sylvestre merged commit e25bf15 into uutils:main Sep 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants