Skip to content
New issue

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

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

Already on GitHub? # to your account

Prevent possible conflict between multiline-expression-wrapping and function-signature body wrapping #2650

Closed
paul-dingemans opened this issue May 8, 2024 · 0 comments · Fixed by #2775
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

In case the multiline-expression-wrapping and function-signature rules are enabled, and setting function_signature_body_expression_wrapping is set to default, it may result in conflicts between the rule regarding whether a multiline body expression is to be wrapped or not.

Options:

  • Document that those rules affect each other and give recommendation
  • Automatically disable the multiline-expression-wrapping in case function-signature rule is enabled, and setting function_signature_body_expression_wrapping is set to default
  • Extract function body expression wrapping from function-signature rule and let this be handled by multiline-expression-wrapping only
paul-dingemans added a commit that referenced this issue Aug 20, 2024
…n-signature`

When `function-signature` rule is configured with `ktlint_function_signature_body_expression_wrapping` set to `default` then the first line of a multiline expression body should be kept on the same line as the end of function signature, as long as max line length is not exceeded. In this case the `multiline-expression-wrapping` rule has to ignore the multiline function expression body.

Closes #2650
paul-dingemans added a commit that referenced this issue Aug 20, 2024
@paul-dingemans paul-dingemans added this to the 1.4.0 milestone Aug 20, 2024
paul-dingemans added a commit that referenced this issue Aug 28, 2024
…n-signature` (#2775)

When `function-signature` rule is configured with `ktlint_function_signature_body_expression_wrapping` set to `default` then the first line of a multiline expression body should be kept on the same line as the end of function signature, as long as max line length is not exceeded. In this case the `multiline-expression-wrapping` rule has to ignore the multiline function expression body.

Closes #2650
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant