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
Code should be put back into a file, but formatted.
Observed Behavior
All code in a file that has violation is deleted.
Steps to Reproduce
Create test.kt file with content:
val b = "text" +
"another text"
Run formatter:
ktlint -F test.kt
Before:
$ cat test.kt
<U+FEFF>val b = "text" +
"another text"
After:
$ cat test.kt
<U+FEFF>
Your Environment
Version of ktlint used: 0.40.0
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): ktlint (installed via brew), kotlinter-gradle plugin)
Version of Gradle used (if applicable): 6.5.1
Operating System and version: macOS Big Sur
The text was updated successfully, but these errors were encountered:
FylmTM
changed the title
Running formatter deletes all code in a file for "Unexpected indentation" rule
Running formatter deletes all code in a file if "Unexpected indentation" rule is violated
Dec 16, 2020
I have encountered this bug when configuring ktlint for our project. We had some files that had (for unknown reasons) BOM set.
As a fix for myself - I am going to remove BOM from those files.
FylmTM
changed the title
Running formatter deletes all code in a file if "Unexpected indentation" rule is violated
If U+FEFF (BOM) is present, running formatter deletes all code in a file
Dec 16, 2020
Expected Behavior
Code should be put back into a file, but formatted.
Observed Behavior
All code in a file that has violation is deleted.
Steps to Reproduce
Create
test.kt
file with content:Run formatter:
Before:
After:
Your Environment
The text was updated successfully, but these errors were encountered: