Skip to content

Commit 77af108

Browse files
committed
Configured detekt for the project and addressed the warnings
Signed-off-by: Abhijit Naik <[email protected]>
1 parent 1194f45 commit 77af108

25 files changed

+1981
-1012
lines changed

app/build.gradle.kts

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import io.gitlab.arturbosch.detekt.Detekt
12
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
23

34
plugins {
@@ -6,6 +7,7 @@ plugins {
67
alias(libs.plugins.hilt)
78
alias(libs.plugins.ksp)
89
alias(libs.plugins.ktlint)
10+
alias(libs.plugins.detekt)
911
}
1012

1113
android {
@@ -56,6 +58,13 @@ android {
5658
}
5759
}
5860

61+
tasks.withType<Detekt>().configureEach {
62+
reports {
63+
html.required.set(true) // observe findings in browser with structure and code snippets
64+
md.required.set(true) // simple Markdown format
65+
}
66+
}
67+
5968
packaging {
6069
resources {
6170
excludes += "/META-INF/{AL2.0,LGPL2.1}"

app/src/main/java/com/compose/weatherapplite/data/repository/WeatherRepositoryImpl.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class WeatherRepositoryImpl @Inject constructor(
3838
val data = response.toWeatherInfo()
3939
Resource.Success(data = data)
4040
} catch (e: HttpException) {
41-
e.printStackTrace()
41+
Log.e(TAG, "ERROR: Failed api request - ${e.message()}")
4242
Resource.Error("Failed api request")
4343
}
4444
}
@@ -57,7 +57,7 @@ class WeatherRepositoryImpl @Inject constructor(
5757
val data = response.toGeoCodingInfo()
5858
Resource.Success(data = data)
5959
} catch (e: HttpException) {
60-
e.printStackTrace()
60+
Log.e(TAG, "ERROR: Failed api request - ${e.message()}")
6161
Resource.Error("Failed api request")
6262
}
6363
}

0 commit comments

Comments
 (0)