Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closure_end_indentation with function chain #2969

Open
2 tasks done
417-72KI opened this issue Nov 18, 2019 · 4 comments
Open
2 tasks done

closure_end_indentation with function chain #2969

417-72KI opened this issue Nov 18, 2019 · 4 comments
Labels

Comments

@417-72KI
Copy link
Contributor

New Issue Checklist

Describe the bug

When closure_end_indentation is enabled and run autocorrect, function chain including multiline closure will be indented strange.

Before autocorrect

someThing.funcA()
    .funcB()
    .funcC {
        // do something
}
.funcD()
.funcE()

After autocorrect

someThing.funcA()
    .funcB()
    .funcC {
        // do something
    }
.funcD() // <- This line should be indented with 4 spaces (aligned with above)
.funcE() // <- This line either
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint autocorrect

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    0.36.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    CocoaPods
  • Paste your configuration file:
opt_in_rules:
  - anyobject_protocol
  - array_init
  - attributes
  - closure_body_length
  - closure_end_indentation
  - closure_spacing
  - collection_alignment
  - conditional_returns_on_newline
  - contains_over_filter_count
  - contains_over_filter_is_empty
  - contains_over_first_not_nil
  - convenience_type
  - discouraged_object_literal
  - discouraged_optional_boolean
  - discouraged_optional_collection
  - empty_collection_literal
  - empty_count
  - empty_string
  - empty_xctest_method
  - explicit_acl
  - explicit_enum_raw_value
  - explicit_init
  - explicit_self
  - explicit_top_level_acl
  - explicit_type_interface
  - extension_access_modifier
  - fallthrough
  - fatal_error_message
  - file_header
  - file_name
  - file_types_order
  - first_where
  - force_unwrapping
  - function_default_parameter_at_end
  - identical_operands
  - implicit_return
  - implicitly_unwrapped_optional
  - joined_default_parameter
  - last_where
  - legacy_multiple
  - legacy_random
  - let_var_whitespace
  - literal_expression_end_indentation
  - lower_acl_than_parent
  - missing_docs
  - modifier_order
  - multiline_arguments
  - multiline_arguments_brackets
  - multiline_function_chains
  - multiline_literal_brackets
  - multiline_parameters
  - multiline_parameters_brackets
  - nimble_operator
  - no_extension_access_modifier
  - no_grouping_extension
  - nslocalizedstring_key
  - nslocalizedstring_require_bundle
  - number_separator
  - object_literal
  - operator_usage_whitespace
  - overridden_super_call
  - override_in_extension
  - pattern_matching_keywords
  - prefixed_toplevel_constant
  - private_action
  - private_outlet
  - prohibited_interface_builder
  - prohibited_super_call
  - quick_discouraged_call
  - quick_discouraged_focused_test
  - quick_discouraged_pending_test
  - reduce_into
  - redundant_nil_coalescing
  - redundant_type_annotation
  - required_deinit
  - required_enum_case
  - single_test_class
  - sorted_first_last
  - sorted_imports
  - static_operator
  - strict_fileprivate
  - strong_iboutlet
  - switch_case_on_newline
  - toggle_bool
  - trailing_closure
  - type_contents_order
  - unavailable_function
  - unneeded_parentheses_in_closure_argument
  - unowned_variable_capture
  - untyped_error_in_catch
  - unused_declaration
  - unused_import
  - vertical_parameter_alignment_on_call
  - vertical_whitespace_between_cases
  - vertical_whitespace_closing_braces
  - vertical_whitespace_opening_braces
  - xct_specific_matcher
  - yoda_condition
disabled_rules:
  - conditional_returns_on_newline
  - explicit_acl
  - explicit_enum_raw_value
  - explicit_top_level_acl
  - explicit_type_interface
  - extension_access_modifier
  - fatal_error_message
  - file_header
  - file_name
  - file_types_order
  - function_default_parameter_at_end
  - implicitly_unwrapped_optional
  - lower_acl_than_parent
  - missing_docs
  - no_extension_access_modifier
  - no_grouping_extension
  - number_separator
  - object_literal
  - prefixed_toplevel_constant
  - prohibited_interface_builder
  - required_deinit
  - strict_fileprivate
  - strong_iboutlet
  - switch_case_on_newline
  - trailing_closure
  - unowned_variable_capture
  - unused_optional_binding
  - vertical_whitespace_between_cases
  - convenience_type
  - fallthrough
  - line_length
  - no_fallthrough_only
  - sorted_imports
  - type_contents_order
  - closure_body_length
  - discouraged_optional_boolean
  - discouraged_optional_collection
  - file_length
  - force_cast
  - force_try
  - force_unwrapping
  - function_body_length
  - type_body_length
  - type_name
  - identifier_name
line_length:
  warning: 180
  ignores_urls: true
  ignores_function_declarations: true
  ignores_comments: true
  ignores_interpolated_strings: true
file_length:
  ignore_comment_only_lines: true
cyclomatic_complexity:
  ignores_case_statements: true
explicit_type_interface:
  allow_redundancy: true
  excluded:
    - local
large_tuple:
  warning: 3
  error: 4
shorthand_operator: warning
nesting:
  type_level: 3
attributes:
  always_on_same_line:
    - '@IBAction'
    - '@NSManaged'
    - '@objc'
multiline_arguments:
    only_enforce_after_first_closure_on_first_line: true
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.
    No
  • Which Xcode version are you using (check xcode-select -p)?
    Version 11.2.1 (11B500)
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix label Nov 8, 2020
@417-72KI
Copy link
Contributor Author

I wish it won't be closed

@stale stale bot removed the wontfix label Nov 10, 2020
@stale
Copy link

stale bot commented Jan 9, 2021

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix label Jan 9, 2021
@417-72KI
Copy link
Contributor Author

don't close

@stale stale bot removed the wontfix label Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants