Last active
February 24, 2025 12:17
-
-
Save T1T4N/662c0676e67be158ce4161fd60aa0ea3 to your computer and use it in GitHub Desktop.
Default SwiftLint configuration as only_rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # strict: true | |
| # File organization | |
| # included: | |
| # - Sources | |
| # - Tests | |
| excluded: | |
| - .build | |
| - .swiftpm | |
| - DerivedData | |
| - Pods | |
| - Tests | |
| analyzer_rules: | |
| - capture_variable | |
| - explicit_self # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#explicit-self | |
| - typesafe_array_init | |
| - unused_declaration # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#unused-declaration | |
| - unused_import # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#unused-import | |
| only_rules: | |
| - attribute_name_spacing | |
| - blanket_disable_command | |
| - block_based_kvo # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#block-based-kvo | |
| - class_delegate_protocol # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#class-delegate-protocol | |
| - closing_brace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#closing-brace-spacing | |
| - closure_parameter_position | |
| - colon # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#colon | |
| - comma # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#comma-spacing | |
| - comment_spacing | |
| - compiler_protocol_init # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#compiler-protocol-init | |
| - computed_accessors_order | |
| - control_statement # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#control-statement | |
| - custom_rules | |
| - cyclomatic_complexity # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#cyclomatic-complexity | |
| - deployment_target # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#deployment-target | |
| - discouraged_direct_init | |
| - duplicate_conditions | |
| - duplicate_enum_cases # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#duplicate-enum-cases | |
| - duplicate_imports | |
| - duplicated_key_in_dictionary_literal | |
| - dynamic_inline # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#dynamic-inline | |
| - empty_enum_arguments | |
| - empty_parameters # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#empty-parameters | |
| - empty_parentheses_with_trailing_closure # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#empty-parentheses-with-trailing-closure | |
| - file_length # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#file-line-length | |
| - for_where | |
| - force_cast # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#force-cast | |
| - force_try # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#force-try | |
| - function_body_length | |
| - function_parameter_count # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#function-parameter-count | |
| - generic_type_name # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#generic-type-name | |
| - identifier_name # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#identifier-name | |
| - implicit_getter # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#implicit-getter | |
| - inclusive_language | |
| # - inert_defer # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#inert-defer | |
| - invalid_swiftlint_command | |
| - is_disjoint # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#is-disjoint | |
| - large_tuple # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#large-tuple | |
| - leading_whitespace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#leading-whitespace | |
| - legacy_cggeometry_functions # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#legacy-cggeometry-functions | |
| - legacy_constant # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#legacy-constant | |
| - legacy_constructor # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#legacy-constructor | |
| - legacy_hashing | |
| - legacy_nsgeometry_functions | |
| - legacy_random | |
| - line_length # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#line-length | |
| - mark # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#mark | |
| - multiple_closures_with_trailing_closure # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#multiple-closures-with-trailing-closure | |
| - nesting # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#nesting | |
| - no_fallthrough_only | |
| - no_space_in_method_call | |
| - non_optional_string_data_conversion | |
| - notification_center_detachment | |
| - ns_number_init_as_function_reference | |
| - nsobject_prefer_isequal # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#nsobject-prefer-isequal | |
| - opening_brace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#opening-brace-spacing | |
| - operator_whitespace | |
| - optional_data_string_conversion | |
| - orphaned_doc_comment # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#orphaned-doc-comment | |
| - prefer_type_checking | |
| - private_over_fileprivate | |
| - private_unit_test | |
| - protocol_property_accessors_order # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#protocol-property-accessors-order | |
| - reduce_boolean | |
| - redundant_discardable_let # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#redundant-discardable-let | |
| - redundant_objc_attribute | |
| - redundant_optional_initialization | |
| - redundant_sendable | |
| - redundant_set_access_control | |
| - redundant_string_enum_value | |
| - redundant_void_return # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#redundant-void-return | |
| - return_arrow_whitespace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#returning-whitespace | |
| - self_in_property_initialization | |
| - shorthand_operator # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#shorthand-operator | |
| - statement_position # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#statement-position | |
| - static_over_final_class | |
| - superfluous_disable_command # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#superfluous-disable-command | |
| - switch_case_alignment # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#switch-and-case-statement-alignment | |
| - syntactic_sugar # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#syntactic-sugar | |
| - todo | |
| - trailing_comma # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#trailing-comma | |
| - trailing_newline # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#trailing-newline | |
| - trailing_semicolon # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#trailing-semicolon | |
| - trailing_whitespace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#trailing-whitespace | |
| - type_body_length | |
| - type_name # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#type-name | |
| - unavailable_condition | |
| - unneeded_break_in_switch # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#unneeded-break-in-switch | |
| - unneeded_override | |
| - unneeded_synthesized_initializer | |
| - unused_closure_parameter | |
| - unused_control_flow_label | |
| - unused_enumerated | |
| - unused_optional_binding | |
| - unused_setter_value | |
| - valid_ibinspectable | |
| - vertical_parameter_alignment # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#vertical-parameter-alignment | |
| - vertical_whitespace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#vertical-whitespace | |
| - void_function_in_ternary | |
| - void_return | |
| - xctfail_message # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#xctfail-message | |
| ## opt_in_rules: | |
| # - accessibility_label_for_image | |
| # - accessibility_trait_for_button | |
| # - anonymous_argument_in_multiline_closure | |
| # - array_init | |
| # - async_without_await | |
| # - attributes | |
| # - balanced_xctest_lifecycle | |
| # - closure_body_length | |
| # - closure_end_indentation | |
| # - closure_spacing | |
| # - collection_alignment | |
| # - comma_inheritance | |
| # - conditional_returns_on_newline | |
| # - contains_over_filter_count | |
| # - contains_over_filter_is_empty | |
| # - contains_over_first_not_nil | |
| # - contains_over_range_nil_comparison | |
| # - contrasted_opening_brace | |
| # - convenience_type | |
| # - direct_return | |
| # - discarded_notification_center_observer # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#discarded-notification-center-observer | |
| # - discouraged_assert | |
| # - discouraged_none_name | |
| # - discouraged_object_literal | |
| # - discouraged_optional_boolean | |
| # - discouraged_optional_collection | |
| # - empty_collection_literal | |
| # - empty_count | |
| # - empty_string | |
| # - empty_xctest_method | |
| # - enum_case_associated_values_count | |
| # - expiring_todo | |
| # - explicit_acl # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#explicit-acl | |
| # - explicit_enum_raw_value | |
| # - explicit_init | |
| # - explicit_top_level_acl | |
| # - explicit_type_interface | |
| # - extension_access_modifier | |
| # - fallthrough # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#fallthrough | |
| # - fatal_error_message | |
| # - file_header | |
| # - file_name | |
| # - file_name_no_space | |
| # - file_types_order | |
| # - final_test_case | |
| # - first_where | |
| # - flatmap_over_map_reduce | |
| # - force_unwrapping | |
| # - function_default_parameter_at_end | |
| # - ibinspectable_in_extension | |
| # - identical_operands # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#identical-operands | |
| # - implicit_return | |
| # - implicitly_unwrapped_optional | |
| # - indentation_width | |
| # - joined_default_parameter | |
| # - last_where | |
| # - legacy_multiple | |
| # - legacy_objc_type | |
| # - let_var_whitespace | |
| # - literal_expression_end_indentation | |
| # - local_doc_comment | |
| # - lower_acl_than_parent | |
| # - missing_docs | |
| # - modifier_order # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#modifier-order | |
| # - multiline_arguments | |
| # - multiline_arguments_brackets | |
| # - multiline_function_chains | |
| # - multiline_literal_brackets | |
| # - multiline_parameters | |
| # - multiline_parameters_brackets | |
| # - nimble_operator # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#nimble-operator | |
| # - no_empty_block | |
| # - no_extension_access_modifier | |
| # - no_grouping_extension | |
| # - no_magic_numbers | |
| # - non_overridable_class_declaration | |
| # - nslocalizedstring_key | |
| # - nslocalizedstring_require_bundle | |
| # - number_separator | |
| # - object_literal | |
| # - one_declaration_per_file | |
| # - opaque_over_existential | |
| # - operator_usage_whitespace # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#operator-usage-whitespace | |
| # - optional_enum_case_matching | |
| # - overridden_super_call # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#overridden-methods-call-super | |
| # - override_in_extension | |
| # - pattern_matching_keywords # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#pattern-matching-keywords | |
| # - period_spacing | |
| # - prefer_key_path | |
| # - prefer_nimble | |
| # - prefer_self_in_static_references | |
| # - prefer_self_type_over_type_of_self # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#prefer-self-type-over-type-of-self | |
| # - prefer_zero_over_explicit_init | |
| # - prefixed_toplevel_constant | |
| # - private_action # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#private-actions | |
| # - private_outlet | |
| # - private_subject | |
| # - private_swiftui_state | |
| # - prohibited_interface_builder | |
| # - prohibited_super_call | |
| # - quick_discouraged_call | |
| # - quick_discouraged_focused_test | |
| # - quick_discouraged_pending_test | |
| # - raw_value_for_camel_cased_codable_enum | |
| # - reduce_into | |
| # - redundant_nil_coalescing # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#redundant-nil-coalescing | |
| # - redundant_self_in_closure | |
| # - redundant_type_annotation | |
| # - required_deinit | |
| # - required_enum_case # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#required-enum-case | |
| # - return_value_from_void_function | |
| # - self_binding | |
| # - shorthand_argument | |
| # - shorthand_optional_binding | |
| # - single_test_class | |
| # - sorted_enum_cases | |
| # - sorted_first_last | |
| # - sorted_imports # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#sorted-imports | |
| # - static_operator # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#static-operator | |
| # - strict_fileprivate | |
| # - strong_iboutlet | |
| # - superfluous_else | |
| # - switch_case_on_newline | |
| # - test_case_accessibility | |
| # - toggle_bool | |
| # - trailing_closure | |
| # - type_contents_order | |
| # - unavailable_function | |
| # - unhandled_throwing_task | |
| # - unneeded_parentheses_in_closure_argument # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#unneeded-parentheses-in-closure-argument | |
| # - unowned_variable_capture | |
| # - untyped_error_in_catch # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#untyped-error-in-catch | |
| # - unused_parameter | |
| # - vertical_parameter_alignment_on_call | |
| # - vertical_whitespace_between_cases | |
| # - vertical_whitespace_closing_braces | |
| # - vertical_whitespace_opening_braces | |
| # - weak_delegate # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#weak-delegate | |
| # - xct_specific_matcher | |
| # - yoda_condition | |
| ## MARK: Default configuration | |
| # attribute_name_spacing: | |
| # severity: error | |
| # | |
| # attributes: | |
| # severity: warning | |
| # always_on_line_above: [] # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#attributes | |
| # | |
| # balanced_xctest_lifecycle: # https://github.com/realm/SwiftLint/blob/4388c9f8991901845d1aaf74a3ffc93e2395f880/Rules.md#balanced-xctest-lifecycle | |
| # severity: warning | |
| # test_parent_classes: | |
| # - QuickSpec | |
| # - XCTestCase | |
| # | |
| # cyclomatic_complexity: | |
| # warning: 10 | |
| # error: 20 | |
| # ignores_case_statements: false | |
| # | |
| # deployment_target: | |
| # iOS_deployment_target: 9.0 | |
| # | |
| # explicit_acl: | |
| # severity: warning | |
| # | |
| # explicit_self: | |
| # severity: warning | |
| # | |
| # file_length: | |
| # warning: 400 | |
| # error: 1000 | |
| # ignore_comment_only_lines: false | |
| # | |
| # function_parameter_count: | |
| # warning: 5 | |
| # error: 8 | |
| # ignores_default_parameters: true | |
| # | |
| # generic_type_name: | |
| # min_length: | |
| # warning: 1 | |
| # error: 0 | |
| # max_length: | |
| # warning: 20 | |
| # error: 1000 | |
| # | |
| # identifier_name: | |
| # min_length: | |
| # warning: 3 | |
| # error: 2 | |
| # max_length: | |
| # warning: 40 | |
| # error: 60 | |
| # allowed_symbols: [] | |
| # excluded: | |
| # - “^id$” | |
| # | |
| # large_tuple: | |
| # warning: 2 | |
| # error: 3 | |
| # | |
| # line_length: | |
| # warning: 120 | |
| # error: 200 | |
| # ignores_urls: false | |
| # ignores_function_declarations: false | |
| # ignores_comments: false | |
| # ignores_interpolated_strings: false | |
| # | |
| # mark: | |
| # severity: warning | |
| # | |
| # nesting: | |
| # type_level: | |
| # warning: 1 | |
| # function_level: | |
| # warning: 2 | |
| # | |
| # overridden_super_call: | |
| # severity: warning | |
| # included: | |
| # - "*" | |
| # | |
| # trailing_comma: | |
| # severity: warning | |
| # mandatory_comma: false | |
| # | |
| # type_name: | |
| # min_length: | |
| # warning: 3 | |
| # error: 0 | |
| # max_length: | |
| # warning: 40 | |
| # error: 1000 | |
| # unallowed_symbols_severity: error | |
| # validates_start_with_lowercase: error | |
| # validate_protocols: true | |
| # | |
| # vertical_whitespace: | |
| # severity: warning | |
| # max_empty_lines: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment