UIViewKit icon indicating copy to clipboard operation
UIViewKit copied to clipboard

Rename result builders to @UIViewBuilder and @AutoLayoutBuilder

Open Adobels opened this issue 1 month ago • 7 comments

New names @UIViewBuilder and @AutoLayoutBuilder, follow the conventions used by SwiftUI builders, such as @ViewBuilder. They are easier to remember and reason about.

Summary by CodeRabbit

  • Refactor
    • Streamlined internal builder naming conventions across the UIViewKit framework for enhanced code consistency and improved architectural clarity.

Adobels avatar Nov 07 '25 03:11 Adobels

[!NOTE]

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

This PR renames result builder enums and updates their usages across UIViewDSL files. IBArrayOfNSLayoutConstraintBuilder becomes AutoLayoutBuilder and IBArrayOfUIViewBuilder becomes UIViewBuilder. All function signatures, logic, and behavior remain unchanged.

Changes

Cohort / File(s) Summary
Result Builder Enum Definitions
Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift, Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift
Renamed public enums: IBArrayOfNSLayoutConstraintBuilderAutoLayoutBuilder and IBArrayOfUIViewBuilderUIViewBuilder. Updated file header comments. buildBlock signatures remain identical.
Builder Usage Updates
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift, Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift, Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift
Updated method parameter attributes from old builder names to new ones: @IBArrayOfNSLayoutConstraintBuilder@AutoLayoutBuilder and @IBArrayOfUIViewBuilder@UIViewBuilder. Method signatures, return types, and logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward, homogeneous refactoring with consistent naming patterns across files
  • No logic changes, behavioral modifications, or control flow alterations
  • Primarily identifier/attribute replacements with predictable scope

Poem

🐰 The builders had their names refined,
From old to new, a cleaner find,
AutoLayout and UIView now shine,
No logic changed—just signs align! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately describes the main changes: renaming the result builders from IBArrayOfNSLayoutConstraintBuilder to AutoLayoutBuilder and from IBArrayOfUIViewBuilder to UIViewBuilder across multiple files.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch develop

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b7882699c76d9e56f5c5b04edff1e8a785ca629 and 0070ba6a4f95f1e0a518d721820bb44744527d3e.

📒 Files selected for processing (5)
  • Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift (2 hunks)
  • Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift (2 hunks)
  • Sources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift (1 hunks)
  • Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift (1 hunks)
  • Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift (1)
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBArrayOfNSLayoutConstraintBuilder.swift (1)
  • buildBlock (10-44)
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift (1)
Sources/UIViewKit/UIViewDSL/UIViewDSL+Engine.swift (3)
  • addSubviews (25-29)
  • addSubviews (31-35)
  • addSubviews (73-83)
🔇 Additional comments (5)
Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift (1)

2-2: LGTM! Clear naming improvement.

The rename from IBArrayOfNSLayoutConstraintBuilder to AutoLayoutBuilder follows SwiftUI conventions and is much more concise and memorable.

Also applies to: 11-11

Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift (1)

2-2: LGTM! Excellent naming improvement.

The rename from IBArrayOfUIViewBuilder to UIViewBuilder is significantly clearer and aligns perfectly with SwiftUI's @ViewBuilder pattern.

Also applies to: 11-11

Sources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift (1)

13-13: LGTM! Usage updated correctly.

The builder attribute has been updated to use the new @AutoLayoutBuilder name, maintaining consistency with the renamed builder type.

Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift (1)

12-12: LGTM! Usage updated correctly.

The builder attribute has been updated to use the new @AutoLayoutBuilder name, maintaining consistency with the renamed builder type.

Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift (1)

13-13: LGTM! Both overloads updated correctly.

The builder attribute has been updated to use the new @UIViewBuilder name in both ibSubviews overloads, maintaining consistency with the renamed builder type.

Also applies to: 19-19


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.

coderabbitai[bot] avatar Nov 07 '25 03:11 coderabbitai[bot]

@coderabbitai help

Adobels avatar Nov 07 '25 03:11 Adobels

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Nov 07 '25 03:11 coderabbitai[bot]

@coderabbitai pause

Adobels avatar Nov 07 '25 03:11 Adobels

@coderabbitai ignore

Adobels avatar Nov 07 '25 03:11 Adobels

✅ Actions performed

Reviews paused.

coderabbitai[bot] avatar Nov 07 '25 03:11 coderabbitai[bot]

✅ Actions performed

Reviews paused.

coderabbitai[bot] avatar Nov 07 '25 03:11 coderabbitai[bot]