Skip to content

Slowdown when adding excluded files #6028

@Ernest0-Production

Description

@Ernest0-Production

New Issue Checklist

Bug Description

I ran benchmarks and noticed that the linter starts to run for a loooong time if swiftlint.yml contains excluded files/folders.

The waiting time does not depend on the number of rules in the config and the number of files to lint.

When I commented out the excluded block, the lint passed instantly!

excluded:
  - .build                                # SPM artifacts
  - ./**/Generated/*              # SwiftGen artifacts
  - ./**/Derived/Sources/*    # Tuist artifacts
  - Tuist/
  - ./**/Project.swift
  - Workspace.swift

Environment

  • SwiftLint version 0.58.2
  • Xcode version 16.2
  • Installation method used mise-en-place
  • Configuration file:
disabled_rules: # rule identifiers to exclude from running
  - line_length
  - function_body_length
  - type_body_length
  - file_length
  - trailing_comma
  - redundant_type_annotation
  - todo
  - inclusive_language

opt_in_rules:
  - array_init
  - closure_end_indentation
  - closure_spacing
  - collection_alignment
  - contains_over_filter_count
  - contains_over_filter_is_empty
  - contains_over_first_not_nil
  - contains_over_range_nil_comparison
  - empty_collection_literal
  - explicit_init
  - first_where
  - flatmap_over_map_reduce
  - last_where
  - legacy_multiple
  - legacy_random
  - let_var_whitespace
  - object_literal
  - operator_usage_whitespace
  - overridden_super_call
  - raw_value_for_camel_cased_codable_enum
  - redundant_nil_coalescing
  - redundant_type_annotation
  - sorted_first_last
  - sorted_imports
  - toggle_bool
  - unneeded_parentheses_in_closure_argument
  - yoda_condition
  - implicit_return
  - force_unwrapping
  - fatal_error_message
  - file_name_no_space
  - joined_default_parameter
  - nslocalizedstring_key
  - switch_case_on_newline
  - empty_count
  - unowned_variable_capture
  - multiline_parameters
  - multiline_parameters_brackets
  - no_space_in_method_call
  - private_action
  - vertical_whitespace_closing_braces
  - literal_expression_end_indentation
  - modifier_order
  - number_separator
  - optional_enum_case_matching
  - unavailable_function
  - multiline_literal_brackets
  - multiline_arguments
  - multiline_function_chains
  - vertical_parameter_alignment_on_call
  - indentation_width
  - empty_string
  - weak_delegate
  - missing_docs
  - multiline_arguments_brackets

analyzer_rules:
  - unused_declaration
  - unused_import
excluded:
  - .build
  - ./**/Generated/*
  - ./**/Derived/Sources/*
  - Tuist/
  - ./**/Project.swift
  - Workspace.swift

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected and reproducible misbehavior.duplicateIssues that already exist in other terms.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions