realm / realm/SwiftLint

`swiftlint --fix` is much slower than `swiftlint` even if there is nothing to fix

Open
#6,178 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Bug Description

swiftlint --fix is much slower than swiftlint even if there is nothing to fix

~/.local/share/mise/shims/swiftlint --fix --quiet -> 29.125s
~/.local/share/mise/shims/swiftlint --strict --quiet -> 6.235S
Environment
  • SwiftLint version (run swiftlint version to be sure) 0.59.1
  • Xcode version (run xcodebuild -version to be sure) Xcode 16.4 Build version 16F6
  • Installation method used (Homebrew, CocoaPods, building from source, etc) mise
  • Configuration file:
# insert yaml contents here
# https://realm.github.io/SwiftLint/rule-directory.html

disabled_rules:
  - block_based_kvo
  - nsobject_prefer_isequal
  - cyclomatic_complexity
  - file_length
  - force_cast
  - force_try
  - function_parameter_count
  - function_body_length
  - large_tuple
  - line_length
  - type_body_length
  - vertical_parameter_alignment
  - class_delegate_protocol
  - closure_parameter_position
  - compiler_protocol_init
  - identifier_name
  - inclusive_language
  - multiple_closures_with_trailing_closure
  - notification_center_detachment
  - operator_whitespace
  - redundant_string_enum_value
  - sorted_imports
  - shorthand_operator
  - todo
  - trailing_comma
  - type_name
  - xctfail_message

opt_in_rules:
  - collection_alignment
  - comma_inheritance
  - contains_over_filter_count
  - contains_over_filter_is_empty
  - contains_over_first_not_nil
  - convenience_type
  - closure_spacing
  - direct_return
  - file_header
  - first_where
  - flatmap_over_map_reduce
  - implicit_return
  - last_where
  - literal_expression_end_indentation
  - local_doc_comment
  - multiline_parameters
  - overridden_super_call
  - operator_usage_whitespace
  - prohibited_super_call
  - prefer_self_type_over_type_of_self
  - redundant_nil_coalescing
  - redundant_type_annotation
  - return_value_from_void_function
  - self_binding
  - shorthand_optional_binding
  - sorted_first_last
  - sorted_imports
  - unneeded_parentheses_in_closure_argument
  - vertical_whitespace_closing_braces

nesting:
  type_level:
    warning: 3
  function_level:
    warning: 1
  ignore_typealiases_and_associatedtypes: true

file_header:
  severity: warning
  forbidden_pattern: //\n//.+\.swift

excluded:
  - .idea
  - .build
  - .maestro
  - .winston
  - Tuist/.build
  - '**/Derived/**/*.swift'
  - ios-libs-monorepo
  - Modules/Shared/IconShared/Shared/Icon.generated.swift
  - XcodeTemplates

Are you using nested configurations? If so, paste their
relative paths and respective contents.
No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported comparison between swiftlint --fix --quiet - and swiftlint --strict --quiet - using SwiftLint 0.59.1, Xcode 16.4, and the supplied configuration. Trace the two command paths to determine why --fix performs extra work when no violations need fixing, then verify that the fix-mode runtime is comparable when the input requires no changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.