From ff306f92bb4350ae036bffc053f62a35f93e74a1 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Tue, 12 Nov 2024 17:22:52 +0100 Subject: [PATCH] bumping ktlint engine version to 1.4.1, disabled new when-entry-bracing rule as it was a bit too aggressive --- .editorconfig | 1 + build.gradle.kts | 2 +- .../main/kotlin/org/jetbrains/kotlinx/dataframe/math/mean.kt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index cb28f789b2..be0f4587f3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,6 +32,7 @@ ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_e ktlint_standard_chain-method-continuation = disabled ktlint_ignore_back_ticked_identifier = true ktlint_standard_multiline-expression-wrapping = disabled +ktlint_standard_when-entry-bracing = disabled [{*/build/**/*,**/*keywords*/**,**/*.Generated.kt,**/*$Extensions.kt}] ktlint = disabled diff --git a/build.gradle.kts b/build.gradle.kts index 54209b4da9..bb0df363e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -153,7 +153,7 @@ allprojects { afterEvaluate { try { configure { - version = "1.3.0" + version = "1.4.1" // rules are set up through .editorconfig } } catch (_: UnknownDomainObjectException) { diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/math/mean.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/math/mean.kt index d4deec31a1..40fe9bbce1 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/math/mean.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/math/mean.kt @@ -11,6 +11,7 @@ import kotlin.reflect.full.withNullability internal fun Iterable.mean(type: KType, skipNA: Boolean = skipNA_default): Double = asSequence().mean(type, skipNA) +@Suppress("UNCHECKED_CAST") internal fun Sequence.mean(type: KType, skipNA: Boolean = skipNA_default): Double { if (type.isMarkedNullable) { return filterNotNull().mean(type.withNullability(false), skipNA)