Add syntax highlight in README file.#115
Conversation
WalkthroughREADME.md formatting updated by converting generic code fences to Swift-specific fences and adding explicit Swift code examples. No changes to logic, APIs, or source code. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
README.md (4)
249-265: Option name inconsistency:.convertFromSnakeCasevs.fromSnakeCase.The code uses
.key(.convertFromSnakeCase)but the table lists.fromSnakeCase. Align the table to match the API.-| **Key Decoding** | `.fromSnakeCase` | snake_case → camelCase | +| **Key Decoding** | `.convertFromSnakeCase` | snake_case → camelCase |
513-531: Docs snippet won’t compile: typo and override keyword usage.
- Typo: “retrun” → “return”.
- Use
override class func(notoverride static func) to override aclass func.class BaseModel: SmartCodable { ... - class func mappingForKey() -> [SmartKeyTransformer]? { - retrun nil + class func mappingForKey() -> [SmartKeyTransformer]? { + return nil } } ... - override static func mappingForKey() -> [SmartKeyTransformer]? { + override class func mappingForKey() -> [SmartKeyTransformer]? { [ CodingKeys.age <--- "stu_age" ] }
679-705: Enum and transformer type corrections in associated‑value example.
- Enum case should match earlier usage:
woman(notwomen).- Avoid unrelated qualified type in
transformToJSONparameter.enum Sex: SmartAssociatedEnumerable { case man - case women + case woman case other(String) } ... - func transformToJSON(_ value: Introduce_8ViewController.Sex?) -> String? { + func transformToJSON(_ value: Sex?) -> String? { // do something }
559-582: Changeoverride static functooverride class funcand confirm mapping precedence.- override static func mappingForKey() -> [SmartKeyTransformer]? { + override class func mappingForKey() -> [SmartKeyTransformer]? { let trans = [ CodingKeys.age <--- "stu_age" ] … }
override static funcwon’t override the parent’sclass func—useoverride class funcinstead.- Verify that prepending subclass mappings (
trans + superTrans) yields the intended key-transformer priority.
🧹 Nitpick comments (1)
README.md (1)
445-464: Make the @SmartPublished sample compile by adding Combine context.The sample uses
sink/storebut lacksimport Combineand acancellablesset.import Combine var cancellables = Set<AnyCancellable>()Place the above near the sample to avoid copy‑paste errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(27 hunks)
🔇 Additional comments (2)
README.md (2)
159-167: LGTM — Swift fences improve readability and IDE copy‑paste.The added Swift code fences and examples look good.
Also applies to: 179-186, 190-196, 206-214, 272-280, 289-295, 313-328, 332-343, 347-362, 375-390, 398-411, 417-439, 470-483, 497-507, 535-549, 596-612, 621-635, 659-670, 714-730, 777-783, 788-789
149-153: SPM snippet: replace placeholder version
Replace"xxx"with the latest release and adopt.upToNextMajor:dependencies: [ - .package(url: "https://github.com/iAmMccc/SmartCodable.git", from: "xxx") + .package(url: "https://github.com/iAmMccc/SmartCodable.git", .upToNextMajor(from: "5.0.2")) ]
Summary by CodeRabbit