Open 72A12F4E opened 1 week ago
Please describe the rule idea, format this issue's title as Rule Request: [Rule Name] and describe:
Rule Request: [Rule Name]
I think we should have a rule that triggers when someone writes a do-catch, and leaves the catch empty. Cases like this should just use try?
do-catch
catch
try?
Bad
do { try doStuff() } catch { }
Good
do { try doStuff() } catch { Logger().error("\(error.localizedDescription)") }
no configuration needed
I think this should be enabled by default, although I can understand the amount of noise that might cause for existing projects.
This could become a part of the new rule introduced in #5617 or a dedicate rule.
New Issue Checklist
New rule request
Please describe the rule idea, format this issue's title as
Rule Request: [Rule Name]
and describe:I think we should have a rule that triggers when someone writes a
do-catch
, and leaves thecatch
empty. Cases like this should just usetry?
Bad
Good
no configuration needed
I think this should be enabled by default, although I can understand the amount of noise that might cause for existing projects.