Skip to content

Conversation

@johnnyt
Copy link
Member

@johnnyt johnnyt commented Sep 9, 2025

Adds 'ms' unit support throughout the duration pipeline with smart precision selection using pattern matching guards. Uses millisecond precision automatically when milliseconds are present, falls back to second precision otherwise.

Features:

  • New 'ms' unit support in lexer, parser, and evaluator
  • Duration.to_milliseconds/1 function for high-precision calculations
  • Pattern matching guards for automatic precision selection
  • Smart DateTime arithmetic (millisecond vs second precision)
  • Comprehensive test coverage with 89 new tests
  • Refactors evaluator to use Duration module functions (DRY)

Examples:

  • 500ms ago, 2s750ms from now
  • #2024-01-15T10:30:00.000Z# + 1s500ms
  • Automatic precision: ms > 0 triggers millisecond precision

🤖 Generated with Claude Code

Adds 'ms' unit support throughout the duration pipeline with smart
precision selection using pattern matching guards. Uses millisecond
precision automatically when milliseconds are present, falls back to
second precision otherwise.

Features:
- New 'ms' unit support in lexer, parser, and evaluator
- Duration.to_milliseconds/1 function for high-precision calculations
- Pattern matching guards for automatic precision selection
- Smart DateTime arithmetic (millisecond vs second precision)
- Comprehensive test coverage with 89 new tests
- Refactors evaluator to use Duration module functions (DRY)

Examples:
- 500ms ago, 2s750ms from now
- #2024-01-15T10:30:00.000Z# + 1s500ms
- Automatic precision: ms > 0 triggers millisecond precision

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/predicator/evaluator.ex 30.00% 7 Missing ⚠️
lib/predicator/lexer.ex 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
lib/predicator/duration.ex 100.00% <100.00%> (ø)
lib/predicator/types.ex 100.00% <ø> (ø)
lib/predicator/lexer.ex 96.77% <50.00%> (-0.45%) ⬇️
lib/predicator/evaluator.ex 88.27% <30.00%> (-2.29%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johnnyt johnnyt merged commit 3688a3e into main Sep 9, 2025
13 checks passed
@johnnyt johnnyt deleted the ms branch September 9, 2025 17:40
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.

2 participants