Skip to content

Lowered SDK requirements to macOS 14 #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 15, 2025
Merged

Lowered SDK requirements to macOS 14 #10

merged 3 commits into from
May 15, 2025

Conversation

NSFatalError
Copy link
Owner

@NSFatalError NSFatalError commented May 15, 2025

Summary by CodeRabbit

  • New Features
    • Added a computed property to provide unique inferred types from property lists.
  • Bug Fixes
    • Enhanced type comparison to better handle syntactic variations.
  • Tests
    • Added tests for property parsing, classification, and type inference across diverse property types.
  • Chores
    • Lowered minimum platform requirements to support earlier Swift tools and OS versions.

@NSFatalError NSFatalError self-assigned this May 15, 2025
Copy link

coderabbitai bot commented May 15, 2025

Walkthrough

The changes introduce a new computed property for deduplicating inferred property types in PropertiesList, enhance type comparison logic in TypeSyntax, and add comprehensive tests for property parsing and categorization. Additionally, the Swift tools and platform deployment versions in the package manifest are downgraded for broader compatibility.

Changes

File(s) Change Summary
Package.swift Downgraded Swift tools version from 6.1 to 6.0 and lowered minimum deployment versions for macOS, macCatalyst, iOS, tvOS, watchOS, and visionOS.
Sources/PrincipleMacros/Parsers/Properties/PropertiesList.swift Added public computed property uniqueInferredTypes to deduplicate and sort inferred property types in PropertiesList.
Sources/PrincipleMacros/Syntax/Extensions/TypeSyntax.swift Modified isLike(_:) method to compare standardized, trimmed type descriptions for more robust type equivalence checking.
Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift Introduced PropertiesListTests struct with tests for property classification, uniqueness of inferred types, and filtering by type in the PropertiesList parser.

Sequence Diagram(s)

sequenceDiagram
    participant TestSuite as PropertiesListTests
    participant Parser as PropertiesList
    participant Syntax as TypeSyntax

    TestSuite->>Parser: Parse class declaration
    Parser->>Parser: Categorize properties (immutable, mutable, etc.)
    TestSuite->>Parser: Request uniqueInferredTypes
    Parser->>Parser: Extract and deduplicate inferred types
    Parser->>Syntax: Compare types using isLike(_:)
    Syntax->>Syntax: Standardize and trim descriptions
    Syntax-->>Parser: Return comparison result
    Parser-->>TestSuite: Return results for assertions
Loading

Poem

In the warren of code, new tests now appear,
Types are deduped, their meanings made clear.
The syntax is stricter, comparisons refined,
With broader support, all platforms aligned.
A hop and a skip, with every test passed—
This rabbit’s delight is code built to last!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between df593ae and 1fdc99b.

📒 Files selected for processing (1)
  • Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build-and-test (visionos)
  • GitHub Check: build-and-test (ios)
  • GitHub Check: build-and-test (watchos)
  • GitHub Check: build-and-test (macos)
  • GitHub Check: build-and-test (maccatalyst)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve 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 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.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6381001 and df593ae.

📒 Files selected for processing (4)
  • Package.swift (1 hunks)
  • Sources/PrincipleMacros/Parsers/Properties/PropertiesList.swift (1 hunks)
  • Sources/PrincipleMacros/Syntax/Extensions/TypeSyntax.swift (1 hunks)
  • Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift (1)
Sources/PrincipleMacros/Parsers/Properties/PropertiesList.swift (1)
  • withInferredType (62-64)
🪛 SwiftLint (0.57.0)
Package.swift

[Warning] 6-6: Top-level declarations should specify Access Control Level keywords explicitly

(explicit_top_level_acl)


[Warning] 1-1: Header comments should be consistent with project patterns

(file_header)


[Warning] 6-6: Top-level constants should be prefixed by k

(prefixed_toplevel_constant)

Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift

[Warning] 19-19: Type declaration should start with an empty line.

(empty_line_after_type_declaration)

🪛 GitHub Actions: Pull request
Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift

[error] 19-19: SwiftLint: Empty line after type declaration Violation: Type declaration should start with an empty line. (empty_line_after_type_declaration)

🔇 Additional comments (5)
Package.swift (2)

1-1: Swift tools version downgraded to enhance compatibility

The Swift tools version has been downgraded from 6.1 to 6.0, which will increase compatibility with older toolchains.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 1-1: Header comments should be consistent with project patterns

(file_header)


9-14: Platform requirements lowered for broader compatibility

All minimum platform versions have been reduced to support older OS versions:

  • macOS: 15 → 14
  • macCatalyst, iOS, tvOS: 18 → 17
  • watchOS: 11 → 10
  • visionOS: 2 → 1

This change aligns with the PR title and increases the package's compatibility with older systems.

Sources/PrincipleMacros/Syntax/Extensions/TypeSyntax.swift (1)

13-15: Improved type comparison with standardization

The isLike(_:) method now compares the standardized form of types before comparing their trimmed descriptions. This enhancement ensures that syntactically different but semantically equivalent types (e.g., Int? and Optional<Int>) will be recognized as the same type.

This change provides more robust type comparisons and supports the new uniqueInferredTypes property in PropertiesList.

Sources/PrincipleMacros/Parsers/Properties/PropertiesList.swift (1)

49-60: Well-implemented property for unique type collection

The new uniqueInferredTypes computed property effectively collects all inferred types from properties while ensuring uniqueness. The implementation:

  1. Uses lazy evaluation for mapping properties to their types
  2. Creates a dictionary to eliminate duplicates
  3. Returns types sorted by description for deterministic ordering

This is a valuable addition that complements the existing type-filtering functionality and provides a clean way to access all unique types used in properties.

Tests/PrincipleMacrosTests/Parsers/PropertiesListTests.swift (1)

13-142: Comprehensive test coverage for PropertiesList functionality

This new test file thoroughly validates all aspects of the PropertiesList including:

  • Property categorization (immutable, mutable, instance, type, stored, computed)
  • The new uniqueInferredTypes property
  • Type filtering with withInferredType(like:)

The test class declaration includes a diverse set of property types that provides excellent coverage of the various scenarios.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 19-19: Type declaration should start with an empty line.

(empty_line_after_type_declaration)

🪛 GitHub Actions: Pull request

[error] 19-19: SwiftLint: Empty line after type declaration Violation: Type declaration should start with an empty line. (empty_line_after_type_declaration)

Copy link

codecov bot commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@NSFatalError NSFatalError merged commit 22edb9c into main May 15, 2025
9 checks passed
@NSFatalError NSFatalError deleted the feature/macos-14 branch May 15, 2025 14:55
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.

1 participant