-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
rule-requestRequests for a new rules.Requests for a new rules.
Description
Swift has the notion of condition lists that behave exactly as if the condition elements were combined with the && operator. Condition lists can be regarded as idiomatic Swift.
This new rule should trigger on boolean expressions used in places where condition lists would be allowed, too. It can even auto-transform these expressions. It is very important, though, that the order of evaluation is preserved to avoid changing the code's semantic with respect to side effects.
The rule should be opt-in. In fact, a reverse rule triggering on condition lists is also conceivable. At the moment, there is no specific configuration necessary.
Triggering examples
if a && b {}
while (a || b) && c {}can be replaced with
if a, b {}
while a || b, c {}Non-triggering examples
do {} while a || b && c
if a, { b && c }}() {}sindresorhus
Metadata
Metadata
Assignees
Labels
rule-requestRequests for a new rules.Requests for a new rules.