nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.67k stars 623 forks source link

Fix issue where for loop would break `conditionalAssignment` rule #1585

Closed calda closed 8 months ago

calda commented 8 months ago

This PR fixes an issue where a for loop a conditional branch would break the conditionalAssignment rule. This is because we were unexpectedly treating the in keyword in the for loop as the in keyword following a closure capture list.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (a208d66) 95.02% compared to head (6201883) 95.02%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1585 +/- ## ======================================== Coverage 95.02% 95.02% ======================================== Files 20 20 Lines 21842 21844 +2 ======================================== + Hits 20755 20757 +2 Misses 1087 1087 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.