|
| 1 | +disabled_rules: |
| 2 | + - trailing_whitespace |
| 3 | + - trailing_newline |
| 4 | + |
| 5 | +opt_in_rules: |
| 6 | + # accessibility_label_for_image |
| 7 | + - accessibility_trait_for_button |
| 8 | + - anonymous_argument_in_multiline_closure |
| 9 | + - array_init |
| 10 | + # async_without_await - not recognized |
| 11 | + # attributes |
| 12 | + # balanced_xctest_lifecycle |
| 13 | + # closure_body_length |
| 14 | + - closure_end_indentation |
| 15 | + - closure_spacing |
| 16 | + - collection_alignment |
| 17 | + - comma_inheritance |
| 18 | + - conditional_returns_on_newline |
| 19 | + - contains_over_filter_count |
| 20 | + - contains_over_filter_is_empty |
| 21 | + - contains_over_first_not_nil |
| 22 | + - contains_over_range_nil_comparison |
| 23 | + # contrasted_opening_brace |
| 24 | + # convenience_type - not working with Testing framework |
| 25 | + - direct_return |
| 26 | + - discarded_notification_center_observer |
| 27 | + - discouraged_assert |
| 28 | + - discouraged_none_name |
| 29 | + - discouraged_object_literal |
| 30 | + - discouraged_optional_boolean |
| 31 | + - discouraged_optional_collection |
| 32 | + - empty_collection_literal |
| 33 | + - empty_count |
| 34 | + - empty_string |
| 35 | + - empty_xctest_method |
| 36 | + - enum_case_associated_values_count |
| 37 | + # expiring_todo |
| 38 | + # explicit_acl |
| 39 | + # explicit_enum_raw_value |
| 40 | + - explicit_init |
| 41 | + - explicit_top_level_acl |
| 42 | + # explicit_type_interface |
| 43 | + # extension_access_modifier |
| 44 | + - fallthrough |
| 45 | + - fatal_error_message |
| 46 | + - file_header |
| 47 | + - file_name |
| 48 | + - file_name_no_space |
| 49 | + - file_types_order |
| 50 | + - final_test_case |
| 51 | + - first_where |
| 52 | + - flatmap_over_map_reduce |
| 53 | + - force_unwrapping |
| 54 | + # function_default_parameter_at_end |
| 55 | + - ibinspectable_in_extension |
| 56 | + - identical_operands |
| 57 | + - implicit_return |
| 58 | + # implicitly_unwrapped_optional |
| 59 | + # indentation_width |
| 60 | + - joined_default_parameter |
| 61 | + - last_where |
| 62 | + - legacy_multiple |
| 63 | + - legacy_objc_type |
| 64 | + - let_var_whitespace |
| 65 | + - literal_expression_end_indentation |
| 66 | + - local_doc_comment |
| 67 | + - lower_acl_than_parent |
| 68 | + # missing_docs |
| 69 | + # modifier_order |
| 70 | + - multiline_arguments |
| 71 | + - multiline_arguments_brackets |
| 72 | + - multiline_function_chains |
| 73 | + - multiline_literal_brackets |
| 74 | + - multiline_parameters |
| 75 | + - multiline_parameters_brackets |
| 76 | + - nimble_operator |
| 77 | + - no_empty_block |
| 78 | + - no_extension_access_modifier |
| 79 | + # no_grouping_extension |
| 80 | + - no_magic_numbers |
| 81 | + - non_overridable_class_declaration |
| 82 | + - nslocalizedstring_key |
| 83 | + - nslocalizedstring_require_bundle |
| 84 | + - number_separator |
| 85 | + - object_literal |
| 86 | + # one_declaration_per_file |
| 87 | + - operator_usage_whitespace |
| 88 | + - optional_enum_case_matching |
| 89 | + - overridden_super_call |
| 90 | + - override_in_extension |
| 91 | + - pattern_matching_keywords |
| 92 | + - period_spacing |
| 93 | + - prefer_key_path |
| 94 | + # prefer_nimble |
| 95 | + - prefer_self_in_static_references |
| 96 | + - prefer_self_type_over_type_of_self |
| 97 | + - prefer_zero_over_explicit_init |
| 98 | + - prefixed_toplevel_constant |
| 99 | + - private_action |
| 100 | + - private_outlet |
| 101 | + - private_subject |
| 102 | + - private_swiftui_state |
| 103 | + - prohibited_interface_builder |
| 104 | + - prohibited_super_call |
| 105 | + - quick_discouraged_call |
| 106 | + - quick_discouraged_focused_test |
| 107 | + - quick_discouraged_pending_test |
| 108 | + - raw_value_for_camel_cased_codable_enum |
| 109 | + - reduce_into |
| 110 | + - redundant_nil_coalescing |
| 111 | + - redundant_self_in_closure |
| 112 | + - redundant_type_annotation |
| 113 | + # required_deinit |
| 114 | + - required_enum_case |
| 115 | + - return_value_from_void_function |
| 116 | + - self_binding |
| 117 | + - shorthand_argument |
| 118 | + - shorthand_optional_binding |
| 119 | + - single_test_class |
| 120 | + # sorted_enum_cases |
| 121 | + - sorted_first_last |
| 122 | + # sorted_imports |
| 123 | + - static_operator |
| 124 | + # strict_fileprivate |
| 125 | + - strong_iboutlet |
| 126 | + - superfluous_else |
| 127 | + - switch_case_on_newline |
| 128 | + - test_case_accessibility |
| 129 | + - toggle_bool |
| 130 | + # trailing_closure |
| 131 | + - type_contents_order |
| 132 | + - unavailable_function |
| 133 | + - unhandled_throwing_task |
| 134 | + - unneeded_parentheses_in_closure_argument |
| 135 | + - unowned_variable_capture |
| 136 | + - untyped_error_in_catch |
| 137 | + - unused_parameter |
| 138 | + - vertical_parameter_alignment_on_call |
| 139 | + # vertical_whitespace_between_cases |
| 140 | + # vertical_whitespace_closing_braces |
| 141 | + # vertical_whitespace_opening_braces |
| 142 | + - weak_delegate |
| 143 | + - xct_specific_matcher |
| 144 | + # yoda_condition |
| 145 | + |
| 146 | +analyzer_rules: |
| 147 | + - capture_variable |
| 148 | + # explicit_self |
| 149 | + - typesafe_array_init |
| 150 | + - unused_declaration |
| 151 | + - unused_import |
| 152 | + |
| 153 | +file_header: |
| 154 | + required_pattern: | |
| 155 | + // |
| 156 | + // SWIFTLINT_CURRENT_FILENAME |
| 157 | + // PrincipleMacros |
| 158 | + // |
| 159 | + // Created by .+ on \d{2}/\d{2}/\d{4}\. |
| 160 | + // Copyright © \d{4} .+\. All rights reserved\. |
| 161 | + // |
| 162 | +
|
| 163 | +file_length: |
| 164 | + warning: 500 |
| 165 | + |
| 166 | +identifier_name: |
| 167 | + excluded: [id, x, y, z] |
| 168 | + |
| 169 | +nesting: |
| 170 | + type_level: 2 |
| 171 | + |
| 172 | +type_name: |
| 173 | + allowed_symbols: ["_"] |
| 174 | + max_length: 50 |
| 175 | + |
| 176 | +type_contents_order: |
| 177 | + order: [[case], [type_alias, associated_type], [subtype], [type_property], [instance_property], [ib_inspectable], [ib_outlet], [initializer], [deinitializer], [type_method], [view_life_cycle_method], [ib_action, ib_segue_action], [other_method], [subscript]] |
| 178 | + |
| 179 | +custom_rules: |
| 180 | + global_actor_attribute_order: |
| 181 | + name: "Global actor attribute order" |
| 182 | + message: "Global actor should be the first attribute." |
| 183 | + regex: "(?-s)(@.+[^,\\s]\\s+@.*Actor)" |
| 184 | + sendable_attribute_order: |
| 185 | + name: "Sendable attribute order" |
| 186 | + message: "Sendable should be the first attribute." |
| 187 | + regex: "(?-s)(@.+[^,\\s]\\s+@Sendable)" |
| 188 | + autoclosure_attribute_order: |
| 189 | + name: "Autoclosure attribute order" |
| 190 | + message: "Autoclosure should be the last attribute." |
| 191 | + regex: "(?-s)(@autoclosure\\s+@.+)" |
| 192 | + empty_line_after_type_declaration: |
| 193 | + name: "Empty line after type declaration" |
| 194 | + message: "Type declaration should start with an empty line." |
| 195 | + regex: "( |^)(actor|class|struct|enum|protocol|extension) (?!var)[^\\{]*? \\{(?!\\}) *\\n? *\\S" |
0 commit comments