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
I expect ktlint not to fail nor modify the code below when autoformatting. According to the issue linked in ktlint check, while Intellj indeed adds spacing between methods it doesn't between class properties, enum values, nor method variables.
Basically I expect spacing-between-declarations-with-comments not to report issues with a code that doesn't get autocorrected by IntelliJ.
Observed Behavior
ktlint fails with
SampleClass.kt:6:36: Declarations and declarations with comments should have an empty space between.
on every "// false positive" comment (below)
+ when executed with -F it adds spaces in places where intellij doesn't
Version of ktlint used: 0.39.0 (works), 0.40.0 (doesn't work)
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): manually added Gradle tasks pasted above
Version of Gradle used (if applicable): 6.8
Operating System and version:
Link to your project (if it's a public repository):
The text was updated successfully, but these errors were encountered:
mateuszkwiecinski
changed the title
spacing-between-declarations-with-comments
[0.40.0] experimental:spacing-between-declarations-with-comments false positives with // comments on class properties, variables and enum values
Jan 11, 2021
Expected Behavior
I expect ktlint not to fail nor modify the code below when autoformatting. According to the issue linked in ktlint check, while Intellj indeed adds spacing between methods it doesn't between class properties, enum values, nor method variables.
Basically I expect
spacing-between-declarations-with-comments
not to report issues with a code that doesn't get autocorrected by IntelliJ.Observed Behavior
ktlint fails with
on every
"// false positive"
comment (below)+ when executed with
-F
it adds spaces in places where intellij doesn'tSteps to Reproduce
Run ktlint on following code:
Your Environment
The text was updated successfully, but these errors were encountered: