Skip to content

Add SwiftRefactor Library #1049

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 2 commits into from
Nov 3, 2022
Merged

Add SwiftRefactor Library #1049

merged 2 commits into from
Nov 3, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 3, 2022

SwiftRefactor provides a central place for tools that transform Swift source code to register their implementations. A syntactic refactoring provides a simple, strongly-typed, safe way to express the transformation process.

The inaugural refactoring action is the if-let migration committed in #887.

SwiftRefactor provides a central place for tools that transform Swift source code to register their implementations. A syntactic refactoring provides a simple, strongly-typed, safe way to express the transformation process.
@CodaFi CodaFi requested a review from ahoppen as a code owner November 3, 2022 02:55
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 3, 2022

@swift-ci test

Pull the MigrateToNewIfLetSyntax transform into SwiftRefactor as its first refactoring action. This action transforms all optional binding conditions in if statements into the new Swift 5.7 if-let shorthand syntax.

Before:

 ```swift
 if let foo = foo {
   // ...
 }
 ```

After:

 ```swift
 if let foo {
   // ...
 }
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 3, 2022

@swift-ci test

Copy link
Contributor

@kimdv kimdv left a comment

Choose a reason for hiding this comment

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

🎉

@CodaFi CodaFi merged commit e44e18c into swiftlang:main Nov 3, 2022
@CodaFi CodaFi deleted the refactorio branch November 3, 2022 13:02
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.

3 participants