From b8edd5cda17b7b6f63c8815f35b25eaa07df4df5 Mon Sep 17 00:00:00 2001 From: paul-dingemans Date: Mon, 11 Dec 2023 17:00:43 +0100 Subject: [PATCH] Add cross-references between `parameter-list-wrapping` and `function-signature` rules as both deal with wrapping parameters. Closes #2424 --- documentation/release-latest/docs/rules/standard.md | 8 +++++++- documentation/snapshot/docs/rules/standard.md | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/documentation/release-latest/docs/rules/standard.md b/documentation/release-latest/docs/rules/standard.md index a7629ab43d..5830375f01 100644 --- a/documentation/release-latest/docs/rules/standard.md +++ b/documentation/release-latest/docs/rules/standard.md @@ -195,6 +195,9 @@ Rewrites the function signature to a single line when possible (e.g. when not ex In `ktlint-official` code style, a function signature is always rewritten to a multiline signature in case the function has 2 or more parameters. This number of parameters can be set via `.editorconfig` property `ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than`. +!!! note + Wrapping of parameters is also influenced by the `parameter-list-wrapping` rule. + === "[:material-heart:](#) Ktlint" ```kotlin @@ -2276,7 +2279,10 @@ Rule id: `multiline-expression-wrapping` (`standard` rule set) ### Parameter list wrapping -When class/function signature doesn't fit on a single line, each parameter must be on a separate line +When class/function signature doesn't fit on a single line, each parameter must be on a separate line. + +!!! Note + Wrapping of parameters is also influenced by the `function-signature` rule. === "[:material-heart:](#) Ktlint" diff --git a/documentation/snapshot/docs/rules/standard.md b/documentation/snapshot/docs/rules/standard.md index 3e82373db4..4aea5c64b6 100644 --- a/documentation/snapshot/docs/rules/standard.md +++ b/documentation/snapshot/docs/rules/standard.md @@ -174,6 +174,9 @@ Rewrites the function signature to a single line when possible (e.g. when not ex In `ktlint-official` code style, a function signature is always rewritten to a multiline signature in case the function has 2 or more parameters. This number of parameters can be set via `.editorconfig` property `ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than`. +!!! note + Wrapping of parameters is also influenced by the `parameter-list-wrapping` rule. + === "[:material-heart:](#) Ktlint" ```kotlin @@ -2434,7 +2437,10 @@ Rule id: `multiline-expression-wrapping` (`standard` rule set) ### Parameter list wrapping -When class/function signature doesn't fit on a single line, each parameter must be on a separate line +When class/function signature doesn't fit on a single line, each parameter must be on a separate line. + +!!! Note + Wrapping of parameters is also influenced by the `function-signature` rule. === "[:material-heart:](#) Ktlint"