Experimental rules
Important
Up and until Ktlint version 0.47, experimental were located in a separate experimental rule set. As of Ktlint version 0.48, each rule set can optionally define experimental rules.
All experimental rules described below are part of the standard rule set of Ktlint. To enable all experimental rules (from all rule sets), set editorconfig property below:
Call expression wrapping¶
In case a call expression does not fit on the line, the lambda expression, and/or the value argument list after a reference expression are wrapped.
Rule id: standard:call-expression-wrapping
Suppress or disable rule (1)
- Suppress rule in code with annotation below:
Enable rule via
.editorconfigDisable rule via.editorconfig
Expression operand wrapping¶
Wraps each operand in a multiline expression to a separate line.
Rule id: standard:expression-operand-wrapping
Suppress or disable rule (1)
- Suppress rule in code with annotation below:
Enable rule via
.editorconfigDisable rule via.editorconfig
Lambda return¶
Do not use a labeled return for the last statement in a lambda.
Rule id: standard:lambda-return
Suppress or disable rule (1)
- Suppress rule in code with annotation below:
Enable rule via
.editorconfigDisable rule via.editorconfig
Package Import Spacing¶
Enforce one single blank line between package statement and imports
Rule id: standard:package-import-spacing
Suppress or disable rule (1)
- Suppress rule in code with annotation below:
Enable rule via
.editorconfigDisable rule via.editorconfig