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
The issue at hand is that java imports are placed erroneously when autoformatting in the IDE. As a result, ktlint has exposed a linting option of disabling the import-order rule through .editorconfig:
disabled_rules = import-ordering
For reference see: pinterest/ktlint#527
Spotless however, does not honor this and throws exception when running the check.
.editorConfig
# https://github.com/shyiko/ktlint#editorconfig
root = true
[*.{kt,kts,xml}]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{kt,kts}]
max_line_length = 165
disabled_rules = import-ordering # Added because IDEA does not respect alphabetical ordering (https://github.com/JetBrains/kotlin/pull/3336)
Stack trace from spotlessCheck
> The following files had format violations:
app/src/main/java/com/sl/slbiljetter/util/extensions/LiveDataExtensions.kt
@@ -7,16 +7,16 @@
import·androidx.lifecycle.Observer
import·androidx.lifecycle.asFlow
import·androidx.lifecycle.asLiveData
+import·java.util.concurrent.CountDownLatch
+import·java.util.concurrent.TimeUnit
+import·java.util.concurrent.TimeoutException
+import·kotlin.math.roundToLong
import·kotlinx.coroutines.CoroutineDispatcher
import·kotlinx.coroutines.Dispatchers
import·kotlinx.coroutines.delay
import·kotlinx.coroutines.flow.debounce
import·kotlinx.coroutines.flow.flatMapConcat
import·kotlinx.coroutines.flow.flow
-import·java.util.concurrent.CountDownLatch
-import·java.util.concurrent.TimeUnit
-import·java.util.concurrent.TimeoutException
-import·kotlin.math.roundToLong
The text was updated successfully, but these errors were encountered:
Issue
The issue at hand is that java imports are placed erroneously when autoformatting in the IDE. As a result, ktlint has exposed a linting option of disabling the import-order rule through
.editorconfig
:For reference see: pinterest/ktlint#527
Spotless however, does not honor this and throws exception when running the check.
.editorConfig
Stack trace from
spotlessCheck
The text was updated successfully, but these errors were encountered: