We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if
switch
In version 5.9, Swift got support for if and switch expressions. A rule to enforce them where allowed should be possible.
In the first implementation, the rule does not need to be configurable. It should be opt-in and might support automatic rewriting.
Triggering:
func f(cond: Bool) -> Int { if cond { return 1 } else { return 2 } }
func f(cond: Bool) { let r: Int if cond { r = 1 } else { r = 2 } }
Non-triggering:
func f(cond: Bool) -> Int { if cond { // Nothing } else { return 2 } return 1 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In version 5.9, Swift got support for
if
andswitch
expressions. A rule to enforce them where allowed should be possible.In the first implementation, the rule does not need to be configurable. It should be opt-in and might support automatic rewriting.
Triggering:
Non-triggering:
The text was updated successfully, but these errors were encountered: