diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8a2b1ba0b..8f96c3977 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -290,6 +290,10 @@ tasks { } } + withType().configureEach { + exclude { it.file.path.contains("generated[\\\\/]".toRegex())} + } + // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers) withType { kotlinOptions.freeCompilerArgs += listOf( @@ -315,7 +319,8 @@ tasks { } preBuild { - dependsOn(formatKotlin, copyHebrewStrings, localesConfigTask) + val ktlintTask = if (System.getenv("GITHUB_BASE_REF") == null) formatKotlin else lintKotlin + dependsOn(ktlintTask, copyHebrewStrings, localesConfigTask) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 10bdd4ce4..2b5320897 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -103,9 +103,9 @@ object Migrations { // Reset sorting preference if using removed sort by source val oldSortingMode = prefs.getInt(PreferenceKeys.librarySortingMode, 0) - if (oldSortingMode == 5 /* SOURCE */) { + if (oldSortingMode == 5) { // SOURCE = 5 prefs.edit { - putInt(PreferenceKeys.librarySortingMode, 0 /* ALPHABETICAL */) + putInt(PreferenceKeys.librarySortingMode, 0) // ALPHABETICAL = 0 } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupChapter.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupChapter.kt index 917014080..19a81fc60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupChapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupChapter.kt @@ -37,19 +37,7 @@ data class BackupChapter( } } -val backupChapterMapper = { - _: Long, - _: Long, - url: String, - name: String, - scanlator: String?, - read: Boolean, - bookmark: Boolean, - lastPageRead: Long, - chapterNumber: Float, - source_order: Long, - dateFetch: Long, - dateUpload: Long, -> +val backupChapterMapper = { _: Long, _: Long, url: String, name: String, scanlator: String?, read: Boolean, bookmark: Boolean, lastPageRead: Long, chapterNumber: Float, source_order: Long, dateFetch: Long, dateUpload: Long -> BackupChapter( url = url, name = name, diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupTracking.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupTracking.kt index 8a04f8796..a9cf7e57a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupTracking.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupTracking.kt @@ -51,19 +51,7 @@ data class BackupTracking( } val backupTrackMapper = { - _id: Long, - manga_id: Long, - syncId: Long, - mediaId: Long, - libraryId: Long?, - title: String, - lastChapterRead: Double, - totalChapters: Long, - status: Long, - score: Float, - remoteUrl: String, - startDate: Long, - finishDate: Long, -> + _: Long, _: Long, syncId: Long, mediaId: Long, libraryId: Long?, title: String, lastChapterRead: Double, totalChapters: Long, status: Long, score: Float, remoteUrl: String, startDate: Long, finishDate: Long -> BackupTracking( syncId = syncId.toInt(), mediaId = mediaId, diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt index c5965588e..7b35fefe7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt @@ -19,11 +19,13 @@ object PreferenceValues { /* ktlint-disable experimental:enum-entry-name-case */ // Keys are lowercase to match legacy string values + /* ktlint-disable enum-entry-name-case */ enum class ThemeMode { light, dark, system, } + /* ktlint-enable enum-entry-name-case */ /* ktlint-enable experimental:enum-entry-name-case */ diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt index 1f6764c38..75c472069 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -98,7 +98,9 @@ class LocalSource( } } - else -> { /* Do nothing */ } + else -> { + /* Do nothing */ + } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index ab7f4b55b..0c34cf1d3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt @@ -21,12 +21,12 @@ import eu.kanade.tachiyomi.network.PREF_DOH_360 import eu.kanade.tachiyomi.network.PREF_DOH_ADGUARD import eu.kanade.tachiyomi.network.PREF_DOH_ALIDNS import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE +import eu.kanade.tachiyomi.network.PREF_DOH_CONTROLD import eu.kanade.tachiyomi.network.PREF_DOH_DNSPOD import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE import eu.kanade.tachiyomi.network.PREF_DOH_MULLVAD import eu.kanade.tachiyomi.network.PREF_DOH_QUAD101 import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9 -import eu.kanade.tachiyomi.network.PREF_DOH_CONTROLD import eu.kanade.tachiyomi.ui.base.controller.openInBrowser import eu.kanade.tachiyomi.ui.base.controller.pushController import eu.kanade.tachiyomi.ui.setting.database.ClearDatabaseController diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt index 2d9bec718..2f1d995cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt @@ -82,7 +82,9 @@ object ImageUtil { Format.Webp -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P else -> false } - } catch (e: Exception) { /* Do Nothing */ } + } catch (e: Exception) { + /* Do Nothing */ + } return false } diff --git a/build.gradle.kts b/build.gradle.kts index 1bb42db5e..56f7124c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,8 +26,11 @@ subprojects { kotlinter { experimentalRules = true - // Doesn't play well with Android Studio - disabledRules = arrayOf("experimental:argument-list-wrapping") + + disabledRules = arrayOf( + "experimental:argument-list-wrapping", // Doesn't play well with Android Studio + "filename", // Often broken to give a more general name + ) } }