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

Disable wrapping of parameters (ktlint_official) #1977

Closed
paul-dingemans opened this issue Apr 24, 2023 · 2 comments · Fixed by #1995
Closed

Disable wrapping of parameters (ktlint_official) #1977

paul-dingemans opened this issue Apr 24, 2023 · 2 comments · Fixed by #1995
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

Is there a way to have these rules apply only when the line exceeds max_line_length? It does not seem to currently.

Originally posted by @cdavie-artium in #1908 (comment)

@paul-dingemans
Copy link
Collaborator Author

The configuration parameter which ought to do this is broken unfortunately.

According to docs, the following setting should do the trick

ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than=-1

but value -1 is not accepted. It defaults value 2147483647 however also has no effect.

@paul-dingemans paul-dingemans added this to the 0.49.1 milestone Apr 24, 2023
paul-dingemans added a commit that referenced this issue May 5, 2023
…ure_rule_force_multiline_when_parameter_count_greater_or_equal_than` when using `ktlint_official` code style `function-signature`

Closes #1977
paul-dingemans added a commit that referenced this issue May 5, 2023
…ure_rule_force_multiline_when_parameter_count_greater_or_equal_than` when using `ktlint_official` code style `function-signature` (#1995)

Closes #1977
@paul-dingemans
Copy link
Collaborator Author

Please note that in the next release (or in the latest snapshot), this property needs to be set as follow to disable wrapping:

ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than=unset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant