Skip to content

Add syntax highlight in README file.#115

Merged
iAmMccc merged 2 commits into
iAmMccc:mainfrom
vsouza:chore/add-sintax-highlight-readme
Oct 9, 2025
Merged

Add syntax highlight in README file.#115
iAmMccc merged 2 commits into
iAmMccc:mainfrom
vsouza:chore/add-sintax-highlight-readme

Conversation

@vsouza
Copy link
Copy Markdown

@vsouza vsouza commented Sep 29, 2025

Summary by CodeRabbit

  • Documentation
    • Improved readability with Swift-specific syntax highlighting for all code samples.
    • Added clearer, step-by-step Swift examples covering setup and common usage patterns.
    • Clarified instructions and expanded examples to reduce ambiguity for Swift developers.
    • Presentation-only updates; no changes to APIs, behavior, or functionality.
    • Enhances onboarding by making examples more consistent and easier to follow.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 29, 2025

Walkthrough

README.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

Cohort / File(s) Summary
Docs: Swift code fence updates
README.md
Converted code blocks to ```swift fences and expanded Swift examples; presentation-only documentation edits.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A nibble of docs, a hop through code,
I paint my fences “swift” down the road.
No APIs moved, no logic to tweak—
Just clearer carrots for readers to peek.
Thump-thump! The README gleams anew,
A bunny’s brush with syntax hue. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “Add syntax highlight in README file.” succinctly and accurately summarizes the core change of converting code blocks to Swift-specific fences and enhancing examples for syntax highlighting, making it clear and specific without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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: .convertFromSnakeCase vs .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 (not override static func) to override a class 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 (not women).
  • Avoid unrelated qualified type in transformToJSON parameter.
 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: Change override static func to override class func and confirm mapping precedence.

-    override static func mappingForKey() -> [SmartKeyTransformer]? {
+    override class func mappingForKey() -> [SmartKeyTransformer]? {
         let trans = [ CodingKeys.age <--- "stu_age" ]
         …
     }
  • override static func won’t override the parent’s class func—use override class func instead.
  • 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/store but lacks import Combine and a cancellables set.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 95b574f and 73a4015.

📒 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"))
]

@iAmMccc iAmMccc merged commit f2b7cc0 into iAmMccc:main Oct 9, 2025
1 check passed
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