Swift Syntax Dashboard
Efforts are actively under way to migrate most rules off SourceKit to use SwiftSyntax instead.
Rules written using SwiftSyntax tend to be significantly faster and have fewer false positives than rules that use SourceKit to get source structure information.
23 out of 239 (9%) of SwiftLint’s linter rules use SourceKit.
Rules Using SourceKit
Default Rules (6)
custom_rules
: Custom Rulesfile_length
: File Lengthline_length
: Line Lengthstatement_position
: Statement Positiontrailing_whitespace
: Trailing Whitespacevertical_whitespace
: Vertical Whitespace
Opt-in Rules (17)
accessibility_label_for_image
: Accessibility Label for Imageaccessibility_trait_for_button
: Accessibility Trait for Buttonclosure_end_indentation
: Closure End Indentationexpiring_todo
: Expiring Todofile_header
: File Headerfile_types_order
: File Types Orderindentation_width
: Indentation Widthliteral_expression_end_indentation
: Literal Expression End Indentationmodifier_order
: Modifier Ordermultiline_function_chains
: Multiline Function Chainsmultiline_parameters_brackets
: Multiline Parameters Bracketsquick_discouraged_call
: Quick Discouraged Callsorted_imports
: Sorted Importstype_contents_order
: Type Contents Ordervertical_whitespace_between_cases
: Vertical Whitespace Between Casesvertical_whitespace_closing_braces
: Vertical Whitespace before Closing Bracesvertical_whitespace_opening_braces
: Vertical Whitespace after Opening Braces
Rules not Using SourceKit
Default Rules (93)
attribute_name_spacing
: Attribute Name Spacingblanket_disable_command
: Blanket Disable Commandblock_based_kvo
: Block Based KVOclass_delegate_protocol
: Class Delegate Protocolclosing_brace
: Closing Brace Spacingclosure_parameter_position
: Closure Parameter Positioncolon
: Colon Spacingcomma
: Comma Spacingcomment_spacing
: Comment Spacingcompiler_protocol_init
: Compiler Protocol Initcomputed_accessors_order
: Computed Accessors Ordercontrol_statement
: Control Statementcyclomatic_complexity
: Cyclomatic Complexitydeployment_target
: Deployment Targetdiscouraged_direct_init
: Discouraged Direct Initializationduplicate_conditions
: Duplicate Conditionsduplicate_enum_cases
: Duplicate Enum Casesduplicate_imports
: Duplicate Importsduplicated_key_in_dictionary_literal
: Duplicated Key in Dictionary Literaldynamic_inline
: Dynamic Inlineempty_enum_arguments
: Empty Enum Argumentsempty_parameters
: Empty Parametersempty_parentheses_with_trailing_closure
: Empty Parentheses with Trailing Closurefor_where
: Prefer For-Whereforce_cast
: Force Castforce_try
: Force Tryfunction_body_length
: Function Body Lengthfunction_parameter_count
: Function Parameter Countgeneric_type_name
: Generic Type Nameidentifier_name
: Identifier Nameimplicit_getter
: Implicit Getterinclusive_language
: Inclusive Languageinvalid_swiftlint_command
: Invalid SwiftLint Commandis_disjoint
: Is Disjointlarge_tuple
: Large Tupleleading_whitespace
: Leading Whitespacelegacy_cggeometry_functions
: Legacy CGGeometry Functionslegacy_constant
: Legacy Constantlegacy_constructor
: Legacy Constructorlegacy_hashing
: Legacy Hashinglegacy_nsgeometry_functions
: Legacy NSGeometry Functionslegacy_random
: Legacy Randommark
: Markmultiple_closures_with_trailing_closure
: Multiple Closures with Trailing Closurenesting
: Nestingno_fallthrough_only
: No Fallthrough onlyno_space_in_method_call
: No Space in Method Callnon_optional_string_data_conversion
: Non-optional String -> Data Conversionnotification_center_detachment
: Notification Center Detachmentns_number_init_as_function_reference
: NSNumber Init as Function Referencensobject_prefer_isequal
: NSObject Prefer isEqualopening_brace
: Opening Brace Spacingoperator_whitespace
: Operator Function Whitespaceoptional_data_string_conversion
: Optional Data -> String Conversionorphaned_doc_comment
: Orphaned Doc Commentprefer_type_checking
: Prefer Type Checkingprivate_over_fileprivate
: Private over Fileprivateprivate_unit_test
: Private Unit Testprotocol_property_accessors_order
: Protocol Property Accessors Orderreduce_boolean
: Reduce Booleanredundant_discardable_let
: Redundant Discardable Letredundant_objc_attribute
: Redundant @objc Attributeredundant_optional_initialization
: Redundant Optional Initializationredundant_set_access_control
: Redundant Access Control for Setterredundant_string_enum_value
: Redundant String Enum Valueredundant_void_return
: Redundant Void Returnreturn_arrow_whitespace
: Returning Whitespaceself_in_property_initialization
: Self in Property Initializationshorthand_operator
: Shorthand Operatorstatic_over_final_class
: Static Over Final Classsuperfluous_disable_command
: Superfluous Disable Commandswitch_case_alignment
: Switch and Case Statement Alignmentsyntactic_sugar
: Syntactic Sugartodo
: Todotrailing_comma
: Trailing Commatrailing_newline
: Trailing Newlinetrailing_semicolon
: Trailing Semicolontype_body_length
: Type Body Lengthtype_name
: Type Nameunavailable_condition
: Unavailable Conditionunneeded_break_in_switch
: Unneeded Break in Switchunneeded_override
: Unneeded Overridden Functionsunneeded_synthesized_initializer
: Unneeded Synthesized Initializerunused_closure_parameter
: Unused Closure Parameterunused_control_flow_label
: Unused Control Flow Labelunused_enumerated
: Unused Enumeratedunused_optional_binding
: Unused Optional Bindingunused_setter_value
: Unused Setter Valuevalid_ibinspectable
: Valid IBInspectablevertical_parameter_alignment
: Vertical Parameter Alignmentvoid_function_in_ternary
: Void Function in Ternaryvoid_return
: Void Returnxctfail_message
: XCTFail Message
Opt-in Rules (123)
anonymous_argument_in_multiline_closure
: Anonymous Argument in Multiline Closurearray_init
: Array Initattributes
: Attributesbalanced_xctest_lifecycle
: Balanced XCTest Life Cycleclosure_body_length
: Closure Body Lengthclosure_spacing
: Closure Spacingcollection_alignment
: Collection Element Alignmentcomma_inheritance
: Comma Inheritance Ruleconditional_returns_on_newline
: Conditional Returns on Newlinecontains_over_filter_count
: Contains over Filter Countcontains_over_filter_is_empty
: Contains over Filter is Emptycontains_over_first_not_nil
: Contains over First not Nilcontains_over_range_nil_comparison
: Contains over Range Comparison to Nilcontrasted_opening_brace
: Contrasted Opening Braceconvenience_type
: Convenience Typedirect_return
: Direct Returndiscarded_notification_center_observer
: Discarded Notification Center Observerdiscouraged_assert
: Discouraged Assertdiscouraged_none_name
: Discouraged None Namediscouraged_object_literal
: Discouraged Object Literaldiscouraged_optional_boolean
: Discouraged Optional Booleandiscouraged_optional_collection
: Discouraged Optional Collectionempty_collection_literal
: Empty Collection Literalempty_count
: Empty Countempty_string
: Empty Stringempty_xctest_method
: Empty XCTest Methodenum_case_associated_values_count
: Enum Case Associated Values Countexplicit_acl
: Explicit ACLexplicit_enum_raw_value
: Explicit Enum Raw Valueexplicit_init
: Explicit Initexplicit_top_level_acl
: Explicit Top Level ACLexplicit_type_interface
: Explicit Type Interfaceextension_access_modifier
: Extension Access Modifierfallthrough
: Fallthroughfatal_error_message
: Fatal Error Messagefile_name
: File Namefile_name_no_space
: File Name no Spacefinal_test_case
: Final Test Casefirst_where
: First Whereflatmap_over_map_reduce
: Flat Map over Map Reduceforce_unwrapping
: Force Unwrappingfunction_default_parameter_at_end
: Function Default Parameter at Endibinspectable_in_extension
: IBInspectable in Extensionidentical_operands
: Identical Operandsimplicit_return
: Implicit Returnimplicitly_unwrapped_optional
: Implicitly Unwrapped Optionalinert_defer
: Inert Deferjoined_default_parameter
: Joined Default Parameterlast_where
: Last Wherelegacy_multiple
: Legacy Multiplelegacy_objc_type
: Legacy Objective-C Reference Typelet_var_whitespace
: Variable Declaration Whitespacelocal_doc_comment
: Local Doc Commentlower_acl_than_parent
: Lower ACL than Parentmissing_docs
: Missing Docsmultiline_arguments
: Multiline Argumentsmultiline_arguments_brackets
: Multiline Arguments Bracketsmultiline_literal_brackets
: Multiline Literal Bracketsmultiline_parameters
: Multiline Parametersnimble_operator
: Nimble Operatorno_empty_block
: No Empty Blockno_extension_access_modifier
: No Extension Access Modifierno_grouping_extension
: No Grouping Extensionno_magic_numbers
: No Magic Numbersnon_overridable_class_declaration
: Class Declaration in Final Classnslocalizedstring_key
: NSLocalizedString Keynslocalizedstring_require_bundle
: NSLocalizedString Require Bundlenumber_separator
: Number Separatorobject_literal
: Object Literalone_declaration_per_file
: One Declaration per Fileoperator_usage_whitespace
: Operator Usage Whitespaceoptional_enum_case_matching
: Optional Enum Case Matchoverridden_super_call
: Overridden Method Calls Superoverride_in_extension
: Override in Extensionpattern_matching_keywords
: Pattern Matching Keywordsperiod_spacing
: Period Spacingprefer_key_path
: Prefer Key Pathprefer_nimble
: Prefer Nimbleprefer_self_in_static_references
: Prefer Self in Static Referencesprefer_self_type_over_type_of_self
: Prefer Self Type Over Type of Selfprefer_zero_over_explicit_init
: Prefer Zero Over Explicit Initprefixed_toplevel_constant
: Prefixed Top-Level Constantprivate_action
: Private Actionsprivate_outlet
: Private Outletsprivate_subject
: Private Combine Subjectprivate_swiftui_state
: Private SwiftUI State Propertiesprohibited_interface_builder
: Prohibited Interface Builderprohibited_super_call
: Prohibited Calls to Superquick_discouraged_focused_test
: Quick Discouraged Focused Testquick_discouraged_pending_test
: Quick Discouraged Pending Testraw_value_for_camel_cased_codable_enum
: Raw Value for Camel Cased Codable Enumreduce_into
: Reduce intoredundant_nil_coalescing
: Redundant Nil Coalescingredundant_self_in_closure
: Redundant Self in Closureredundant_type_annotation
: Redundant Type Annotationrequired_deinit
: Required Deinitrequired_enum_case
: Required Enum Casereturn_value_from_void_function
: Return Value from Void Functionself_binding
: Self Bindingshorthand_argument
: Shorthand Argumentshorthand_optional_binding
: Shorthand Optional Bindingsingle_test_class
: Single Test Classsorted_enum_cases
: Sorted Enum Casessorted_first_last
: Min or Max over Sorted First or Laststatic_operator
: Static Operatorstrict_fileprivate
: Strict Fileprivatestrong_iboutlet
: Strong IBOutletsuperfluous_else
: Superfluous Elseswitch_case_on_newline
: Cases on Newlinetest_case_accessibility
: Test Case Accessibilitytoggle_bool
: Toggle Booltrailing_closure
: Trailing Closureunavailable_function
: Unavailable Functionunhandled_throwing_task
: Unhandled Throwing Taskunneeded_parentheses_in_closure_argument
: Unneeded Parentheses in Closure Argumentunowned_variable_capture
: Unowned Variable Captureuntyped_error_in_catch
: Untyped Error in Catchunused_capture_list
: Unused Capture Listunused_parameter
: Unused Parametervertical_parameter_alignment_on_call
: Vertical Parameter Alignment on Callweak_delegate
: Weak Delegatexct_specific_matcher
: XCTest Specific Matcheryoda_condition
: Yoda Condition