Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

parameter-list-spacing conflicts with itself and other rules #1509

Closed
vanniktech opened this issue Jun 20, 2022 · 2 comments · Fixed by #1514
Closed

parameter-list-spacing conflicts with itself and other rules #1509

vanniktech opened this issue Jun 20, 2022 · 2 comments · Fixed by #1514
Milestone

Comments

@vanniktech
Copy link
Contributor

After updating to Version 0.46.0, the following line gets flagged when using the experimental flag:

private val isSelected: Boolean, // This is only here to invalidate all the other items.

:30:35: Unexpected whitespace (experimental:parameter-list-spacing)

When correcting it:

-private val isSelected: Boolean, // This is only here to invalidate all the other items.
+private val isSelected: Boolean,// This is only here to invalidate all the other items.

And running ktlint again, it conflicts with:

  • experimental:parameter-list-spacing
  • comma-spacing
  • comment-spacing
30:34: Whitespace after ',' is missing (experimental:parameter-list-spacing)
30:35: Missing spacing after "," (comma-spacing)
30:35: Missing space before // (comment-spacing)

So the initial error seems to be a false positive.

@paul-dingemans
Copy link
Collaborator

Can you please give a bit more context in which the line is used? I can not reproduce the problem. Also, specify the relevant .editorconfig settings.

@vanniktech
Copy link
Contributor Author

Editorconfig:

[*.{kt,kts}]
indent_size=2
continuation_indent_size=2
insert_final_newline=true
disabled_rules=annotation,argument-list-wrapping,spacing-between-declarations-with-annotations,trailing-comma,filename

The file:

data class FormDateData(
  val localDate: LocalDate,
  private val isSelected: Boolean, // This is only here to invalidate all the other items.
)

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

Successfully merging a pull request may close this issue.

2 participants