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_type-argument-comment = disabled
ktlint_standard_type-parameter-comment = disabled
ktlint_standard_blank-line-between-when-conditions = disabled
# Avoid ktlint format messy code from SY
ktlint_standard_spacing-between-declarations-with-comments = disabled
ktlint_standard_max-line-length = disabled
ktlint_standard_value-argument-comment = disabled
ktlint_standard_value-parameter-comment = disabled

View file

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

View file

@ -27,7 +27,7 @@ internal fun ColorFilterPage(screenModel: ReaderSettingsScreenModel) {
pref = screenModel.preferences.customBrightness(),
)
/**
/*
* 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 1 to 100 it sets that value as brightness.

View file

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

View file

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

View file

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.data.coil
import android.graphics.BitmapFactory
import androidx.palette.graphics.Palette
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.coil.MangaCoverMetadata.setRatioAndColors
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel
import okio.BufferedSource
import tachiyomi.domain.library.service.LibraryPreferences
@ -89,14 +90,13 @@ object MangaCoverMetadata {
val options = BitmapFactory.Options()
val updateColors = mangaCover.isMangaFavorite &&
mangaCover.dominantCoverColors == null ||
!onlyDominantColor &&
mangaCover.vibrantCoverColor == null ||
val updateColors =
(mangaCover.isMangaFavorite && mangaCover.dominantCoverColors == null) ||
(!onlyDominantColor && mangaCover.vibrantCoverColor == null) ||
force
if (updateColors) {
/**
/*
* + 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
* already be returned from beginning.
@ -105,7 +105,7 @@ object MangaCoverMetadata {
*/
options.inSampleSize = SUB_SAMPLE
} else {
/**
/*
* + [onlyDominantColor] = true
* - Manga is Favorite & already have dominant color
* + [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) {
val restrictions = preferences.appShouldAutoUpdate().get()
if ((AppUpdatePolicy.DEVICE_ONLY_ON_WIFI in restrictions) &&
!context.isConnectedToWifi() ||
(AppUpdatePolicy.DEVICE_NETWORK_NOT_METERED in restrictions) &&
if ((
AppUpdatePolicy.DEVICE_ONLY_ON_WIFI in restrictions &&
!context.isConnectedToWifi()
) ||
(
AppUpdatePolicy.DEVICE_NETWORK_NOT_METERED in restrictions &&
context.connectivityManager.isActiveNetworkMetered
)
) {
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.AppBarTitle
import eu.kanade.presentation.components.SearchToolbar
import eu.kanade.presentation.more.settings.screen.browse.ExtensionReposScreen
import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.ui.main.MainActivity
import tachiyomi.i18n.MR
@ -58,7 +57,7 @@ class ExtensionsScreen(private val searchSource: String? = null) : Screen() {
LaunchedEffect(Unit) {
(context as? MainActivity)?.ready = true
/**
/*
* This will redo the searching for [searchSource] every times the screen is launched, for example when
* back from the [ExtensionFilterScreen] or from the [ExtensionReposScreen].
* 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 }
when
(
when (
@Suppress("NAME_SHADOWING")
val dialog = dialog
) {

View file

@ -56,9 +56,8 @@ class MigrateSearchScreen(private val mangaId: Long, private val validSources: L
// KMK -->
if (bulkFavoriteState.selectionMode) {
bulkFavoriteScreenModel.toggleSelection(manga)
} else
} else {
// KMK <--
{
// SY -->
navigator.items
.filterIsInstance<MigrationListScreen>()

View file

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

View file

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

View file

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

View file

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

View file

@ -1202,7 +1202,7 @@ class MangaScreenModel(
*/
internal suspend fun fetchRelatedMangasFromSource(onDemand: Boolean = false, onFinish: (() -> Unit)? = null) {
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
setRelatedMangasFetchedStatus(false)

View file

@ -1380,7 +1380,7 @@ class ReaderActivity : BaseActivity() {
private val grayBackgroundColor = Color.rgb(0x20, 0x21, 0x25)
/**
/*
* Initializes the reader subscriptions.
*/
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.loader.ChapterLoader
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.ReaderChapter
import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
@ -624,7 +623,7 @@ class ReaderViewModel @JvmOverloads constructor(
return
}
/**
/*
* 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.
*/

View file

@ -153,8 +153,7 @@ internal class HttpPageLoader(
page.imageUrl = null
}
if (readerPreferences.readerInstantRetry().get()) // EXH <--
{
if (readerPreferences.readerInstantRetry().get()) { // EXH <--
boostPage(page)
} else {
// EXH <--

View file

@ -60,8 +60,7 @@ class MetadataViewScreen(
)
},
) { paddingValues ->
when
(
when (
@Suppress("NAME_SHADOWING")
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
// WebView init in those rare cases.
// 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
}

View file

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

View file

@ -26,6 +26,7 @@ data class MangaCover(
// SY <--
// KMK -->
/**
* [vibrantCoverColor] is used to set the color theme in manga detail page.
* 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"
voyager = "1.1.0-beta03"
spotless = "8.0.0"
ktlint-core = "1.5.0"
ktlint-core = "1.8.0"
firebase-bom = "34.5.0"
markdown = "0.38.1"
junit = "6.0.1"

View file

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

View file

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

View file

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

View file

@ -61,6 +61,7 @@ interface Source {
suspend fun getPageList(chapter: SChapter): List<Page>
// KMK -->
/**
* 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
// KMK -->
/**
* 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
// KMK -->
/**
* Parses the response from the site and returns a list of related mangas.
* Normally it's not needed to override this method.