Switch to different ktlint plugin

Should be better at incremental builds.
To format, run `./gradlew ktlintFormat`.
This commit is contained in:
arkon
2023-09-01 23:02:18 -04:00
parent 772db51593
commit d29b7c4e57
69 changed files with 628 additions and 291 deletions

View File

@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jmailen.gradle.kotlinter.tasks.LintTask
plugins {
id("com.android.application")
@ -104,15 +103,17 @@ android {
}
packaging {
resources.excludes.addAll(listOf(
"META-INF/DEPENDENCIES",
"LICENSE.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/README.md",
"META-INF/NOTICE",
"META-INF/*.kotlin_module",
))
resources.excludes.addAll(
listOf(
"META-INF/DEPENDENCIES",
"LICENSE.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/README.md",
"META-INF/NOTICE",
"META-INF/*.kotlin_module",
),
)
}
dependenciesInfo {
@ -264,7 +265,9 @@ androidComponents {
beforeVariants { variantBuilder ->
// Disables standardBenchmark
if (variantBuilder.buildType == "benchmark") {
variantBuilder.enable = variantBuilder.productFlavors.containsAll(listOf("default" to "dev"))
variantBuilder.enable = variantBuilder.productFlavors.containsAll(
listOf("default" to "dev"),
)
}
}
onVariants(selector().withFlavor("default" to "standard")) {
@ -275,10 +278,6 @@ androidComponents {
}
tasks {
withType<LintTask>().configureEach {
exclude { it.file.path.contains("generated[\\\\/]".toRegex()) }
}
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
@ -303,12 +302,12 @@ tasks {
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
project.buildDir.absolutePath + "/compose_metrics",
)
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
project.buildDir.absolutePath + "/compose_metrics",
)
}
}

View File

@ -162,7 +162,7 @@ fun CategoryDeleteDialog(
TextButton(onClick = {
onDelete()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},
@ -217,7 +217,7 @@ fun ChangeCategoryDialog(
tachiyomi.presentation.core.components.material.TextButton(onClick = {
onDismissRequest()
onEditCategories()
},) {
}) {
Text(text = stringResource(R.string.action_edit))
}
Spacer(modifier = Modifier.weight(1f))

View File

@ -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))
}
},

View File

@ -91,7 +91,7 @@ fun SetIntervalDialog(
TextButton(onClick = {
onValueChanged(selectedInterval)
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},

View File

@ -108,11 +108,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,
)
}"
}
}

View File

@ -4,7 +4,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.more.settings.Preference.PreferenceItem
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.TrackService
import tachiyomi.core.preference.Preference as PreferenceData

View File

@ -21,7 +21,7 @@ fun UpdatesDeleteConfirmationDialog(
TextButton(onClick = {
onConfirm()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},

View File

@ -64,7 +64,7 @@ fun SourceFilterDialog(
Button(onClick = {
onFilter()
onDismissRequest()
},) {
}) {
Text(stringResource(R.string.action_filter))
}
}

View File

@ -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,
)
}