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

Function-literal can format arguments into a commented out line #2850

Open
adecker89 opened this issue Oct 28, 2024 · 1 comment
Open

Function-literal can format arguments into a commented out line #2850

adecker89 opened this issue Oct 28, 2024 · 1 comment
Milestone

Comments

@adecker89
Copy link
Contributor

Expected Behavior

Given a comment inside a lambda argument definition function-literal rule should not produce breaking changes.

Steps to Reproduce

Example:

foo {
    //comment
    x, y ->
    x
}

is formatted to:

foo {
    // comment x, y ->
    x
}

Your Environment

  • Version of ktlint used: 1.4.0
@paul-dingemans
Copy link
Collaborator

paul-dingemans commented Oct 28, 2024

Tnx for reporting. This problem seems to exists starting from version 1.0.0. Did you find this problem while migrating from another ktlint version?

@paul-dingemans paul-dingemans added this to the 1.5 milestone Nov 18, 2024
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

No branches or pull requests

2 participants