diff --git a/.editorconfig b/.editorconfig index 6c98409464..cdadfbb946 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,15 @@ [*.{kt,kts}] +ktlint_code_style=intellij_idea indent_size=2 continuation_indent_size=2 -insert_final_newline=true ij_kotlin_allow_trailing_comma=true ij_kotlin_allow_trailing_comma_on_call_site=true +insert_final_newline=true ktlint_standard_annotation=disabled -ktlint_standard_argument-list-wrapping=disabled -ktlint_standard_spacing-between-declarations-with-annotations=disabled +ktlint_standard_max-line-length=disabled ktlint_standard_filename=disabled -ktlint_standard_property-naming=disabled +ktlint_standard_discouraged-comment-location=disabled +ktlint_standard_class-signature=disabled +ktlint_standard_spacing-between-declarations-with-annotations=disabled +ktlint_standard_argument-list-wrapping=disabled +ktlint_experimental=enabled \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2914d56b5d..fd635eab63 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,6 @@ codeQualityTools { } ktlint { toolVersion = libs.versions.ktlint.get() - experimental = true } detekt { enabled = false diff --git a/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt b/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt index 5f7a355ab3..dcd93afea4 100644 --- a/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt +++ b/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt @@ -71,7 +71,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "FacebookEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "FacebookEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt index 3231f41760..21ecb67a4a 100644 --- a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt +++ b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt @@ -81,9 +81,7 @@ internal class GoogleCompatEmojiDrawable( } @Suppress("OVERRIDE_DEPRECATION") - override fun getOpacity(): Int { - return PixelFormat.UNKNOWN - } + override fun getOpacity(): Int = PixelFormat.UNKNOWN internal companion object { private const val TEXT_SIZE_FACTOR = 0.8f diff --git a/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt b/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt index 2c2f6000da..780e6308f6 100644 --- a/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt +++ b/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt @@ -57,9 +57,7 @@ import com.vanniktech.emoji.Parcelize return true } - override fun toString(): String { - return "GoogleCompatEmoji(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "GoogleCompatEmoji(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" override fun hashCode(): Int { var result = unicode.hashCode() diff --git a/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt b/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt index 2a362cd1ef..b9e8161432 100644 --- a/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt +++ b/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt @@ -71,7 +71,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "GoogleEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "GoogleEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt b/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt index 420ca66741..f1b5faa4fc 100644 --- a/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt +++ b/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt @@ -71,7 +71,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "IosEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "IosEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt b/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt index 065a8ae61c..8fe71bb592 100644 --- a/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt +++ b/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt @@ -71,7 +71,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "TwitterEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "TwitterEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt index ce046d43b7..09959d7b96 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt @@ -22,10 +22,8 @@ import com.vanniktech.emoji.isOnlyEmojis /** InputFilter that only accepts emojis. */ class OnlyEmojisInputFilter : InputFilter { - override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? { - return when { - !source.subSequence(start, end).isOnlyEmojis() -> "" // Reject. - else -> null - } + override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? = when { + !source.subSequence(start, end).isOnlyEmojis() -> "" // Reject. + else -> null } } diff --git a/generator/template/Emoji.kt b/generator/template/Emoji.kt index 6681dec3cd..a833455fe5 100644 --- a/generator/template/Emoji.kt +++ b/generator/template/Emoji.kt @@ -71,7 +71,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/generator/template/EmojiCompat.kt b/generator/template/EmojiCompat.kt index 458c2630bb..e2293f056e 100644 --- a/generator/template/EmojiCompat.kt +++ b/generator/template/EmojiCompat.kt @@ -57,9 +57,7 @@ import com.vanniktech.emoji.Parcelize return true } - override fun toString(): String { - return "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" override fun hashCode(): Int { var result = unicode.hashCode() diff --git a/generator/yarn.lock b/generator/yarn.lock index 9ce7564ef0..5bd0f27287 100644 --- a/generator/yarn.lock +++ b/generator/yarn.lock @@ -1185,7 +1185,7 @@ imagemin-pngquant@^9.0.2: execa "^4.0.0" is-png "^2.0.0" is-stream "^2.0.0" - ow "^0.17.0" + ow "^0.18.0-SNAPSHOT" pngquant-bin "^6.0.0" imagemin-zopfli@^7.0.0: @@ -1684,9 +1684,9 @@ os-filter-obj@^2.0.0: dependencies: arch "^2.1.0" -ow@^0.17.0: - version "0.17.0" - resolved "https://registry.npmjs.org/ow/-/ow-0.17.0.tgz" +ow@^0.18.0-SNAPSHOT: + version "0.18.0-SNAPSHOT" + resolved "https://registry.npmjs.org/ow/-/ow-0.18.0-SNAPSHOT.tgz" integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== dependencies: type-fest "^0.11.0" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a96ccf03f1..dd5acc4ba5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ targetSdk = "33" androidgradleplugin = "8.1.1" kotlin = "1.8.22" -ktlint = "0.50.0" +ktlint = "1.0.1" [libraries] androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" } @@ -37,5 +37,5 @@ timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" } ui = { module = "com.vanniktech:ui", version = "0.8.0" } [plugins] -codequalitytools = { id = "com.vanniktech.code.quality.tools", version = "0.23.0" } +codequalitytools = { id = "com.vanniktech.code.quality.tools", version = "0.24.0" } dependencygraphgenerator = { id = "com.vanniktech.dependency.graph.generator", version = "0.8.0" }