Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 94.45% 97.56% +3.10%
==========================================
Files 1 8 +7
Lines 397 329 -68
==========================================
- Hits 375 321 -54
+ Misses 13 4 -9
+ Partials 9 4 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the ixdtf package’s RFC 9557 implementation by splitting the former monolithic implementation into focused, concern-oriented files while keeping the public API stable and redistributing/adding tests around the moved logic.
Changes:
- Split parsing/validation/formatting/timezone logic into dedicated files (
parse.go,suffix.go,validate.go,timezone.go,format.go, etc.). - Centralized public types and errors into
extensions.go,errors.go, and package documentation intodoc.go. - Replaced the monolithic
ixdtf.goand consolidated tests into targeted*_test.goand*_internal_test.gofiles.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| validate.go | Adds extension validation helpers (critical tag rules, strict tag value validation, timezone validation). |
| validate_test.go | Adds external tests for Validate behavior across strict/non-strict modes and extension/timezone cases. |
| validate_internal_test.go | Adds internal unit tests for validation helpers. |
| timezone.go | Adds timezone resolution + caching and consistency checking utilities. |
| timezone_internal_test.go | Adds internal tests for timezone consistency and numeric offset parsing helpers. |
| suffix.go | Adds suffix parsing enforcing RFC 9557 suffix grammar and critical annotation semantics. |
| suffix_internal_test.go | Adds internal tests for suffix parsing and suffix value validation. |
| parse.go | Reintroduces Parse/Validate as orchestrators over the split modules (suffix parsing + validation + consistency checks). |
| parse_test.go | Adds external tests for parsing behavior (critical zones, unknown local offset semantics, duplicates, etc.). |
| helpers_test.go | Adds shared test helpers extracted from the removed monolithic tests. |
| format.go | Adds formatting implementation + strict validation on output and suffix serialization. |
| format_test.go | Adds external tests for Format/FormatNano output and error behavior. |
| format_internal_test.go | Adds internal test for appendSuffix behavior. |
| extensions.go | Defines IXDTFExtensions and constructor helpers. |
| errors.go | Defines sentinel errors and ParseError type/wrapping behavior. |
| errors_test.go | Adds external tests for ParseError unwrapping via errors.Is. |
| errors_internal_test.go | Adds internal tests for ParseError.Error() formatting. |
| doc.go | Adds package-level documentation and keeps exported Layout constants centralized. |
| calendar.go | Adds registered tag key (u-ca) value validation logic. |
| calendar_test.go | Adds tests validating supported Unicode calendar identifiers. |
| ixdtf.go | Removes the old monolithic implementation after refactor. |
| ixdtf_test.go | Removes the old monolithic external test file after redistribution. |
| ixdtf_internal_test.go | Removes the old monolithic internal test file after redistribution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // IXDTF extends RFC 3339 by adding optional suffix elements for timezone names. | ||
| // and additional metadata while maintaining full backward compatibility. |
| // format validates the extensions and serializes the timestamp with its IXDTF | ||
| // suffix. Formatting always validates strictly: the producer of a string must | ||
| // only emit annotations it can process (RFC 9557 Section 3.3). |
Summary
Refactors the IXDTF implementation by splitting the former monolithic implementation into focused files for parsing, formatting, suffix handling, timezone resolution, validation, calendar tags, extensions, and errors.
This keeps the public package behavior organized around RFC 9557 concerns while preserving the API surface and adding focused test coverage for the moved logic.
Impact
ixdtf.go,ixdtf_test.go, andixdtf_internal_test.gofiles after their contents were redistributed.Validation
go test ./...