If you have a line comment in front of an annotati...
# ktlint
v
If you have a line comment in front of an annotation that describes the annotation like
Copy code
// work-around for <https://youtrack.jetbrains.com/issue/KT-38871>
// Kotlin 1.9+ and thus Gradle 8.3+ fixed it and no suppression is necessary anymore
@Suppress("UNUSED_VARIABLE")
val foo by gradle.extra {
    true
}
is it expected that ktlint adds a blank line between the comment and the annotation? Or can this be configured? Or would this warrant a bug report?
j
I use (attempting this on mobile slack so no promises...)
Copy code
@Suppress(
  // Explain
  "The thing",
)
Which lets me do multiple without changing the format or breaking the blame
v
Thanks, I'm aware of that work-around. Just want to know whether reporting it as issues would make sense or whether it would be closed anyway due to reasons like the other one I submitted. 🙂
At least I also don't see any rule in the official conventions that mandates a blank line before annotations.
w
maybe because it is not a multiline comment
Copy code
/* */
style
v
No, same for multi-line comment
s
p
I see no reason that an EOL comment cannot proceed an annotation without a blank line. Can you file a bug for it?
v
Definitely, just wanted to avoid another right-away closed one. :-)