Skip to content

Instantly share code, notes, and snippets.

@memfrag
Created February 17, 2019 20:01
Show Gist options
  • Save memfrag/c8f2744aa9070c8818b99d7303f7c5fc to your computer and use it in GitHub Desktop.
Save memfrag/c8f2744aa9070c8818b99d7303f7c5fc to your computer and use it in GitHub Desktop.
SwiftLint rules
whitelist_rules: # only these rules will be applied
- line_length
- file_length
- function_body_length
- type_body_length
- type_name
- identifier_name
- class_delegate_protocol
- weak_delegate
- anyobject_protocol
- closing_brace
- closure_end_indentation
- closure_parameter_position
- closure_spacing
- explicit_init
- generic_type_name
- identical_operands
- implicit_getter
- is_disjoint
- leading_whitespace
- literal_expression_end_indentation
- mark
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiple_closures_with_trailing_closure
- operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- override_in_extension
- prohibited_super_call
- protocol_property_accessors_order
- redundant_discardable_let
- redundant_nil_coalescing
- redundant_objc_attribute
- redundant_optional_initialization
- redundant_void_return
- return_arrow_whitespace
- shorthand_operator
- statement_position
- switch_case_alignment
- syntactic_sugar
- trailing_comma
- trailing_semicolon
- type_name
- unneeded_break_in_switch
- unused_enumerated
- unused_optional_binding
- valid_ibinspectable
- vertical_parameter_alignment
- vertical_parameter_alignment_on_call
- vertical_whitespace
- void_return
- yoda_condition
- array_init
- attributes
- compiler_protocol_init
- contains_over_first_not_nil
- discouraged_direct_init
- discouraged_object_literal
- discouraged_optional_boolean # Don't agree with this rule
- dynamic_inline
- force_try
- force_unwrapping
- large_tuple # Don't agree with this rule.
- legacy_random
file_length:
- 2000 #warning
- 2500 #error
function_body_length:
- 200 #warning
- 400 #error
line_length:
- 200 #warning
- 400 #error
type_body_length:
- 1000 #warning
- 2000 #error
identifier_name:
min_length: 1 #warning
max_length: #warning or error
warning: 100
error: 150
type_name:
min_length: 1
max_length: 80 #warning
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown)
excluded:
- External/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment