Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 (#1369)

* Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 (mihonapp/mihon#2708)

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit 13552c5ffa796aa9bf5db5e12c758a4b3763bf2b)

* chore: disable ktlint consecutive comments and single line block comment rules

* spacing-between-declarations-with-comments & mix condition

* Remove unused rule

* More blank lines

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Cuong-Tran 2026-01-08 10:19:37 +07:00 committed by GitHub
parent 3a7898eeac
commit 8eaa177ad5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 71 additions and 67 deletions

View file

@ -29,8 +29,10 @@ ktlint_standard_function-expression-body = disabled
ktlint_standard_function-signature = disabled ktlint_standard_function-signature = disabled
ktlint_standard_type-argument-comment = disabled ktlint_standard_type-argument-comment = disabled
ktlint_standard_type-parameter-comment = disabled ktlint_standard_type-parameter-comment = disabled
ktlint_standard_blank-line-between-when-conditions = disabled
# Avoid ktlint format messy code from SY # Avoid ktlint format messy code from SY
ktlint_standard_spacing-between-declarations-with-comments = disabled
ktlint_standard_max-line-length = disabled ktlint_standard_max-line-length = disabled
ktlint_standard_value-argument-comment = disabled ktlint_standard_value-argument-comment = disabled
ktlint_standard_value-parameter-comment = disabled ktlint_standard_value-parameter-comment = disabled

View file

@ -100,9 +100,8 @@ fun MangaToolbar(
isHomeEnabled && isHomeEnabled &&
navigator != null && navigator != null &&
( (
navigator.size >= 2 && navigator.size >= 5 ||
navigator.items[navigator.size - 2] is MangaScreen || (navigator.size >= 2 && navigator.items[navigator.size - 2] is MangaScreen)
navigator.size >= 5
) )
}, },
// KMK <-- // KMK <--

View file

@ -27,7 +27,7 @@ internal fun ColorFilterPage(screenModel: ReaderSettingsScreenModel) {
pref = screenModel.preferences.customBrightness(), pref = screenModel.preferences.customBrightness(),
) )
/** /*
* Sets the brightness of the screen. Range is [-75, 100]. * Sets the brightness of the screen. Range is [-75, 100].
* From -75 to -1 a semi-transparent black view is shown at the top with the minimum brightness. * From -75 to -1 a semi-transparent black view is shown at the top with the minimum brightness.
* From 1 to 100 it sets that value as brightness. * From 1 to 100 it sets that value as brightness.

View file

@ -264,6 +264,7 @@ private fun UpdatesBottomBar(
sealed interface UpdatesUiModel { sealed interface UpdatesUiModel {
data class Header(val date: LocalDate, val mangaCount: Int) : UpdatesUiModel data class Header(val date: LocalDate, val mangaCount: Int) : UpdatesUiModel
open class Item(open val item: UpdatesItem, open val isExpandable: Boolean = false) : UpdatesUiModel open class Item(open val item: UpdatesItem, open val isExpandable: Boolean = false) : UpdatesUiModel
// KMK --> // KMK -->
/** The first [Item] in a group of chapters from same manga */ /** The first [Item] in a group of chapters from same manga */
data class Leader(override val item: UpdatesItem, override val isExpandable: Boolean) : Item(item) data class Leader(override val item: UpdatesItem, override val isExpandable: Boolean) : Item(item)

View file

@ -27,19 +27,23 @@ class FeedRestorer(
// KMK <-- // KMK <--
}.filter { backupFeed -> }.filter { backupFeed ->
// Filter out source's global Popular/Latest feed already existed // Filter out source's global Popular/Latest feed already existed
backupFeed.savedSearch == null && (
currentFeeds.none { currentFeed -> backupFeed.savedSearch == null &&
currentFeed.source == backupFeed.source && backupFeed.global currentFeeds.none { currentFeed ->
} || currentFeed.source == backupFeed.source && backupFeed.global
}
) ||
// Filter out feed with saveSearch already existed (both global/non-global) // Filter out feed with saveSearch already existed (both global/non-global)
backupFeed.savedSearch != null && (
currentFeeds.none { currentFeed -> backupFeed.savedSearch != null &&
currentFeed.source == backupFeed.source && currentFeeds.none { currentFeed ->
currentFeed.global == backupFeed.global && currentFeed.source == backupFeed.source &&
currentFeed.name == backupFeed.savedSearch.name && currentFeed.global == backupFeed.global &&
currentFeed.query.orEmpty() == backupFeed.savedSearch.query && currentFeed.name == backupFeed.savedSearch.name &&
(currentFeed.filters_json ?: "[]") == backupFeed.savedSearch.filterList currentFeed.query.orEmpty() == backupFeed.savedSearch.query &&
} (currentFeed.filters_json ?: "[]") == backupFeed.savedSearch.filterList
}
)
}.forEach { backupFeed -> }.forEach { backupFeed ->
val savedSearchId = backupFeed.savedSearch?.let { val savedSearchId = backupFeed.savedSearch?.let {
val existedSavedSearchId = currentSavedSearches.find { currentSavedSearch -> val existedSavedSearchId = currentSavedSearches.find { currentSavedSearch ->

View file

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.data.coil
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import androidx.palette.graphics.Palette import androidx.palette.graphics.Palette
import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.coil.MangaCoverMetadata.setRatioAndColors
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel import eu.kanade.tachiyomi.ui.manga.MangaScreenModel
import okio.BufferedSource import okio.BufferedSource
import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.library.service.LibraryPreferences
@ -89,14 +90,13 @@ object MangaCoverMetadata {
val options = BitmapFactory.Options() val options = BitmapFactory.Options()
val updateColors = mangaCover.isMangaFavorite && val updateColors =
mangaCover.dominantCoverColors == null || (mangaCover.isMangaFavorite && mangaCover.dominantCoverColors == null) ||
!onlyDominantColor && (!onlyDominantColor && mangaCover.vibrantCoverColor == null) ||
mangaCover.vibrantCoverColor == null || force
force
if (updateColors) { if (updateColors) {
/** /*
* + Manga is Favorite & doesn't have dominant color * + Manga is Favorite & doesn't have dominant color
* For non-favorite, it doesn't care if dominant is there or not, if it has vibrant color then it will * For non-favorite, it doesn't care if dominant is there or not, if it has vibrant color then it will
* already be returned from beginning. * already be returned from beginning.
@ -105,7 +105,7 @@ object MangaCoverMetadata {
*/ */
options.inSampleSize = SUB_SAMPLE options.inSampleSize = SUB_SAMPLE
} else { } else {
/** /*
* + [onlyDominantColor] = true * + [onlyDominantColor] = true
* - Manga is Favorite & already have dominant color * - Manga is Favorite & already have dominant color
* + [onlyDominantColor] = false * + [onlyDominantColor] = false

View file

@ -71,10 +71,14 @@ class AppUpdateDownloadJob(private val context: Context, workerParams: WorkerPar
} }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
val restrictions = preferences.appShouldAutoUpdate().get() val restrictions = preferences.appShouldAutoUpdate().get()
if ((AppUpdatePolicy.DEVICE_ONLY_ON_WIFI in restrictions) && if ((
!context.isConnectedToWifi() || AppUpdatePolicy.DEVICE_ONLY_ON_WIFI in restrictions &&
(AppUpdatePolicy.DEVICE_NETWORK_NOT_METERED in restrictions) && !context.isConnectedToWifi()
context.connectivityManager.isActiveNetworkMetered ) ||
(
AppUpdatePolicy.DEVICE_NETWORK_NOT_METERED in restrictions &&
context.connectivityManager.isActiveNetworkMetered
)
) { ) {
return Result.retry() return Result.retry()
} }

View file

@ -13,7 +13,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.AppBarTitle import eu.kanade.presentation.components.AppBarTitle
import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.components.SearchToolbar
import eu.kanade.presentation.more.settings.screen.browse.ExtensionReposScreen
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.MainActivity
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
@ -58,7 +57,7 @@ class ExtensionsScreen(private val searchSource: String? = null) : Screen() {
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
(context as? MainActivity)?.ready = true (context as? MainActivity)?.ready = true
/** /*
* This will redo the searching for [searchSource] every times the screen is launched, for example when * This will redo the searching for [searchSource] every times the screen is launched, for example when
* back from the [ExtensionFilterScreen] or from the [ExtensionReposScreen]. * back from the [ExtensionFilterScreen] or from the [ExtensionReposScreen].
* Not really desired but let's accept it. * Not really desired but let's accept it.

View file

@ -127,8 +127,7 @@ class MigrationListScreen(private val config: MigrationProcedureConfig) : Screen
) )
val onDismissRequest = { screenModel.dialog.value = null } val onDismissRequest = { screenModel.dialog.value = null }
when when (
(
@Suppress("NAME_SHADOWING") @Suppress("NAME_SHADOWING")
val dialog = dialog val dialog = dialog
) { ) {

View file

@ -56,17 +56,16 @@ class MigrateSearchScreen(private val mangaId: Long, private val validSources: L
// KMK --> // KMK -->
if (bulkFavoriteState.selectionMode) { if (bulkFavoriteState.selectionMode) {
bulkFavoriteScreenModel.toggleSelection(manga) bulkFavoriteScreenModel.toggleSelection(manga)
} else } else {
// KMK <-- // KMK <--
{ // SY -->
// SY --> navigator.items
navigator.items .filterIsInstance<MigrationListScreen>()
.filterIsInstance<MigrationListScreen>() .last()
.last() .newSelectedItem = mangaId to manga.id
.newSelectedItem = mangaId to manga.id navigator.popUntil { it is MigrationListScreen }
navigator.popUntil { it is MigrationListScreen } // SY <--
// SY <-- }
}
}, },
onLongClickItem = { navigator.push(MangaScreen(it.id, true)) }, onLongClickItem = { navigator.push(MangaScreen(it.id, true)) },
// KMK --> // KMK -->

View file

@ -181,8 +181,7 @@ data class BrowseSourceScreen(
val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get() val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get()
val isConfigurableSource = screenModel.source.anyIs<ConfigurableSource>() || val isConfigurableSource = screenModel.source.anyIs<ConfigurableSource>() ||
screenModel.source.isEhBasedSource() && (screenModel.source.isEhBasedSource() && isHentaiEnabled)
isHentaiEnabled
// KMK <-- // KMK <--
Scaffold( Scaffold(

View file

@ -86,8 +86,7 @@ class SourceFeedScreen(val sourceId: Long) : Screen() {
val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get() val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get()
val isConfigurableSource = screenModel.source.anyIs<ConfigurableSource>() || val isConfigurableSource = screenModel.source.anyIs<ConfigurableSource>() ||
screenModel.source.isEhBasedSource() && (screenModel.source.isEhBasedSource() && isHentaiEnabled)
isHentaiEnabled
val haptic = LocalHapticFeedback.current val haptic = LocalHapticFeedback.current

View file

@ -414,10 +414,8 @@ class MainActivity : BaseActivity() {
var showChangelog by remember { var showChangelog by remember {
mutableStateOf( mutableStateOf(
// KMK --> // KMK -->
isReleaseBuildType && (isReleaseBuildType && didMigration) ||
didMigration || (isPreviewBuildType && previewCurrentVersion > previewLastVersion.get()),
isPreviewBuildType &&
previewCurrentVersion > previewLastVersion.get(),
// KMK <-- // KMK <--
) )
} }

View file

@ -266,8 +266,7 @@ class MangaScreen(
val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get() val isHentaiEnabled: Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get()
val isConfigurableSource = successState.source.anyIs<ConfigurableSource>() || val isConfigurableSource = successState.source.anyIs<ConfigurableSource>() ||
successState.source.isEhBasedSource() && (successState.source.isEhBasedSource() && isHentaiEnabled)
isHentaiEnabled
// KMK <-- // KMK <--
MangaScreen( MangaScreen(
@ -739,8 +738,7 @@ class MangaScreen(
// KMK --> // KMK -->
navigator.popUntil { screen -> navigator.popUntil { screen ->
screen is HomeScreen || screen is HomeScreen ||
!library && (!library && (screen is BrowseSourceScreen || screen is SourceFeedScreen))
(screen is BrowseSourceScreen || screen is SourceFeedScreen)
} }
// KMK <-- // KMK <--

View file

@ -1202,7 +1202,7 @@ class MangaScreenModel(
*/ */
internal suspend fun fetchRelatedMangasFromSource(onDemand: Boolean = false, onFinish: (() -> Unit)? = null) { internal suspend fun fetchRelatedMangasFromSource(onDemand: Boolean = false, onFinish: (() -> Unit)? = null) {
val expandRelatedMangas = uiPreferences.expandRelatedMangas().get() val expandRelatedMangas = uiPreferences.expandRelatedMangas().get()
if (!onDemand && !expandRelatedMangas || manga?.source == MERGED_SOURCE_ID) return if ((!onDemand && !expandRelatedMangas) || manga?.source == MERGED_SOURCE_ID) return
// start fetching related mangas // start fetching related mangas
setRelatedMangasFetchedStatus(false) setRelatedMangasFetchedStatus(false)

View file

@ -1380,7 +1380,7 @@ class ReaderActivity : BaseActivity() {
private val grayBackgroundColor = Color.rgb(0x20, 0x21, 0x25) private val grayBackgroundColor = Color.rgb(0x20, 0x21, 0x25)
/** /*
* Initializes the reader subscriptions. * Initializes the reader subscriptions.
*/ */
init { init {

View file

@ -34,7 +34,6 @@ import eu.kanade.tachiyomi.source.online.all.MergedSource
import eu.kanade.tachiyomi.ui.reader.chapter.ReaderChapterItem import eu.kanade.tachiyomi.ui.reader.chapter.ReaderChapterItem
import eu.kanade.tachiyomi.ui.reader.loader.ChapterLoader import eu.kanade.tachiyomi.ui.reader.loader.ChapterLoader
import eu.kanade.tachiyomi.ui.reader.loader.DownloadPageLoader import eu.kanade.tachiyomi.ui.reader.loader.DownloadPageLoader
import eu.kanade.tachiyomi.ui.reader.loader.HttpPageLoader
import eu.kanade.tachiyomi.ui.reader.model.InsertPage import eu.kanade.tachiyomi.ui.reader.model.InsertPage
import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
@ -624,7 +623,7 @@ class ReaderViewModel @JvmOverloads constructor(
return return
} }
/** /*
* This code is likely deprecated since once `chapter.pageLoader` is initialized with [HttpPageLoader], * This code is likely deprecated since once `chapter.pageLoader` is initialized with [HttpPageLoader],
* it would set `chapter.state` to `Loading` or `Loaded` and return early already. * it would set `chapter.state` to `Loading` or `Loaded` and return early already.
*/ */

View file

@ -153,10 +153,9 @@ internal class HttpPageLoader(
page.imageUrl = null page.imageUrl = null
} }
if (readerPreferences.readerInstantRetry().get()) // EXH <-- if (readerPreferences.readerInstantRetry().get()) { // EXH <--
{ boostPage(page)
boostPage(page) } else {
} else {
// EXH <-- // EXH <--
queue.offer(PriorityPage(page, 2)) queue.offer(PriorityPage(page, 2))
} }

View file

@ -60,8 +60,7 @@ class MetadataViewScreen(
) )
}, },
) { paddingValues -> ) { paddingValues ->
when when (
(
@Suppress("NAME_SHADOWING") @Suppress("NAME_SHADOWING")
val state = state val state = state
) { ) {

View file

@ -34,7 +34,7 @@ abstract class WebViewInterceptor(
// Crashes on some devices. We skip this in some cases since the only impact is slower // Crashes on some devices. We skip this in some cases since the only impact is slower
// WebView init in those rare cases. // WebView init in those rare cases.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1279562 // See https://bugs.chromium.org/p/chromium/issues/detail?id=1279562
if (DeviceUtil.isMiui || Build.VERSION.SDK_INT == Build.VERSION_CODES.S && DeviceUtil.isSamsung) { if (DeviceUtil.isMiui || (Build.VERSION.SDK_INT == Build.VERSION_CODES.S && DeviceUtil.isSamsung)) {
return@lazy return@lazy
} }

View file

@ -205,6 +205,7 @@ object ImageUtil {
RIGHT, RIGHT,
LEFT, LEFT,
} }
// SY --> // SY -->
/** /**
* Split the image into left and right parts, then merge them into a * Split the image into left and right parts, then merge them into a

View file

@ -26,6 +26,7 @@ data class MangaCover(
// SY <-- // SY <--
// KMK --> // KMK -->
/** /**
* [vibrantCoverColor] is used to set the color theme in manga detail page. * [vibrantCoverColor] is used to set the color theme in manga detail page.
* It contains color for all mangas, both in library or browsing. * It contains color for all mangas, both in library or browsing.

View file

@ -8,7 +8,7 @@ sqldelight = "2.1.0"
sqlite = "2.6.1" sqlite = "2.6.1"
voyager = "1.1.0-beta03" voyager = "1.1.0-beta03"
spotless = "8.0.0" spotless = "8.0.0"
ktlint-core = "1.5.0" ktlint-core = "1.8.0"
firebase-bom = "34.5.0" firebase-bom = "34.5.0"
markdown = "0.38.1" markdown = "0.38.1"
junit = "6.0.1" junit = "6.0.1"

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
/** /*
* Straight copy from Compose M3 for Button fork * Straight copy from Compose M3 for Button fork
*/ */

View file

@ -24,7 +24,7 @@ package tachiyomi.presentation.core.util
* SOFTWARE. * SOFTWARE.
*/ */
/** /*
* Code taken from https://gist.github.com/mxalbert1996/33a360fcab2105a31e5355af98216f5a * Code taken from https://gist.github.com/mxalbert1996/33a360fcab2105a31e5355af98216f5a
* with some modifications to handle contentPadding. * with some modifications to handle contentPadding.
* *

View file

@ -68,6 +68,7 @@ interface CatalogueSource : Source {
fun getFilterList(): FilterList fun getFilterList(): FilterList
// KMK --> // KMK -->
/** /**
* Whether parsing related mangas in manga page or extension provide custom related mangas request. * Whether parsing related mangas in manga page or extension provide custom related mangas request.
* @default false * @default false

View file

@ -61,6 +61,7 @@ interface Source {
suspend fun getPageList(chapter: SChapter): List<Page> suspend fun getPageList(chapter: SChapter): List<Page>
// KMK --> // KMK -->
/** /**
* Get all the available related mangas for a manga. * Get all the available related mangas for a manga.
* *

View file

@ -333,6 +333,7 @@ abstract class HttpSource : CatalogueSource {
protected abstract fun mangaDetailsParse(response: Response): SManga protected abstract fun mangaDetailsParse(response: Response): SManga
// KMK --> // KMK -->
/** /**
* Whether parsing related mangas in manga page or extension provide custom related mangas request. * Whether parsing related mangas in manga page or extension provide custom related mangas request.
* *

View file

@ -150,6 +150,7 @@ abstract class ParsedHttpSource : HttpSource() {
protected abstract fun mangaDetailsParse(document: Document): SManga protected abstract fun mangaDetailsParse(document: Document): SManga
// KMK --> // KMK -->
/** /**
* Parses the response from the site and returns a list of related mangas. * Parses the response from the site and returns a list of related mangas.
* Normally it's not needed to override this method. * Normally it's not needed to override this method.