added new swiftlint rules

This commit is contained in:
Maxim Sorokin 2020-04-10 13:34:40 +03:00
parent 882759b6fa
commit 9dee92ef6f
1 changed files with 14 additions and 14 deletions

View File

@ -207,6 +207,20 @@ custom_rules:
- string_interpolation_anchor
- typeidentifier
getter_setter_style:
name: "Wrong getter/setter code style"
regex: "(get|set|willSet|didSet) \\{ [.]*"
match_kinds:
- keyword
message: "Make a new line break when use getter or setter"
severity: error
boolean_redundant_condition:
name: "Redundant Boolean Condition"
regex: "(== true)|(== false)|(!= true)|(!= false)||(\\? true \\: false)|(\\? false \\: true)"
message: "Comparing a boolean to true is redundant (use `?? false` for optionals), and `!`-syntax is preferred over comparing to false."
severity: error
# Rx
unused_map_parameter:
@ -222,17 +236,3 @@ custom_rules:
regex: '(^\s*\w*\.?)(addSubview)\([\w]+\)\n\1\2'
message: "Replace multiple addSubview calls with single addSubviews."
severity: warning
getter_setter_style:
name: "Wrong getter/setter code style"
regex: "(get|set|willSet|didSet) \\{ [.]*"
match_kinds:
- keyword
message: "Make a new line break when use getter or setter"
severity: error
boolean_redundant_condition:
name: "Redundant Boolean Condition"
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