[SR-5744] Refactoring action to convert if-let to guard-let and vice versa#24566
Conversation
|
@swift-ci test |
|
You can't invoke CI yourself, you need commit access for it. |
|
cc @akyrtzi |
nkcsgexi
left a comment
There was a problem hiding this comment.
The implementation looks great overall👍! I have only several nitpicks inline.
There was a problem hiding this comment.
We should always use 2-spaces indentation. Could you fix other indentation issues as well in this change?
There was a problem hiding this comment.
We can assume performChange() is called only when isApplicable returns true. So it seems the above logics are unnecessary.
There was a problem hiding this comment.
Could you move the ThenStmt check to the isApplicable function too? so we don't need to check it here and surprising the users by aborting.
There was a problem hiding this comment.
Moved to the isApplicable.
There was a problem hiding this comment.
These two statements can be merged as if (auto *ElseBody = dyn_cast_or_null<BraceStmt>(If->getElseStmt())) {}
There was a problem hiding this comment.
Similarly, can we move these condition checkings into isApplicable function and only check it there?
There was a problem hiding this comment.
Indentation issue here and all other places.
|
@swift-ci please smoke test |
|
@swift-ci please stress test |
|
Also I fixed similar issues at this PR: Refactoring action to convert to computed property. |
|
All tests passed. Congratulations for your first Swift contribution!🚢 |
Implement action to convert from:
to
and vice-versa
Resolves new feature request SR-5744.
Refactoring action to convert if-let to guard-let and vice versa
Feedback is very much appreciated!