Skip to content

Make seconds optional in Date-Time and Time#203

Merged
hukkin merged 4 commits intomasterfrom
no-seconds
Jan 10, 2026
Merged

Make seconds optional in Date-Time and Time#203
hukkin merged 4 commits intomasterfrom
no-seconds

Conversation

@hukkin
Copy link
Owner

@hukkin hukkin commented Aug 5, 2022

Update tests and merge when toml-lang/toml#894 makes it into a TOML release.

@hukkin hukkin marked this pull request as ready for review December 21, 2025 10:50
Copy link

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

gpshead pushed a commit to gpshead/tomli that referenced this pull request Dec 22, 2025
This adds new functions `loads_with_info()` and `load_with_info()` that
return a `ParseResult` containing:
- `data`: The parsed TOML data (same as before)
- `spec_version`: Minimum TOML spec version required ("1.0" or "1.1")
- `features`: Set of TOML 1.1 features used in the document

Currently detects the `\e` escape sequence (merged in PR hukkin#201) as a
TOML 1.1 feature. TODO comments mark where detection should be added
for pending TOML 1.1 features:
- `\xHH` hex escape (PR hukkin#202)
- Newlines/trailing commas in inline tables (PR hukkin#200)
- Optional seconds in datetime/time (PR hukkin#203)

The existing `loads()` and `load()` functions remain unchanged for
backward compatibility.

New public exports:
- `loads_with_info()`, `load_with_info()`: Parse with version info
- `ParseResult`: Frozen dataclass with parsing results
- `TOMLFeature`: Constants for TOML 1.1 feature identifiers

Addresses: hukkin#273
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (12314bd) to head (c47b51e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #203   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          530       532    +2     
  Branches        99        99           
=========================================
+ Hits           530       532    +2     

☔ View full report in Codecov by Sentry.
📢 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.

@hukkin hukkin merged commit 9eb2125 into master Jan 10, 2026
40 checks passed
@hukkin hukkin deleted the no-seconds branch January 10, 2026 19:15
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