Skip to content

refactor IXDTF implementation by concern - #27

Merged
8beeeaaat merged 1 commit into
mainfrom
main-3
Jul 7, 2026
Merged

refactor IXDTF implementation by concern#27
8beeeaaat merged 1 commit into
mainfrom
main-3

Conversation

@8beeeaaat

Copy link
Copy Markdown
Owner

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

  • Improves maintainability by grouping RFC 9557 behavior by concern.
  • Adds targeted internal and external tests for parsing, formatting, validation, suffixes, timezones, calendar tags, and error wrapping.
  • Removes the old monolithic ixdtf.go, ixdtf_test.go, and ixdtf_internal_test.go files after their contents were redistributed.

Validation

  • go test ./...

@8beeeaaat 8beeeaaat changed the title [codex] refactor IXDTF implementation by concern refactor IXDTF implementation by concern Jul 7, 2026
@8beeeaaat 8beeeaaat self-assigned this Jul 7, 2026
@8beeeaaat
8beeeaaat marked this pull request as ready for review July 7, 2026 12:33
@8beeeaaat
8beeeaaat requested a review from Copilot July 7, 2026 12:33
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56839% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.56%. Comparing base (ebd7fe8) to head (617dfda).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
suffix.go 94.59% 2 Missing and 2 partials ⚠️
calendar.go 83.33% 1 Missing and 1 partial ⚠️
timezone.go 97.33% 1 Missing and 1 partial ⚠️
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.
📢 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.

@8beeeaaat
8beeeaaat merged commit f576c96 into main Jul 7, 2026
9 checks passed
@8beeeaaat
8beeeaaat deleted the main-3 branch July 7, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 into doc.go.
  • Replaced the monolithic ixdtf.go and consolidated tests into targeted *_test.go and *_internal_test.go files.

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.

Comment thread doc.go
Comment on lines +2 to +3
// IXDTF extends RFC 3339 by adding optional suffix elements for timezone names.
// and additional metadata while maintaining full backward compatibility.
Comment thread format.go
Comment on lines +24 to +26
// 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).
@8beeeaaat 8beeeaaat mentioned this pull request Jul 7, 2026
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