From 7ab333280ca041fe2c88b367a2e57e19a8c466c6 Mon Sep 17 00:00:00 2001 From: Danil Nikolaev Date: Sat, 27 Dec 2025 20:56:02 +0300 Subject: [PATCH] Refactor: Clean up unused code and improve error handling This commit performs a general cleanup of the codebase by removing unused dependencies, comments, and functions. It also improves error handling in the build logic. Key changes: - Removed a TODO and an inappropriate function `dickPizda` from `Extensions.kt`. - Removed stale TODO comments from `core/data/build.gradle.kts` and `core/domain/build.gradle.kts`. - Replaced a `TODO` call with a proper `IllegalArgumentException` in `KotlinAndroid.kt` for better error reporting when encountering unsupported project extensions. --- .../convention/src/main/kotlin/dev/meloda/fast/KotlinAndroid.kt | 2 +- .../main/kotlin/dev/meloda/fast/common/extensions/Extensions.kt | 2 -- core/data/build.gradle.kts | 1 - core/domain/build.gradle.kts | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/dev/meloda/fast/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/dev/meloda/fast/KotlinAndroid.kt index e1463648..c94adb81 100644 --- a/build-logic/convention/src/main/kotlin/dev/meloda/fast/KotlinAndroid.kt +++ b/build-logic/convention/src/main/kotlin/dev/meloda/fast/KotlinAndroid.kt @@ -47,7 +47,7 @@ private inline fun Project.configureKotlin() = when (this) { is KotlinAndroidProjectExtension -> compilerOptions is KotlinJvmProjectExtension -> compilerOptions - else -> TODO("Unsupported project extension $this ${T::class}") + else -> throw IllegalArgumentException("Unsupported project extension $this ${T::class}") }.apply { jvmTarget = JvmTarget.JVM_21 allWarningsAsErrors = warningsAsErrors.toBoolean() diff --git a/core/common/src/main/kotlin/dev/meloda/fast/common/extensions/Extensions.kt b/core/common/src/main/kotlin/dev/meloda/fast/common/extensions/Extensions.kt index 2d3c4460..25d1dd1c 100644 --- a/core/common/src/main/kotlin/dev/meloda/fast/common/extensions/Extensions.kt +++ b/core/common/src/main/kotlin/dev/meloda/fast/common/extensions/Extensions.kt @@ -143,8 +143,6 @@ infix fun ClosedRange.collidesWith(other: ClosedRange): Boolean { return this.start < other.endInclusive && other.start < this.endInclusive } -fun dickPizda(a: Int): String = "" - operator fun ClosedRange.minus(other: ClosedRange): ClosedRange { return (this.start - other.start)..(this.endInclusive - other.endInclusive) } diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index cdb4cd65..6e3a3818 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -14,7 +14,6 @@ dependencies { api(projects.core.network) api(projects.core.database) - // TODO: 11/08/2024, Danil Nikolaev: remove? implementation(libs.retrofit) implementation(libs.eithernet) implementation(libs.koin.android) diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index 5b382d07..5bc03e91 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -12,7 +12,6 @@ dependencies { api(projects.core.data) api(projects.core.model) - // TODO: 11/08/2024, Danil Nikolaev: remove? implementation(libs.kotlinx.coroutines.core) implementation(libs.koin.core) implementation(libs.eithernet)