.swiftlint.yml
disabled_rules:
- line_length
- trailing_whitespace
- identifier_name
- large_tuple
- type_name
- multiple_closures_with_trailing_closure
- modifier_order
- trailing_comma
- weak_delegate
- nesting
- discouraged_object_literal
opt_in_rules:
- attributes
- closure_end_indentation
- closure_spacing
- contains_over_first_not_nil
- convenience_type
- discouraged_object_literal
- empty_count
- empty_string
- explicit_top_level_acl
- fallthrough
- fatal_error_message
- file_header
- first_where
- force_unwrapping
- implicitly_unwrapped_optional
- joined_default_parameter
- literal_expression_end_indentation
# - missing_docs
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiline_parameters
- number_separator
- operator_usage_whitespace
- overridden_super_call
- override_in_extension
- pattern_matching_keywords
- private_action
- private_outlet
- private_over_fileprivate
- prohibited_super_call
- redundant_discardable_let
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- strict_fileprivate
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- untyped_error_in_catch
excluded:
- Tests
vertical_whitespace:
max_empty_lines: 3
custom_rules:
comment_space:
included: ".*\\.swift"
regex: "//[^/\\s]"
match_kinds:
- comment
message: "Expected space after comment."
severity: warning
top_level_vertical_space:
included: ".*\\.swift"
regex: '^\S[^\n]*\n(?: *\n){1,2}(?=^\S)'
message: "Three lines between top-level items."
severity: warning
second_level_min_vertical_space:
included: ".*\\.swift"
regex: '^ {2}\S[^\n]*\n(?: *\n)(?=^ {0,2}\S)'
message: "There must be two or zero lines between second-level items."
severity: warning
second_level_max_vertical_space:
included: ".*\\.swift"
regex: '^ {2}\S[^\n]*\n(?: *\n){3,}(?=^ {0,2}\S)'
message: "There must be no more than two lines between second-level items."
severity: warning
must_localize_errors:
included: ".*\\.swift"
regex: 'enum(\s+\w+(:|,)?)+\s+\bError\b'
message: "Localize errors by conforming to LocalizedError and implementing errorDescription."
severity: warning