added new swiftlint rules

This commit is contained in:
Maxim Sorokin 2020-04-12 13:54:01 +03:00
parent 9b759003ff
commit 23789510b3
1 changed files with 8 additions and 2 deletions

View File

@ -215,12 +215,18 @@ custom_rules:
message: "Make a new line break when use getter or setter"
severity: error
boolean_redundant_condition:
redundant_boolean_condition:
name: "Redundant Boolean Condition"
regex: "(== true)|(== false)|(!= true)|(!= false)|(\\? true \\: false)|(\\? false \\: true)"
regex: "(== true)|(== false)|(!= true)|(!= false)"
message: "Comparing a boolean to true is redundant (use `?? false` for optionals), and `!`-syntax is preferred over comparing to false."
severity: error
redundant_ternary_operator:
name: "Redundant Ternary Operator"
regex: "(\\? true \\: false)|(\\? false \\: true)"
message: "Returning a boolean as true is redundant, and `!`-syntax is preferred over returning as false."
severity: error
# Rx
unused_map_parameter: