From ae4f2463f7118a9fa52acc12be5e57361175eb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brais=20Gab=C3=ADn?= Date: Wed, 20 Jul 2022 22:52:08 +0200 Subject: [PATCH] Update detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com> --- .../arturbosch/detekt/rules/style/ForbiddenImport.kt | 2 +- .../arturbosch/detekt/rules/style/ForbiddenMethodCall.kt | 2 +- .../arturbosch/detekt/rules/style/ForbiddenImportSpec.kt | 8 ++++---- .../detekt/rules/style/ForbiddenMethodCallSpec.kt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImport.kt b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImport.kt index c8ed4d005f4..ed6a1b474c8 100644 --- a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImport.kt +++ b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImport.kt @@ -62,7 +62,7 @@ class ForbiddenImport(config: Config = Config.empty) : Rule(config) { } private fun defaultReason(forbiddenImport: String): String { - return "The import `$forbiddenImport` has been forbidden in the Detekt config." + return "The import `$forbiddenImport` has been forbidden in the detekt config." } private fun containsForbiddenPattern(import: String): Boolean = diff --git a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt index db9da2e971e..a49cfb05eb2 100644 --- a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt +++ b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt @@ -121,7 +121,7 @@ class ForbiddenMethodCall(config: Config = Config.empty) : Rule(config) { val message = if (forbidden.reason != null) { "The method `${forbidden.value}` has been forbidden: ${forbidden.reason}" } else { - "The method `${forbidden.value}` has been forbidden in the Detekt config." + "The method `${forbidden.value}` has been forbidden in the detekt config." } report(CodeSmell(issue, Entity.from(expression), message)) } diff --git a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImportSpec.kt b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImportSpec.kt index 3e8e4e842cc..18370f8a807 100644 --- a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImportSpec.kt +++ b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImportSpec.kt @@ -48,8 +48,8 @@ class ForbiddenImportSpec { assertThat(findings) .extracting("message") .containsExactlyInAnyOrder( - "The import `kotlin.jvm.JvmField` has been forbidden in the Detekt config.", - "The import `kotlin.SinceKotlin` has been forbidden in the Detekt config.", + "The import `kotlin.jvm.JvmField` has been forbidden in the detekt config.", + "The import `kotlin.SinceKotlin` has been forbidden in the detekt config.", ) } @@ -133,8 +133,8 @@ class ForbiddenImportSpec { ForbiddenImport(TestConfig(mapOf(FORBIDDEN_PATTERNS to "net.*R|com.*expiremental"))).lint(code) assertThat(findings).hasSize(2) assertThat(findings[0].message) - .isEqualTo("The import `net.example.R.dimen` has been forbidden in the Detekt config.") + .isEqualTo("The import `net.example.R.dimen` has been forbidden in the detekt config.") assertThat(findings[1].message) - .isEqualTo("The import `net.example.R.dimension` has been forbidden in the Detekt config.") + .isEqualTo("The import `net.example.R.dimension` has been forbidden in the detekt config.") } } diff --git a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCallSpec.kt b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCallSpec.kt index e0b456d798e..c5485f58ea1 100644 --- a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCallSpec.kt +++ b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCallSpec.kt @@ -192,7 +192,7 @@ class ForbiddenMethodCallSpec(val env: KotlinCoreEnvironment) { assertThat(findings).hasSize(1) assertThat(findings).hasSourceLocation(5, 26) assertThat(findings[0]) - .hasMessage("The method `java.time.LocalDate.now()` has been forbidden in the Detekt config.") + .hasMessage("The method `java.time.LocalDate.now()` has been forbidden in the detekt config.") } @Test