You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatting is accepted by ktlint (see config below). Adding a context receiver, I would expect no change in the formatting of the function signature:
I believe ktlint wrongly treats the context as part of the signature when calculating its length because a slightly shorter version (fitting on a line including the context directive) is accepted:
The text was updated successfully, but these errors were encountered:
paul-dingemans
changed the title
context receivers cause unexepceted formatting of the function signature
context receivers cause unexpected formatting of the function signature
Sep 24, 2024
I believe ktlint wrongly treats the context as part of the signature when calculating its length because a slightly shorter version (fitting on a line including the context directive) is accepted:
Expected Behavior
Take the following function:
The formatting is accepted by ktlint (see config below). Adding a context receiver, I would expect no change in the formatting of the function signature:
Observed Behavior
ktlint formats as follows:
I believe ktlint wrongly treats the
context
as part of the signature when calculating its length because a slightly shorter version (fitting on a line including thecontext
directive) is accepted:Your Environment
The text was updated successfully, but these errors were encountered: