Switch to different ktlint plugin

Should be better at incremental builds.
To format, run `./gradlew ktlintFormat`.

(cherry picked from commit d29b7c4e5735dc137d578d3bcb3da1f0a02573e8)

# Conflicts:
#	buildSrc/src/main/kotlin/tachiyomi.lint.gradle.kts
#	data/src/main/java/tachiyomi/data/manga/MangaMapper.kt
#	domain/src/main/java/tachiyomi/domain/library/model/LibrarySortMode.kt
#	domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt
#	domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt
#	presentation-core/src/main/java/tachiyomi/presentation/core/components/CollapsibleBox.kt
This commit is contained in:
arkon
2023-09-01 23:02:18 -04:00
committed by Jobobby04
parent e0a16abb37
commit d8158af43a
75 changed files with 559 additions and 300 deletions
@@ -184,7 +184,7 @@ fun CategoryDeleteDialog(
TextButton(onClick = {
onDelete()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},
@@ -239,7 +239,7 @@ fun ChangeCategoryDialog(
tachiyomi.presentation.core.components.material.TextButton(onClick = {
onDismissRequest()
onEditCategories()
},) {
}) {
Text(text = stringResource(R.string.action_edit))
}
Spacer(modifier = Modifier.weight(1f))
@@ -61,7 +61,7 @@ fun HistoryDeleteDialog(
TextButton(onClick = {
onDelete(removeEverything)
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_remove))
}
},
@@ -90,7 +90,7 @@ fun HistoryDeleteAllDialog(
TextButton(onClick = {
onDelete()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},
@@ -102,7 +102,7 @@ fun SetIntervalDialog(
TextButton(onClick = {
onValueChanged(selectedInterval)
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},
@@ -139,11 +139,11 @@ fun MoreScreen(
stringResource(R.string.paused)
} else {
"${stringResource(R.string.paused)}${
pluralStringResource(
id = R.plurals.download_queue_summary,
count = pending,
pending,
)
pluralStringResource(
id = R.plurals.download_queue_summary,
count = pending,
pending,
)
}"
}
}
@@ -741,7 +741,7 @@ object SettingsAdvancedScreen : SearchableSettings {
subtitle = stringResource(R.string.log_level_summary),
entries = EHLogLevel.values().mapIndexed { index, ehLogLevel ->
index to "${context.getString(ehLogLevel.nameRes)} (${
context.getString(ehLogLevel.description)
context.getString(ehLogLevel.description)
})"
}.toMap(),
),
@@ -21,7 +21,7 @@ fun UpdatesDeleteConfirmationDialog(
TextButton(onClick = {
onConfirm()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},
@@ -87,7 +87,7 @@ fun SourceFilterDialog(
Button(onClick = {
onFilter()
onDismissRequest()
},) {
}) {
Text(stringResource(R.string.action_filter))
}
}
@@ -1201,7 +1201,8 @@ class MangaScreenModel(
val manga = state.mergedData?.manga?.get(map.key) ?: return@forEach
downloadManager.downloadChapters(manga, map.value)
}
} else { /* SY <-- */
} else {
/* SY <-- */
val manga = state.manga
downloadManager.downloadChapters(manga, chapters)
}
@@ -271,7 +271,10 @@ private data class TrackStatusSelectorScreen(
selection = state.selection,
onSelectionChange = sm::setSelection,
selections = remember { sm.getSelections() },
onConfirm = { sm.setStatus(); navigator.pop() },
onConfirm = {
sm.setStatus()
navigator.pop()
},
onDismissRequest = navigator::pop,
)
}
@@ -322,7 +325,10 @@ private data class TrackChapterSelectorScreen(
selection = state.selection,
onSelectionChange = sm::setSelection,
range = remember { sm.getRange() },
onConfirm = { sm.setChapter(); navigator.pop() },
onConfirm = {
sm.setChapter()
navigator.pop()
},
onDismissRequest = navigator::pop,
)
}
@@ -378,7 +384,10 @@ private data class TrackScoreSelectorScreen(
selection = state.selection,
onSelectionChange = sm::setSelection,
selections = remember { sm.getSelections() },
onConfirm = { sm.setScore(); navigator.pop() },
onConfirm = {
sm.setScore()
navigator.pop()
},
onDismissRequest = navigator::pop,
)
}
@@ -495,7 +504,10 @@ private data class TrackDateSelectorScreen(
},
initialSelectedDateMillis = sm.initialSelection,
selectableDates = selectableDates,
onConfirm = { sm.setDate(it); navigator.pop() },
onConfirm = {
sm.setDate(it)
navigator.pop()
},
onRemove = { sm.confirmRemoveDate(navigator) }.takeIf { canRemove },
onDismissRequest = navigator::pop,
)
@@ -584,7 +596,10 @@ private data class TrackDateRemoverScreen(
Text(text = stringResource(android.R.string.cancel))
}
FilledTonalButton(
onClick = { sm.removeDate(); navigator.popUntil { it is TrackInfoDialogHomeScreen } },
onClick = {
sm.removeDate()
navigator.popUntil { it is TrackInfoDialogHomeScreen }
},
colors = ButtonDefaults.filledTonalButtonColors(
containerColor = MaterialTheme.colorScheme.errorContainer,
contentColor = MaterialTheme.colorScheme.onErrorContainer,
@@ -646,7 +661,10 @@ data class TrackServiceSearchScreen(
queryResult = state.queryResult,
selected = state.selected,
onSelectedChange = sm::updateSelection,
onConfirmSelection = { sm.registerTracking(state.selected!!); navigator.pop() },
onConfirmSelection = {
sm.registerTracking(state.selected!!)
navigator.pop()
},
onDismissRequest = navigator::pop,
)
}
@@ -61,8 +61,8 @@ class ChapterLoader(
// If the chapter is partially read, set the starting page to the last the user read
// otherwise use the requested page.
if (!chapter.chapter.read /* --> EH */ || readerPrefs
.preserveReadingPosition()
.get() || page != null // <-- EH
.preserveReadingPosition()
.get() || page != null // <-- EH
) {
chapter.requestedPage = /* SY --> */ page ?: /* SY <-- */ chapter.chapter.last_page_read
}
@@ -261,12 +261,12 @@ class PagerPageHolder(
return if (imageStream is BufferedInputStream &&
!ImageUtil.isAnimatedAndSupported(imageStream) &&
ImageUtil.isWideImage(
imageStream,
// SY -->
page.zip4jFile,
page.zip4jEntry,
// SY <--
) &&
imageStream,
// SY -->
page.zip4jFile,
page.zip4jEntry,
// SY <--
) &&
viewer.config.centerMarginType and PagerConfig.CenterMarginType.WIDE_PAGE_CENTER_MARGIN > 0 &&
!viewer.config.imageCropBorders
) {
@@ -375,11 +375,11 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() {
setJoinedItems(
oldCurrent?.second == current ||
(current.index + 1) < (
(
oldCurrent?.second
?: oldCurrent?.first
) as? ReaderPage
)?.index ?: 0,
(
oldCurrent?.second
?: oldCurrent?.first
) as? ReaderPage
)?.index ?: 0,
)
// The listener may be removed when we split a page, so the ui may not have updated properly
@@ -135,7 +135,7 @@ fun PagePreviewPageDialog(
TextButton(onClick = {
onPageSelected(page.roundToInt())
onDismissPageDialog()
},) {
}) {
Text(stringResource(R.string.action_ok))
}
},
@@ -88,7 +88,7 @@ object Entry {
override val key = "uh"
}
/* ktlint-disable enum-entry-name-case */
@Suppress("ktlint:standard:enum-entry-name-case")
enum class ImageSize(override val value: String) : ConfigItem {
AUTO("0"),
`2400`("5"),
@@ -100,7 +100,6 @@ object Entry {
override val key = "xr"
}
/* ktlint-enable experimental:enum-entry-name-case */
enum class TitleDisplayLanguage(override val value: String) : ConfigItem {
DEFAULT("0"),
@@ -116,7 +115,7 @@ object Entry {
override val value = "2"
}
/* ktlint-disable experimental:enum-entry-name-case */
@Suppress("ktlint:standard:enum-entry-name-case")
enum class SearchResultsCount(override val value: String) : ConfigItem {
`25`("0"),
`50`("1"),
@@ -127,6 +126,7 @@ object Entry {
override val key = "rc"
}
@Suppress("ktlint:standard:enum-entry-name-case")
enum class ThumbnailRows(override val value: String) : ConfigItem {
`4`("0"),
`10`("1"),
@@ -136,7 +136,6 @@ object Entry {
override val key = "tr"
}
/* ktlint-enable enum-entry-name-case */
enum class UseOriginalImages(override val value: String) : ConfigItem {
NO("0"),