mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
Remove detekt (#1130)
Annoying. More annoying in this project. (cherry picked from commit 777ae2461e1eb277a3aa0c998ff69e4f100387a1)
This commit is contained in:
parent
410832fba6
commit
aeb17fa859
26 changed files with 10 additions and 2441 deletions
9
.github/workflows/build_pull_request.yml
vendored
9
.github/workflows/build_pull_request.yml
vendored
|
@ -36,10 +36,11 @@ jobs:
|
||||||
java-version: 17
|
java-version: 17
|
||||||
distribution: adopt
|
distribution: adopt
|
||||||
|
|
||||||
- name: Build app and run unit tests
|
- name: Set up gradle
|
||||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||||
with:
|
|
||||||
arguments: detekt assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest
|
- name: Build app and run unit tests
|
||||||
|
run: ./gradlew assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -51,4 +52,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mapping-${{ github.sha }}
|
name: mapping-${{ github.sha }}
|
||||||
path: app/build/outputs/mapping/standardRelease
|
path: app/build/outputs/mapping/standardRelease
|
||||||
|
|
7
.github/workflows/build_push.yml
vendored
7
.github/workflows/build_push.yml
vendored
|
@ -33,10 +33,11 @@ jobs:
|
||||||
java-version: 17
|
java-version: 17
|
||||||
distribution: adopt
|
distribution: adopt
|
||||||
|
|
||||||
- name: Build app and run unit tests
|
- name: Set up gradle
|
||||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||||
with:
|
|
||||||
arguments: detekt assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest
|
- name: Build app and run unit tests
|
||||||
|
run: ./gradlew assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
@ -24,10 +24,6 @@ Before you start, please note that the ability to use following technologies is
|
||||||
- [Android Studio](https://developer.android.com/studio)
|
- [Android Studio](https://developer.android.com/studio)
|
||||||
- Emulator or phone with developer options enabled to test changes.
|
- Emulator or phone with developer options enabled to test changes.
|
||||||
|
|
||||||
## Linting
|
|
||||||
|
|
||||||
Run the `detekt` gradle task. If the build fails, a report of issues can be found in `app/build/reports/detekt/`. The report is availble in several formats and details each issue that needs attention.
|
|
||||||
|
|
||||||
## Getting help
|
## Getting help
|
||||||
|
|
||||||
- Join [the Discord server](https://discord.gg/F32UjdJZrR) for online help and to ask questions while developing.
|
- Join [the Discord server](https://discord.gg/F32UjdJZrR) for online help and to ask questions while developing.
|
||||||
|
|
|
@ -33,7 +33,6 @@ import uy.kohesive.injekt.api.get
|
||||||
/**
|
/**
|
||||||
* For invoking back press to the parent activity
|
* For invoking back press to the parent activity
|
||||||
*/
|
*/
|
||||||
@SuppressLint("ComposeCompositionLocalUsage")
|
|
||||||
val LocalBackPress: ProvidableCompositionLocal<(() -> Unit)?> = staticCompositionLocalOf { null }
|
val LocalBackPress: ProvidableCompositionLocal<(() -> Unit)?> = staticCompositionLocalOf { null }
|
||||||
|
|
||||||
private val uiPreferences: UiPreferences = Injekt.get()
|
private val uiPreferences: UiPreferences = Injekt.get()
|
||||||
|
|
|
@ -165,7 +165,6 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
|
||||||
override fun newImageLoader(context: Context): ImageLoader {
|
override fun newImageLoader(context: Context): ImageLoader {
|
||||||
return ImageLoader.Builder(this).apply {
|
return ImageLoader.Builder(this).apply {
|
||||||
val callFactoryLazy = lazy { Injekt.get<NetworkHelper>().client }
|
val callFactoryLazy = lazy { Injekt.get<NetworkHelper>().client }
|
||||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.backup.models
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoNumber
|
import kotlinx.serialization.protobuf.ProtoNumber
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Backup(
|
data class Backup(
|
||||||
@ProtoNumber(1) val backupManga: List<BackupManga> = emptyList(),
|
@ProtoNumber(1) val backupManga: List<BackupManga> = emptyList(),
|
||||||
|
|
|
@ -4,7 +4,6 @@ import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoNumber
|
import kotlinx.serialization.protobuf.ProtoNumber
|
||||||
import tachiyomi.domain.items.chapter.model.Chapter
|
import tachiyomi.domain.items.chapter.model.Chapter
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class BackupChapter(
|
data class BackupChapter(
|
||||||
// in 1.x some of these values have different names
|
// in 1.x some of these values have different names
|
||||||
|
|
|
@ -4,7 +4,6 @@ import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoNumber
|
import kotlinx.serialization.protobuf.ProtoNumber
|
||||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class BackupExtensionRepos(
|
class BackupExtensionRepos(
|
||||||
@ProtoNumber(1) var baseUrl: String,
|
@ProtoNumber(1) var baseUrl: String,
|
||||||
|
|
|
@ -5,10 +5,7 @@ import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoNumber
|
import kotlinx.serialization.protobuf.ProtoNumber
|
||||||
import tachiyomi.domain.entries.manga.model.Manga
|
import tachiyomi.domain.entries.manga.model.Manga
|
||||||
|
|
||||||
@Suppress(
|
@Suppress("DEPRECATION")
|
||||||
"DEPRECATION",
|
|
||||||
"MagicNumber",
|
|
||||||
)
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class BackupManga(
|
data class BackupManga(
|
||||||
// in 1.x some of these values have different names
|
// in 1.x some of these values have different names
|
||||||
|
|
|
@ -45,7 +45,6 @@ import java.io.IOException
|
||||||
* Available request parameter:
|
* Available request parameter:
|
||||||
* - [USE_CUSTOM_COVER_KEY]: Use custom cover if set by user, default is true
|
* - [USE_CUSTOM_COVER_KEY]: Use custom cover if set by user, default is true
|
||||||
*/
|
*/
|
||||||
@Suppress("LongParameterList")
|
|
||||||
class MangaCoverFetcher(
|
class MangaCoverFetcher(
|
||||||
private val url: String?,
|
private val url: String?,
|
||||||
private val isLibraryManga: Boolean,
|
private val isLibraryManga: Boolean,
|
||||||
|
|
|
@ -12,7 +12,6 @@ class MigrationJobFactory(
|
||||||
private val scope: CoroutineScope
|
private val scope: CoroutineScope
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@SuppressWarnings("MaxLineLength")
|
|
||||||
fun create(migrations: List<Migration>): Deferred<Boolean> = with(scope) {
|
fun create(migrations: List<Migration>): Deferred<Boolean> = with(scope) {
|
||||||
return migrations.sortedBy { it.version }
|
return migrations.sortedBy { it.version }
|
||||||
.fold(CompletableDeferred(true)) { acc: Deferred<Boolean>, migration: Migration ->
|
.fold(CompletableDeferred(true)) { acc: Deferred<Boolean>, migration: Migration ->
|
||||||
|
|
|
@ -6,7 +6,6 @@ dependencies {
|
||||||
implementation(androidx.gradle)
|
implementation(androidx.gradle)
|
||||||
implementation(kotlinx.gradle)
|
implementation(kotlinx.gradle)
|
||||||
implementation(kotlinx.compose.compiler.gradle)
|
implementation(kotlinx.compose.compiler.gradle)
|
||||||
implementation(libs.detekt.gradlePlugin)
|
|
||||||
implementation(gradleApi())
|
implementation(gradleApi())
|
||||||
|
|
||||||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||||
|
|
|
@ -3,7 +3,6 @@ import mihon.buildlogic.configureAndroid
|
||||||
import mihon.buildlogic.configureTest
|
import mihon.buildlogic.configureTest
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("mihon.code.detekt")
|
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
kotlin("android")
|
kotlin("android")
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ import mihon.buildlogic.configureAndroid
|
||||||
import mihon.buildlogic.configureTest
|
import mihon.buildlogic.configureTest
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("mihon.code.detekt")
|
|
||||||
id("com.android.test")
|
id("com.android.test")
|
||||||
kotlin("android")
|
kotlin("android")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import io.gitlab.arturbosch.detekt.Detekt
|
|
||||||
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
|
|
||||||
import org.gradle.accessors.dm.LibrariesForLibs
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("io.gitlab.arturbosch.detekt")
|
|
||||||
}
|
|
||||||
|
|
||||||
val libs = the<LibrariesForLibs>()
|
|
||||||
dependencies {
|
|
||||||
detektPlugins(libs.detekt.rules.formatting)
|
|
||||||
detektPlugins(libs.detekt.rules.compose)
|
|
||||||
}
|
|
||||||
|
|
||||||
private val configFile = files("$rootDir/config/detekt/detekt.yml")
|
|
||||||
private val baselineFile = file("$rootDir/config/detekt/baseline.xml")
|
|
||||||
private val kotlinFiles = "**/*.kt"
|
|
||||||
private val resourceFiles = "**/resources/**"
|
|
||||||
private val buildFiles = "**/build/**"
|
|
||||||
private val generatedFiles = "**/generated/**"
|
|
||||||
private val scriptsFiles = "**/*.kts"
|
|
||||||
|
|
||||||
detekt {
|
|
||||||
buildUponDefaultConfig = true
|
|
||||||
parallel = true
|
|
||||||
autoCorrect = false
|
|
||||||
ignoreFailures = false
|
|
||||||
config.setFrom(configFile)
|
|
||||||
baseline = file(baselineFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Detekt>().configureEach {
|
|
||||||
include(kotlinFiles)
|
|
||||||
exclude(resourceFiles, buildFiles, generatedFiles, scriptsFiles)
|
|
||||||
reports {
|
|
||||||
html.required.set(true)
|
|
||||||
xml.required.set(false)
|
|
||||||
txt.required.set(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Detekt>().configureEach {
|
|
||||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
||||||
}
|
|
||||||
tasks.withType<DetektCreateBaselineTask>().configureEach {
|
|
||||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
import mihon.buildlogic.configureCompose
|
import mihon.buildlogic.configureCompose
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("mihon.code.detekt")
|
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import mihon.buildlogic.configureAndroid
|
||||||
import mihon.buildlogic.configureTest
|
import mihon.buildlogic.configureTest
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("mihon.code.detekt")
|
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,22 +0,0 @@
|
||||||
naming:
|
|
||||||
FunctionNaming:
|
|
||||||
functionPattern: '[a-z][a-zA-Z0-9]*'
|
|
||||||
ignoreAnnotated: [ 'Composable' ]
|
|
||||||
TopLevelPropertyNaming:
|
|
||||||
constantPattern: '[A-Z][A-Za-z0-9]*'
|
|
||||||
complexity:
|
|
||||||
LongMethod:
|
|
||||||
ignoreAnnotated: [ 'Composable' ]
|
|
||||||
LongParameterList:
|
|
||||||
ignoreDefaultParameters: true
|
|
||||||
ignoreAnnotated: [ 'Composable' ]
|
|
||||||
style:
|
|
||||||
MagicNumber:
|
|
||||||
ignorePropertyDeclaration: true
|
|
||||||
ignoreCompanionObjectPropertyDeclaration: true
|
|
||||||
ReturnCount:
|
|
||||||
excludeGuardClauses: true
|
|
||||||
SerialVersionUIDInSerializableClass:
|
|
||||||
active: false
|
|
||||||
UnusedPrivateMember:
|
|
||||||
ignoreAnnotated: [ 'Preview' ]
|
|
|
@ -5,7 +5,6 @@ import tachiyomi.domain.entries.manga.model.Manga
|
||||||
import tachiyomi.domain.library.manga.LibraryManga
|
import tachiyomi.domain.library.manga.LibraryManga
|
||||||
|
|
||||||
object MangaMapper {
|
object MangaMapper {
|
||||||
@Suppress("LongParameterList")
|
|
||||||
fun mapManga(
|
fun mapManga(
|
||||||
id: Long,
|
id: Long,
|
||||||
source: Long,
|
source: Long,
|
||||||
|
@ -58,7 +57,6 @@ object MangaMapper {
|
||||||
version = version,
|
version = version,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Suppress("LongParameterList")
|
|
||||||
fun mapLibraryManga(
|
fun mapLibraryManga(
|
||||||
id: Long,
|
id: Long,
|
||||||
source: Long,
|
source: Long,
|
||||||
|
|
|
@ -67,7 +67,6 @@ class MangaRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
|
||||||
override suspend fun getUpcomingManga(statuses: Set<Long>): Flow<List<Manga>> {
|
override suspend fun getUpcomingManga(statuses: Set<Long>): Flow<List<Manga>> {
|
||||||
val epochMillis = LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toEpochSecond() * 1000
|
val epochMillis = LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toEpochSecond() * 1000
|
||||||
return handler.subscribeToList {
|
return handler.subscribeToList {
|
||||||
|
|
|
@ -127,7 +127,6 @@ class ChapterRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("LongParameterList")
|
|
||||||
private fun mapChapter(
|
private fun mapChapter(
|
||||||
id: Long,
|
id: Long,
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
|
|
|
@ -48,7 +48,6 @@ class CreateMangaExtensionRepo(
|
||||||
*
|
*
|
||||||
* @param repo Extension Repo holder for passing to DB/Error Dialog
|
* @param repo Extension Repo holder for passing to DB/Error Dialog
|
||||||
*/
|
*/
|
||||||
@Suppress("ReturnCount")
|
|
||||||
private suspend fun handleInsertionError(repo: ExtensionRepo): Result {
|
private suspend fun handleInsertionError(repo: ExtensionRepo): Result {
|
||||||
val repoExists = repository.getRepo(repo.baseUrl)
|
val repoExists = repository.getRepo(repo.baseUrl)
|
||||||
if (repoExists != null) {
|
if (repoExists != null) {
|
||||||
|
|
|
@ -17,7 +17,6 @@ class ExtensionRepoService(
|
||||||
) {
|
) {
|
||||||
val client = networkHelper.client
|
val client = networkHelper.client
|
||||||
|
|
||||||
@Suppress("TooGenericExceptionCaught")
|
|
||||||
suspend fun fetchRepoDetails(
|
suspend fun fetchRepoDetails(
|
||||||
repo: String,
|
repo: String,
|
||||||
): ExtensionRepo? {
|
): ExtensionRepo? {
|
||||||
|
|
|
@ -8,8 +8,6 @@ shizuku_version = "12.2.0"
|
||||||
sqldelight = "2.0.2"
|
sqldelight = "2.0.2"
|
||||||
sqlite = "2.4.0"
|
sqlite = "2.4.0"
|
||||||
voyager = "1.0.0"
|
voyager = "1.0.0"
|
||||||
detekt = "1.23.6"
|
|
||||||
detektCompose = "0.4.5"
|
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
desugar = "com.android.tools:desugar_jdk_libs:2.0.4"
|
desugar = "com.android.tools:desugar_jdk_libs:2.0.4"
|
||||||
|
@ -96,10 +94,6 @@ voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", vers
|
||||||
voyager-tab-navigator = { module = "cafe.adriel.voyager:voyager-tab-navigator", version.ref = "voyager" }
|
voyager-tab-navigator = { module = "cafe.adriel.voyager:voyager-tab-navigator", version.ref = "voyager" }
|
||||||
voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" }
|
voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" }
|
||||||
|
|
||||||
detekt-gradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
|
|
||||||
detekt-rules-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
|
|
||||||
detekt-rules-compose = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
|
|
||||||
|
|
||||||
aniyomi-mpv = "com.github.aniyomiorg:aniyomi-mpv-lib:1.15.n"
|
aniyomi-mpv = "com.github.aniyomiorg:aniyomi-mpv-lib:1.15.n"
|
||||||
ffmpeg-kit = "com.github.jmir1:ffmpeg-kit:1.15"
|
ffmpeg-kit = "com.github.jmir1:ffmpeg-kit:1.15"
|
||||||
arthenica-smartexceptions = "com.arthenica:smart-exception-java:0.2.1"
|
arthenica-smartexceptions = "com.arthenica:smart-exception-java:0.2.1"
|
||||||
|
|
|
@ -152,7 +152,6 @@ fun Scaffold(
|
||||||
* @param bottomBar the content to place at the bottom of the [Scaffold], on top of the
|
* @param bottomBar the content to place at the bottom of the [Scaffold], on top of the
|
||||||
* [content], typically a [NavigationBar].
|
* [content], typically a [NavigationBar].
|
||||||
*/
|
*/
|
||||||
@Suppress("CyclomaticComplexMethod")
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
private fun ScaffoldLayout(
|
private fun ScaffoldLayout(
|
||||||
|
|
Loading…
Reference in a new issue