Skip to content

Commit

Permalink
Update redundantReturn rule to include examples using if/swift expres…
Browse files Browse the repository at this point in the history
…sion (#249)
  • Loading branch information
calda authored Nov 10, 2023
1 parent 9fdb84c commit df452c4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,22 @@ _You can enable the following settings in Xcode by running [this script](resourc
preferredStyle: .alert)
}

var alertTitle: String {
if issue.severity == .critical {
return "💥 Critical Error"
} else {
return "ℹ️ Info"
}

func type(of planet: Planet) -> PlanetType {
switch planet {
case .mercury, .venus, .earth, .mars:
return .terrestrial
case .jupiter, .saturn, .uranus, .neptune:
return .gasGiant
}
}

// RIGHT
["1", "2", "3"].compactMap { Int($0) }

Expand All @@ -2415,6 +2431,22 @@ _You can enable the following settings in Xcode by running [this script](resourc
message: message,
preferredStyle: .alert)
}

var alertTitle: String {
if issue.severity == .critical {
"💥 Critical Error"
} else {
"ℹ️ Info"
}

func type(of planet: Planet) -> PlanetType {
switch planet {
case .mercury, .venus, .earth, .mars:
.terrestrial
case .jupiter, .saturn, .uranus, .neptune:
.gasGiant
}
}
```

</details>
Expand Down

0 comments on commit df452c4

Please sign in to comment.