Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Trailing spaces not removed in multiline comment block #1197

Closed
mhernand40 opened this issue Aug 5, 2021 · 0 comments · Fixed by #1204
Closed

Trailing spaces not removed in multiline comment block #1197

mhernand40 opened this issue Aug 5, 2021 · 0 comments · Fixed by #1204

Comments

@mhernand40
Copy link

Adding · to the code snippet to visually represent spaces. Let's say we have the following code:

/*·
·*·©·Your·Copyright·Here
·*/

package·com.foo

class·Foo

Expected Behavior

Ktlint should be able to flag and remove that trailing space on line 1.

Observed Behavior

The trailing space remains, Ktlint does not complain about it nor does it strip it when running the formatter.

Steps to Reproduce

  1. Paste the above code in a basic text editor (IDE may auto format if you paste it there and save)
  2. Run Ktlint against the code above.

Your Environment

  • Version of ktlint used: 0.41.0
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): ./gradlew ktlintFormat
  • Version of Gradle used (if applicable):
------------------------------------------------------------
Gradle 7.1.1
------------------------------------------------------------

Build time:   2021-07-02 12:16:43 UTC
Revision:     774525a055494e0ece39f522ac7ad17498ce032c

Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.9 (Eclipse OpenJ9 openj9-0.23.0)
OS:           Mac OS X 10.16 x86_64
  • Operating System and version: macOS Big Sur Version 11.5
paul-dingemans pushed a commit to paul-dingemans/ktlint that referenced this issue Aug 8, 2021
romtsn pushed a commit to paul-dingemans/ktlint that referenced this issue Aug 8, 2021
romtsn added a commit that referenced this issue Aug 8, 2021
* Lint and format trailing spaces inside block comments

Closes #1197

* Add changelog entry

Co-authored-by: Paul Dingemans <pdingemans@bol.com>
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant