@@ -10,7 +10,6 @@ excluded:
1010 - Demo/Pods
1111
1212disabled_rules :
13- - block_based_kvo # Prefer the new block based KVO API with keypaths when using Swift 3.2 or later.
1413 - cyclomatic_complexity # Complexity of function bodies should be limited.
1514 - file_length # Files should not span too many lines.
1615 - for_where # where clauses are preferred over a single if inside a for.
@@ -21,39 +20,51 @@ disabled_rules:
2120 - todo # TODOs and FIXMEs should be resolved.
2221 - trailing_whitespace # Lines should not have trailing whitespace.
2322 - unused_setter_value # Setter value is not used.
23+ - multiple_closures_with_trailing_closure # Trailing closure syntax should not be used when passing more than one closure argument.
2424
2525opt_in_rules :
26- - anyobject_protocol # Prefer using AnyObject over class for class-only protocols.
27- - array_init # Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.
26+ - anyobject_protocol # Prefer using ` AnyObject` over class for class-only protocols.
27+ - array_init # Prefer using ` Array(seq)` over ` seq.map { $0 }` to convert a sequence into an Array.
2828 - closure_end_indentation # Closure end should have the same indentation as the line that started it.
2929 - closure_spacing # Closure expressions should have a single space inside each brace.
3030 - collection_alignment # All elements in a collection literal should be vertically aligned
31- - conditional_returns_on_newline # Conditional statements should always return on the next line.
31+ - contains_over_filter_count # Prefer `contains` over comparing `filter(where:).count` to `0`.
32+ - contains_over_filter_is_empty # Prefer `contains` over using `filter(where:).isEmpty`
33+ - contains_over_first_not_nil # Prefer `contains` over `first(where:) != nil` and `firstIndex(where:) != nil`.
34+ - contains_over_range_nil_comparison # Prefer `contains` over `range(of:) != nil` and `range(of:) == nil`.
3235 - discouraged_object_literal # Prefer initializers over object literals.
33- - empty_count # Prefer checking isEmpty over comparing count to zero .
34- - empty_string # Prefer checking isEmpty over comparing string to an empty string literal .
35- - empty_xctest_method # Empty XCTest method should be avoided .
36- - explicit_init # Explicitly calling .init() should be avoided.
37- - extension_access_modifier # Prefer to use extension access modifiers .
36+ - empty_collection_literal # Prefer checking ` isEmpty` over comparing collection to an empty array or dictionary literal .
37+ - empty_count # Prefer checking ` isEmpty` over comparing count to zero .
38+ - empty_string # Prefer checking `isEmpty` over comparing string to an empty string literal .
39+ - empty_xctest_method # Empty `XCTest` method should be avoided.
40+ - explicit_init # Explicitly calling `.init()` should be avoided .
3841 - fallthrough # Fallthrough should be avoided.
39- - fatal_error_message # A fatalError call should have a message.
42+ - fatal_error_message # A ` fatalError` call should have a message.
4043 - file_header # Header comments should be consistent with project patterns.
41- - first_where # Prefer using .first(where:) over .filter { }.first in collections.
44+ - first_where # Prefer using `.first(where:)` over `.filter { }.first` in collections.
45+ - flatmap_over_map_reduce # Prefer `flatMap` over `map` followed by `reduce([], +)`.
4246 - function_default_parameter_at_end # Prefer to locate parameters with defaults toward the end of the parameter list.
47+ - legacy_multiple # Prefer using the `isMultiple(of:)` function instead of using the remainder operator (`%`).
4348 - joined_default_parameter # Discouraged explicit usage of the default. separator.
44- - last_where # Prefer using .last(where:) over .filter { }.last in collections.
45- - legacy_random # Prefer using type.random(in:) over legacy functions.
49+ - last_where # Prefer using ` .last(where:)` over ` .filter { }.last` in collections.
50+ - legacy_random # Prefer using ` type.random(in:)` over legacy functions.
4651 - literal_expression_end_indentation # Array and dictionary literal end should have the same indentation as the line that started it.
4752 - lower_acl_than_parent # Ensure definitions have a lower access control level than their enclosing parent.
4853 - multiline_literal_brackets # Multiline literals should have their surrounding brackets in a new line.
4954 - prohibited_super_call # Some methods should not call super.
50- - sorted_imports # Imports should be sorted.
51- - toggle_bool # Prefer someBool.toggle() over someBool = !someBool.
55+ - redundant_type_annotation # Variables should not have redundant type annotation
56+ - toggle_bool # Prefer ` someBool.toggle()` over ` someBool = !someBool` .
5257 - unneeded_parentheses_in_closure_argument # Parentheses are not needed when declaring closure arguments.
5358 - unused_import # All imported modules should be required to make the file compile.
5459 - unused_private_declaration # Private declarations should be referenced in that file.
5560 - vertical_parameter_alignment_on_call # Function parameters should be aligned vertically if they're in multiple lines in a method call.
5661
62+ custom_rules :
63+ trailing_logical_operator :
64+ name : ' Trailing logical operator'
65+ message : ' Leading logical operator should move to trailing.'
66+ regex : ' ^[\s]*(\|\||&&)'
67+
5768function_parameter_count :
5869 warning : 11
5970 error : 11
@@ -76,11 +87,6 @@ nesting:
7687 warning : 2
7788 error : 2
7889
79- # Type bodies should not span too many lines.
80- type_body_length :
81- warning : 1100
82- error : 1100
83-
8490# Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 50 characters in length.
8591type_name :
8692 allowed_symbols : ['_']
@@ -91,3 +97,7 @@ type_name:
9197# Limit vertical whitespace to a single empty line.
9298vertical_whitespace :
9399 max_empty_lines : 2
100+
101+ # Forbid "Created by" line in file header
102+ file_header :
103+ forbidden_pattern : \b(Created by)\b
0 commit comments