Closed calda closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.16%. Comparing base (
9ce956c
) to head (a11c38d
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR updates the
conditionalAssignment
rule to support more complex lvalues. Previously it required that the value being assigned was just a simple identifier likefoo =
. Now it supports more complex lvalues likefoo?.bar =
,foo["bar"] =
, etc.For example, this sample code was left as-is before:
Now it is updated as expected:
I also added a new
--condassignment after-property
to let consumers disable the new functionality added in https://github.com/nicklockwood/SwiftFormat/pull/1643. After running the updated rule on our codebase, I found too many of the changes weird and unusual. On the other hand I found the previous behavior (only applying the new syntax after a new property declaration) reasonable almost all of the time.