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

Erroneous comma applied onto property with comment #1676

Closed
vanniktech opened this issue Oct 12, 2022 · 0 comments · Fixed by #1695
Closed

Erroneous comma applied onto property with comment #1676

vanniktech opened this issue Oct 12, 2022 · 0 comments · Fixed by #1695

Comments

@vanniktech
Copy link
Contributor

For the given Kotlin Code:

@Serializable data class Something(
  @SerialName("foo") val foo: Int,
  /** Comment. */
)

when running ktlint -F with the following configuration & experimental enabled:

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

There's an erroneous added:

-  @SerialName("james_template") val jamesTemplate: JamesTemplateDto,
+  @SerialName("james_template") val jamesTemplate: JamesTemplateDto,,

Here is the console output:

Repro.kt:1:34: Whitespace after ',' is missing (experimental:parameter-list-spacing)
Repro.kt:1:35: Missing spacing after "," (comma-spacing)
Repro.kt:2:1: Missing trailing comma before ")" (trailing-comma-on-declaration-site)

@paul-dingemans paul-dingemans added this to the 0.48.0 milestone Oct 12, 2022
paul-dingemans added a commit to paul-dingemans/ktlint that referenced this issue Nov 2, 2022
… followed by a KDOC `trailing-comma-on-declaration-site` and `trailing-comma-on-call-site`

Closes pinterest#1676
paul-dingemans added a commit that referenced this issue Nov 6, 2022
… followed by a KDOC `trailing-comma-on-declaration-site` and `trailing-comma-on-call-site` (#1695)

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

Successfully merging a pull request may close this issue.

2 participants