RFC 5545 compliance: parsing, formatting, and tests#4
Open
craigk wants to merge 3 commits intokubens:mainfrom
Open
RFC 5545 compliance: parsing, formatting, and tests#4craigk wants to merge 3 commits intokubens:mainfrom
craigk wants to merge 3 commits intokubens:mainfrom
Conversation
…lding - Parse rule part names and enum values case-insensitively (FREQ, BYDAY, etc.). - Accept rule parts in any order; require exactly one FREQ (exact key match). - Unfold content lines on parse (CRLF/LF + SPACE/HTAB removed). - Add optional foldLongLines and emitWKST to format style; fold at 75 octets when enabled. - Parse and accept WKST (not persisted); optional WKST=MO on format. - BYSECOND 0–60 (leap second), UNTIL hour 24 normalized to next day 00:00. - Replace force unwraps in buffer resize and date components with guards/nil-coalescing.
Parse tests: - Case-insensitivity (freq=daily, mixed-case key/value). - Rule part order (COUNT=5;FREQ=DAILY parses). - FREQUENCY vs FREQ (exact key), SECONDLY throws, duplicate keys throw. - WKST accepted, content-line unfolding (CRLF and LF), BYSECOND=60. - Error contract: parse failure throws NSError with NSCocoaErrorDomain and formatting code. - Parse via RecurrenceRule(strategy:) (ParseStrategy API). Format tests: - foldLongLines (no line >75 octets), emitWKST and default no WKST. - Large-rule format with semantic substring checks (not just length). - Format via rule.formatted(style) (FormatStyle API). - Replace force unwraps with #require in UNTIL format tests. Round-trip tests: - Parse → format → parse (simple, UNTIL date, UNTIL UTC, UNTIL TZID, multiple BY*). - Format → parse → format (simple rule, rule with UNTIL and BYDAY). - TZID round-trip with same calendar (America/New_York).
DocC: - Update ParsingRFC5545 and FormattingRFC5545 with new options and rules. - Link from main Documentation to parsing/formatting topics. README: - Add "Key RFC 5545 parsing rules" (any order, case-insensitivity, folding, WKST, no SECONDLY). - Add "Add-ons" section (placeholder or link to interop). - Add "Enforced Rules" and expand Limitations (errata). - Update Testing list (round-trip, large-rule semantic checks).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
great project. Thank you for sharing.
I make some enhancements to align tighter to the RFC implementation because I needed to interoperate with another rrule package https://github.com/jkbrzt/rrule
All of my changes include test coverage
Let me know if you requires upstream changes to merge it into the mainline.
Changelog
Parsing (RFC 5545–aligned)
Formatting
Safety
Tests
Docs