realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.45k stars 2.2k forks source link

Falsepositive multiline_arguments #5645

Open NikKovIos opened 3 days ago

NikKovIos commented 3 days ago

Version 0.51.0

            DispatchQueue.main.async {
                handler(self.userInfo, { animated, completion in                        <- multiline_arguments
                    self.delegate?.close(animated: animated, completion: completion)
                }, { error in
                    self.processError(error)
                })
            }

case checkPinCode(completion: PinCodeCheckingCompletion, cancelCompletion: PinCodeCancelClosure?)
typealias PinCodeCheckingCompletion = (_ userInfo: [String: Any]?, _ dismiss: @escaping PinCodeDismissCompletion, _ showError: @escaping PlatformErrorClosure) -> Void

Autolint enabled and line with handler(self.userInfo, and line { animated, completion in always concate.

SimplyDanny commented 3 days ago

Please be a bit more specific. Provide a simplified example together with your expectation and the location where the rule actually triggers. Also check your example with the latest release 0.55.1 and try if the rule's configuration options are of any help.

NikKovIos commented 3 days ago

Sorry, the code is under NDA.

swiftlint rules:

reporter: "xcode"
excluded:
    - ${PWD}/Pods
opt_in_rules:
    - attributes
    - vertical_whitespace_closing_braces
    - vertical_whitespace_opening_braces
    - conditional_returns_on_newline
    - vertical_parameter_alignment_on_call
    - closure_end_indentation
    - closure_spacing
    - collection_alignment
    - discarded_notification_center_observer
    - empty_string
    - literal_expression_end_indentation
    - modifier_order
    - multiline_arguments
    - multiline_function_chains
    - multiline_literal_brackets
    - multiline_parameters
    - operator_usage_whitespace
    - overridden_super_call
    - private_action
    - private_outlet
    - switch_case_on_newline
    - large_tuple
    - first_where
    - last_where
    - discouraged_object_literal
    - no_extension_access_modifier
    - yoda_condition
    - expiring_todo
    - discouraged_none_name
    - discouraged_assert
    - lower_acl_than_parent
    - prefer_self_in_static_references
    - prefer_self_type_over_type_of_self
    - prefer_zero_over_explicit_init
    - prefixed_toplevel_constant
    - redundant_nil_coalescing
    - sorted_first_last
    - static_operator
    - trailing_closure
    - unavailable_function
    - multiple_closures_with_trailing_closure

disabled_rules:
    - class_delegate_protocol
    - line_length
    - type_body_length
    - function_body_length
    - file_length
    - identifier_name
    - type_name
    - function_parameter_count
    - cyclomatic_complexity
    - inclusive_language
    - todo
    - large_tuple
    - force_cast
    - number_separator
nesting:
    type_level:
        warning: 3
conditional_returns_on_newline:
    if_only: true

trailing_closure:
    only_single_muted_parameter: true
    severity: error

unavailable_function:
    severity: error

attributes:
    severity: error

multiple_closures_with_trailing_closure:
    severity: error

private_outlet:
    severity: error
    allow_private_set: true

multiline_parameters:
    severity: error

multiline_literal_brackets:
    severity: error

vertical_parameter_alignment_on_call:
    severity: error

vertical_parameter_alignment:
    severity: error

multiline_arguments:
    severity: error

closure_parameter_position:
    severity: error
SimplyDanny commented 3 days ago

Sorry, the code is under NDA.

Sorry, but if you don't spend the effort to provide some simplified example to help people make sense of your code, you can also not expect anyone to fix this for you.

NikKovIos commented 3 days ago

There is already simplified example in first message. What's wrong with it?

SimplyDanny commented 3 days ago