-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Running ktlintFormat twice deletes files #302
Comments
Thank you for the report, I've successfully reproduced it 🤔 |
Most probably 9.0.0 version does not have such problem, as the issue in incremental task support. |
@Tapchicoma , thanks for the suggestion! I tried version 9.0.0 for |
Gradle currently doesn't support tasks which have the input as the output very well (if at all). Can you add the incremental support only to the lint task and not the format task? |
That is my plan I want to do tomorrow... |
Steps to reproduce the bug
9.1.0
and ktlint version0.35.0
with the following configuration:./gradlew ktlintFormat --continue
once. (Then rungit status
, and observe that the auto-formatted files were modified)./gradlew ktlintFormat --continue
a second timeExpected Behavior
Running
./gradlew ktlintFormat --continue
the second time should not making any additional changes. The previously modified files should still show up as modified ingit status
, and no files should be deleted.Actual Behavior
All the files that were previously marked as modified are now
deleted
(observed viagit status
).I also tried the gradle integration recommended in https://github.com/pinterest/ktlint without plugins, and running the non-plugin
ktlintFormat
task multiple times did not delete any files. This makes me suspect that the bug is inktlint-gradle
.The text was updated successfully, but these errors were encountered: