Skip to content

Add AutoRoutable#2

Merged
aromanov91 merged 3 commits intomainfrom
routable
Sep 12, 2025
Merged

Add AutoRoutable#2
aromanov91 merged 3 commits intomainfrom
routable

Conversation

@aromanov91
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 12, 2025 18:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new AutoRoutable macro that automatically generates an id property for enum cases, replacing the previous stringify macro functionality. The macro simplifies routing by providing string identifiers for each enum case.

  • Replaces StringifyMacro with AutoRoutableMacro for enum route identification
  • Adds comprehensive test coverage including macro expansion and runtime behavior tests
  • Updates package configuration and adds CI workflow for automated testing

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Sources/OversizeMacroMacros/AutoRoutableMacro.swift Implements the AutoRoutable macro that generates id property for enum cases
Sources/OversizeMacro/OversizeMacro.swift Defines the public AutoRoutable macro interface
Sources/OversizeMacroMacros/OversizeMacroPlugin.swift Updates compiler plugin to provide AutoRoutableMacro
Sources/OversizeMacroMacros/OversizeMacroMacro.swift Removes old StringifyMacro implementation
Tests/OversizeMacroTests/AutoRoutableTests.swift Adds comprehensive test coverage for macro expansion and runtime behavior
Sources/OversizeMacroClient/main.swift Updates client example to demonstrate AutoRoutable usage
Package.swift Updates dependencies and adds test target configuration
.swiftformat Adds SwiftFormat configuration for code formatting
.github/workflows/ci.yml Adds CI workflow for automated testing and building

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +5 to +12
public static func expansion<Declaration: DeclGroupSyntax, Context: MacroExpansionContext>(
of node: AttributeSyntax,
providingMembersOf declaration: Declaration,
conformingTo _: [TypeSyntax],
in context: Context
) throws -> [DeclSyntax] {
try expansion(of: node, providingMembersOf: declaration, in: context)
}
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

This method simply delegates to another expansion method but discards the conformingTo and context parameters. Consider removing this wrapper method and using the simpler expansion method directly, or document why this delegation is necessary.

Copilot uses AI. Check for mistakes.
@aromanov91 aromanov91 merged commit 08a914a into main Sep 12, 2025
5 checks passed
@aromanov91 aromanov91 deleted the routable branch September 12, 2025 18:25
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