2020-09-06 19:02:29 +02:00
|
|
|
# SwiftLint Configuration
|
|
|
|
|
|
|
|
|
|
## Folders to exclude from linting
|
|
|
|
|
|
2020-07-04 20:35:21 +02:00
|
|
|
excluded:
|
|
|
|
|
- Carthage
|
|
|
|
|
- go
|
|
|
|
|
- Pods
|
2022-05-23 15:27:58 -07:00
|
|
|
- vendor
|
2020-07-04 20:35:21 +02:00
|
|
|
|
2020-09-06 19:02:29 +02:00
|
|
|
## Active rules
|
|
|
|
|
|
2020-11-10 22:43:44 +01:00
|
|
|
only_rules:
|
2022-06-16 04:55:02 +02:00
|
|
|
- accessibility_label_for_image
|
2021-09-16 02:43:14 +02:00
|
|
|
# - anonymous_argument_in_multiline_closure
|
2020-07-04 20:35:21 +02:00
|
|
|
- anyobject_protocol
|
|
|
|
|
- array_init
|
2020-09-19 16:46:20 +02:00
|
|
|
- attributes
|
2021-03-06 15:26:42 +01:00
|
|
|
# - balanced_xctest_lifecycle
|
2020-07-04 20:35:21 +02:00
|
|
|
- block_based_kvo
|
2021-10-07 19:49:19 +02:00
|
|
|
- capture_variable
|
2020-07-04 21:54:02 +02:00
|
|
|
- class_delegate_protocol
|
2020-07-04 20:35:21 +02:00
|
|
|
- closing_brace
|
|
|
|
|
- closure_body_length
|
|
|
|
|
- closure_end_indentation
|
2020-07-04 21:55:23 +02:00
|
|
|
- closure_parameter_position
|
2020-07-04 20:35:21 +02:00
|
|
|
- closure_spacing
|
|
|
|
|
- collection_alignment
|
|
|
|
|
- colon
|
|
|
|
|
- comma
|
2022-06-16 04:55:02 +02:00
|
|
|
- comma_inheritance
|
2020-12-18 10:03:26 +01:00
|
|
|
- comment_spacing
|
2020-07-04 20:35:21 +02:00
|
|
|
- compiler_protocol_init
|
2020-08-10 23:14:12 +02:00
|
|
|
- computed_accessors_order
|
2020-07-04 21:57:26 +02:00
|
|
|
- conditional_returns_on_newline
|
2020-07-04 20:35:21 +02:00
|
|
|
- contains_over_filter_count
|
|
|
|
|
- contains_over_filter_is_empty
|
2020-07-04 22:01:01 +02:00
|
|
|
- contains_over_first_not_nil
|
2021-10-07 19:49:19 +02:00
|
|
|
- contains_over_range_nil_comparison
|
2020-07-04 20:35:21 +02:00
|
|
|
- control_statement
|
2020-07-04 22:05:20 +02:00
|
|
|
- convenience_type
|
2020-07-04 20:35:21 +02:00
|
|
|
- custom_rules
|
2020-09-19 17:15:49 +02:00
|
|
|
- cyclomatic_complexity
|
2020-07-04 20:35:21 +02:00
|
|
|
- deployment_target
|
|
|
|
|
- discarded_notification_center_observer
|
2021-03-06 15:26:42 +01:00
|
|
|
- discouraged_assert
|
2020-07-04 20:35:21 +02:00
|
|
|
- discouraged_direct_init
|
2021-09-16 02:43:14 +02:00
|
|
|
# - discouraged_none_name
|
2020-07-04 20:35:21 +02:00
|
|
|
# - discouraged_object_literal
|
|
|
|
|
- discouraged_optional_boolean
|
2020-07-04 22:19:01 +02:00
|
|
|
# - discouraged_optional_collection # Too many false positives in implementations of system protocols.
|
2021-09-16 02:43:14 +02:00
|
|
|
- duplicated_key_in_dictionary_literal
|
2020-07-04 20:35:21 +02:00
|
|
|
- duplicate_enum_cases
|
|
|
|
|
- duplicate_imports
|
|
|
|
|
- dynamic_inline
|
|
|
|
|
- empty_collection_literal
|
2020-07-04 22:24:30 +02:00
|
|
|
# - empty_count # Too many false positives for variables named 'count'.
|
2020-07-04 20:35:21 +02:00
|
|
|
- empty_enum_arguments
|
|
|
|
|
- empty_parameters
|
|
|
|
|
- empty_parentheses_with_trailing_closure
|
2020-07-04 22:28:40 +02:00
|
|
|
- empty_string
|
2020-07-04 22:36:49 +02:00
|
|
|
- empty_xctest_method
|
2020-07-04 20:35:21 +02:00
|
|
|
- enum_case_associated_values_count
|
|
|
|
|
- expiring_todo
|
|
|
|
|
# - explicit_acl
|
2020-07-04 23:08:32 +02:00
|
|
|
# - explicit_enum_raw_value # Disabled in favor of 'redundant_string_enum_value'.
|
2020-07-04 20:35:21 +02:00
|
|
|
- explicit_init
|
|
|
|
|
- explicit_self
|
|
|
|
|
# - explicit_top_level_acl
|
|
|
|
|
# - explicit_type_interface
|
|
|
|
|
# - extension_access_modifier
|
|
|
|
|
- fallthrough
|
|
|
|
|
- fatal_error_message
|
|
|
|
|
# - file_header
|
|
|
|
|
# - file_length
|
|
|
|
|
# - file_name
|
|
|
|
|
- file_name_no_space
|
|
|
|
|
# - file_types_order
|
|
|
|
|
- first_where
|
|
|
|
|
- flatmap_over_map_reduce
|
|
|
|
|
- for_where
|
|
|
|
|
# - force_cast
|
|
|
|
|
# - force_try
|
|
|
|
|
# - force_unwrapping
|
|
|
|
|
# - function_body_length
|
2020-07-06 10:09:52 +02:00
|
|
|
- function_default_parameter_at_end
|
2020-09-20 13:42:41 +02:00
|
|
|
- function_parameter_count
|
2020-07-04 20:35:21 +02:00
|
|
|
- generic_type_name
|
2020-08-10 23:13:31 +02:00
|
|
|
- ibinspectable_in_extension
|
2020-07-04 20:35:21 +02:00
|
|
|
- identical_operands
|
2020-09-20 15:07:18 +02:00
|
|
|
- identifier_name
|
2020-07-04 20:35:21 +02:00
|
|
|
- implicit_getter
|
2020-09-20 13:43:02 +02:00
|
|
|
- implicit_return
|
2020-07-04 20:35:21 +02:00
|
|
|
# - implicitly_unwrapped_optional
|
2020-11-10 22:43:44 +01:00
|
|
|
- inclusive_language
|
2020-07-04 20:35:21 +02:00
|
|
|
# - indentation_width
|
|
|
|
|
- inert_defer
|
|
|
|
|
- is_disjoint
|
2020-07-04 23:33:51 +02:00
|
|
|
- joined_default_parameter
|
2020-07-04 20:35:21 +02:00
|
|
|
- large_tuple
|
|
|
|
|
- last_where
|
|
|
|
|
- leading_whitespace
|
2021-03-06 15:26:42 +01:00
|
|
|
# - legacy_objc_type
|
2020-07-04 20:35:21 +02:00
|
|
|
- legacy_cggeometry_functions
|
|
|
|
|
- legacy_constant
|
|
|
|
|
- legacy_constructor
|
|
|
|
|
- legacy_hashing
|
2020-07-04 23:36:27 +02:00
|
|
|
- legacy_multiple
|
2020-07-04 20:35:21 +02:00
|
|
|
- legacy_nsgeometry_functions
|
|
|
|
|
- legacy_random
|
2020-07-04 23:39:21 +02:00
|
|
|
- let_var_whitespace
|
2020-07-04 20:35:21 +02:00
|
|
|
# - line_length
|
|
|
|
|
- literal_expression_end_indentation
|
2020-07-04 23:46:41 +02:00
|
|
|
- lower_acl_than_parent
|
2020-07-04 20:35:21 +02:00
|
|
|
- mark
|
|
|
|
|
# - missing_docs
|
|
|
|
|
- modifier_order
|
|
|
|
|
- multiline_arguments
|
2020-07-05 00:16:22 +02:00
|
|
|
- multiline_arguments_brackets
|
2020-07-05 00:20:08 +02:00
|
|
|
- multiline_function_chains
|
2020-07-05 00:25:34 +02:00
|
|
|
- multiline_literal_brackets
|
2020-07-05 00:32:32 +02:00
|
|
|
- multiline_parameters
|
2020-07-05 00:33:01 +02:00
|
|
|
- multiline_parameters_brackets
|
2020-07-05 00:34:34 +02:00
|
|
|
- multiple_closures_with_trailing_closure
|
2020-07-05 00:40:05 +02:00
|
|
|
- nesting
|
2020-07-04 20:35:21 +02:00
|
|
|
- nimble_operator
|
|
|
|
|
# - no_extension_access_modifier
|
|
|
|
|
- no_fallthrough_only
|
|
|
|
|
# - no_grouping_extension
|
|
|
|
|
- no_space_in_method_call
|
|
|
|
|
- notification_center_detachment
|
2020-07-05 00:45:31 +02:00
|
|
|
- nslocalizedstring_key
|
2020-07-05 00:49:01 +02:00
|
|
|
- nslocalizedstring_require_bundle
|
2020-07-04 20:35:21 +02:00
|
|
|
- nsobject_prefer_isequal
|
2020-07-05 00:50:12 +02:00
|
|
|
# - number_separator # Contradicts with SwiftFormat rule 'decimalgrouping'. There are not many numbers anyway in the source code.
|
2020-07-04 20:35:21 +02:00
|
|
|
- object_literal
|
|
|
|
|
- opening_brace
|
|
|
|
|
- operator_usage_whitespace
|
|
|
|
|
- operator_whitespace
|
|
|
|
|
- optional_enum_case_matching
|
|
|
|
|
- orphaned_doc_comment
|
2020-07-06 10:04:41 +02:00
|
|
|
- overridden_super_call
|
2020-07-04 20:35:21 +02:00
|
|
|
- override_in_extension
|
|
|
|
|
- pattern_matching_keywords
|
2021-10-07 19:49:19 +02:00
|
|
|
# - prefer_nimble
|
2022-06-16 04:55:02 +02:00
|
|
|
- prefer_self_in_static_references
|
2020-07-04 20:35:21 +02:00
|
|
|
- prefer_self_type_over_type_of_self
|
2020-08-10 23:13:31 +02:00
|
|
|
- prefer_zero_over_explicit_init
|
2020-07-05 22:46:21 +02:00
|
|
|
# - prefixed_toplevel_constant # Violations are mostly in test code.
|
2020-07-05 22:49:53 +02:00
|
|
|
- private_action
|
2020-07-04 20:35:21 +02:00
|
|
|
# - private_outlet
|
|
|
|
|
- private_over_fileprivate
|
2021-03-06 15:26:42 +01:00
|
|
|
- private_subject
|
2020-07-04 20:35:21 +02:00
|
|
|
- private_unit_test
|
|
|
|
|
# - prohibited_interface_builder
|
|
|
|
|
# - prohibited_super_call
|
|
|
|
|
- protocol_property_accessors_order
|
|
|
|
|
- quick_discouraged_call
|
|
|
|
|
- quick_discouraged_focused_test
|
|
|
|
|
- quick_discouraged_pending_test
|
|
|
|
|
- raw_value_for_camel_cased_codable_enum
|
|
|
|
|
- reduce_boolean
|
|
|
|
|
- reduce_into
|
|
|
|
|
- redundant_discardable_let
|
|
|
|
|
- redundant_nil_coalescing
|
|
|
|
|
- redundant_objc_attribute
|
|
|
|
|
- redundant_optional_initialization
|
|
|
|
|
- redundant_set_access_control
|
|
|
|
|
- redundant_string_enum_value
|
2020-07-05 22:59:03 +02:00
|
|
|
- redundant_type_annotation
|
2020-07-04 20:35:21 +02:00
|
|
|
- redundant_void_return
|
|
|
|
|
# - required_deinit
|
|
|
|
|
- required_enum_case
|
|
|
|
|
- return_arrow_whitespace
|
2022-06-16 04:55:02 +02:00
|
|
|
- return_value_from_void_function
|
2021-12-27 23:58:02 +01:00
|
|
|
- self_in_property_initialization
|
2020-07-04 20:35:21 +02:00
|
|
|
- shorthand_operator
|
|
|
|
|
- single_test_class
|
|
|
|
|
- sorted_first_last
|
2020-07-05 23:02:21 +02:00
|
|
|
# - sorted_imports # Managed by SwiftFormat.
|
2020-07-04 20:35:21 +02:00
|
|
|
- statement_position
|
2021-10-07 19:48:57 +02:00
|
|
|
- static_operator
|
2020-07-05 23:09:10 +02:00
|
|
|
- strict_fileprivate
|
2020-07-04 20:35:21 +02:00
|
|
|
- strong_iboutlet
|
|
|
|
|
- superfluous_disable_command
|
|
|
|
|
- switch_case_alignment
|
2020-07-05 23:10:42 +02:00
|
|
|
- switch_case_on_newline
|
2020-07-04 20:35:21 +02:00
|
|
|
- syntactic_sugar
|
2020-11-10 22:43:44 +01:00
|
|
|
- test_case_accessibility
|
2020-07-04 20:35:21 +02:00
|
|
|
- todo
|
2020-07-05 23:12:40 +02:00
|
|
|
- toggle_bool
|
2020-07-05 23:15:29 +02:00
|
|
|
- trailing_closure
|
2020-09-19 15:22:01 +02:00
|
|
|
- trailing_comma
|
2020-07-04 20:35:21 +02:00
|
|
|
- trailing_newline
|
|
|
|
|
- trailing_semicolon
|
|
|
|
|
- trailing_whitespace
|
|
|
|
|
# - type_body_length
|
|
|
|
|
# - type_contents_order
|
2020-07-05 23:30:39 +02:00
|
|
|
- type_name
|
2022-06-16 04:55:02 +02:00
|
|
|
- unavailable_condition
|
2020-07-04 20:35:21 +02:00
|
|
|
- unavailable_function
|
|
|
|
|
- unneeded_break_in_switch
|
2020-07-05 23:32:43 +02:00
|
|
|
- unneeded_parentheses_in_closure_argument
|
2020-07-04 20:35:21 +02:00
|
|
|
# - unowned_variable_capture
|
|
|
|
|
- untyped_error_in_catch
|
|
|
|
|
- unused_capture_list
|
|
|
|
|
- unused_closure_parameter
|
|
|
|
|
- unused_control_flow_label
|
|
|
|
|
- unused_declaration
|
|
|
|
|
- unused_enumerated
|
|
|
|
|
- unused_import
|
2020-07-05 23:41:27 +02:00
|
|
|
- unused_optional_binding
|
2020-07-04 20:35:21 +02:00
|
|
|
- unused_setter_value
|
|
|
|
|
- valid_ibinspectable
|
|
|
|
|
- vertical_parameter_alignment
|
|
|
|
|
- vertical_parameter_alignment_on_call
|
|
|
|
|
- vertical_whitespace
|
2020-07-05 23:43:42 +02:00
|
|
|
# - vertical_whitespace_between_cases # Additional whitespace not needed because of visible indentation.
|
2020-07-05 23:45:08 +02:00
|
|
|
- vertical_whitespace_closing_braces
|
2020-07-04 20:35:21 +02:00
|
|
|
- vertical_whitespace_opening_braces
|
|
|
|
|
- void_return
|
2020-07-05 23:47:33 +02:00
|
|
|
- weak_delegate
|
2020-07-04 20:35:21 +02:00
|
|
|
- xct_specific_matcher
|
|
|
|
|
- xctfail_message
|
|
|
|
|
- yoda_condition
|
|
|
|
|
|
2020-09-06 19:02:29 +02:00
|
|
|
## Configuration for specific rules
|
|
|
|
|
|
2020-09-19 16:46:20 +02:00
|
|
|
attributes:
|
|
|
|
|
always_on_same_line: []
|
2020-09-06 19:02:29 +02:00
|
|
|
closure_body_length:
|
2020-07-04 20:35:21 +02:00
|
|
|
warning: 40
|
|
|
|
|
error: 60
|
2020-09-20 15:07:18 +02:00
|
|
|
identifier_name:
|
|
|
|
|
excluded: ["id", "to", "Defaults"]
|
|
|
|
|
allowed_symbols: ["_"]
|
2021-08-27 23:34:30 +02:00
|
|
|
multiline_arguments:
|
|
|
|
|
only_enforce_after_first_closure_on_first_line: true
|
2020-07-05 23:30:39 +02:00
|
|
|
type_name:
|
|
|
|
|
max_length: 50
|
2020-09-19 15:20:50 +02:00
|
|
|
trailing_closure:
|
|
|
|
|
only_single_muted_parameter: true
|
2020-09-19 15:22:01 +02:00
|
|
|
trailing_comma:
|
|
|
|
|
mandatory_comma: true
|