-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Bug Description
If you have the code below present:
class BaseViewController: UIViewController {
func loadView(_ addViews: () -> Void) {
super.loadView()
addViews()
view.setNeedsUpdateConstraints()
}
}
class FooViewController: BaseViewController {
override func loadView() {
super.loadView {
self.configViews()
self.configTargets()
}
}
//...
}
When running the command below, the whole FooViewController.loadView
is removed, crashing the app.
$ swiftlint --fix
I caught this while doing code review, usually I use swiftlint --fix
before commiting the code:
Environment
- SwiftLint version: 0.57.1
- Xcode version: Xcode 15.4
- Installation method used: Homebrew
- Configuration file:
disabled_rules:
- identifier_name
- line_length
- todo
- cyclomatic_complexity
- type_body_length
- file_length
- function_body_length
- function_parameter_count
- nesting
- block_based_kvo
# Remove:
- unused_closure_parameter
- explicit_type_interface
- large_tuple
- inclusive_language
opt_in_rules: # some rules are only opt-in
- explicit_type_interface
- force_unwrapping
- implicit_return
- attributes
- closure_end_indentation
- closure_spacing
- conditional_returns_on_newline
- empty_string
- contains_over_first_not_nil
excluded:
- Carthage
- Pods
- UnitTests
- UITests
force_cast: warning
force_try: warning
Metadata
Metadata
Assignees
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.