binary-compatibility-validator icon indicating copy to clipboard operation
binary-compatibility-validator copied to clipboard

Improve handling of trailing whitespace in API dump files

Open aSemy opened this issue 2 years ago • 2 comments

Currently, any API dump that BCV produces contains two trailing whitespaces lines, \n\n.

I have enabled 'strip trailing whitespace' in IntelliJ https://stackoverflow.com/questions/20679842/remove-trailing-whitespace-on-save-in-intellij-idea-12

When I open a .api file, which might automatically happen during a commit dialog, IntelliJ will replace the two trailing \n\n with a single \n. This is annoying, because then BCV will fail the test.

Other editors might also have problems with different types of behaviour that are difficult to predict or control.

Could BCV be changed to ignore any difference in trailing whitespace?

aSemy avatar May 01 '23 18:05 aSemy

What about just removing the last whitespace?

hfhbd avatar May 19 '23 15:05 hfhbd

I'd appreciate this too, I also have my IntelliJ set up this way. For me this mostly comes up during merges.

Removing the last \n seems like the best option, then IntelliJ and BCV won't fight over this and there won't be trails of this in the commit history.

lukellmann avatar Apr 04 '24 17:04 lukellmann

As part of the migration of separate BCV functionality to Kotlin Gradle Plugin, the addition of new features to a separate plugin has been discontinued.

It will be developed a format that eliminates this problem there: https://youtrack.jetbrains.com/issue/KT-78009

shanshin avatar Jun 03 '25 10:06 shanshin