From a4aed8e7a707f22243d2e5ccf258a64c6ac607c4 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Fri, 30 Aug 2024 15:08:31 +0400 Subject: [PATCH] Fix detekt warnings --- .../io/github/optimumcode/json/schema/FormatValidator.kt | 3 ++- .../optimumcode/json/schema/internal/util/NumberParts.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/FormatValidator.kt b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/FormatValidator.kt index 63eefb2..6351a59 100644 --- a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/FormatValidator.kt +++ b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/FormatValidator.kt @@ -5,7 +5,8 @@ import kotlin.jvm.JvmStatic /** * The [FormatValidator] is used to check whether the [AbstractElement] matches the expected format. - * If the [AbstractElement] is not of the required type (e.g. validator expects string but the [AbstractElement] is an object) + * If the [AbstractElement] is not of the required type + * (e.g. validator expects string but the [AbstractElement] is an object) * the validator **MUST** return [FormatValidator.Valid] result */ @ExperimentalApi diff --git a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/internal/util/NumberParts.kt b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/internal/util/NumberParts.kt index d281ba5..b36aaf9 100644 --- a/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/internal/util/NumberParts.kt +++ b/json-schema-validator/src/commonMain/kotlin/io/github/optimumcode/json/schema/internal/util/NumberParts.kt @@ -25,6 +25,7 @@ private const val TEN: Double = 10.0 * This function should be used only if you are certain that the [element] is a number */ internal fun numberParts(element: PrimitiveElement): NumberParts { + @Suppress("detekt:ForbiddenComment") if (element.content.run { contains(E_SMALL_CHAR) || contains(E_BIG_CHAR) }) { // FIXME: if we add support for YAML then we should handle +Inf and -Inf values correctly val number = requireNotNull(element.number) { "element '${element.content}' is not a number" }