Skip to content

Commit

Permalink
Bump up the static analysis tools
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikSOffice committed Aug 12, 2023
1 parent f68adf2 commit 918ce98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
@@ -0,0 +1,3 @@
[*.{kt,kts}]
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_allow_trailing_comma = false
6 changes: 3 additions & 3 deletions build.gradle
Expand Up @@ -26,9 +26,9 @@ buildscript {
ext {
kotlinVersion = "1.7.21"
androidGradleVersion = "7.3.0"
detektVersion = "1.17.1"
ktlintVersion = "0.41.0"
ktlintGradleVersion = "10.1.0"
detektVersion = "1.23.1"
ktlintVersion = "0.50.0"
ktlintGradleVersion = "11.5.1"

appCompatVersion = "1.5.1"
androidXCoreVersion = "1.9.0"
Expand Down
2 changes: 1 addition & 1 deletion static-analysis.gradle
Expand Up @@ -26,7 +26,7 @@ apply plugin: "io.gitlab.arturbosch.detekt"
apply plugin: "org.jlleitschuh.gradle.ktlint"

android {
lintOptions {
lint {
disable 'GradleDependency'
warningsAsErrors true
abortOnError true
Expand Down
6 changes: 2 additions & 4 deletions venom/src/main/java/com/github/venom/Venom.kt
Expand Up @@ -102,9 +102,7 @@ class Venom private constructor(
*/
@JvmStatic
fun setGlobalInstance(venom: Venom) {
if (instance != null) {
throw IllegalStateException("The global instance is already initialized")
}
check(instance == null) { "The global instance is already initialized" }
instance = venom
}

Expand All @@ -115,7 +113,7 @@ class Venom private constructor(
*/
@JvmStatic
fun getGlobalInstance(): Venom {
return instance ?: throw IllegalStateException("The global instance is not initialized")
return checkNotNull(instance) { "The global instance is not initialized" }
}

internal fun createInstance(
Expand Down

0 comments on commit 918ce98

Please sign in to comment.