Skip to content

Commit

Permalink
chore: Remove MaximumLineLength detekt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joc-a committed Jul 14, 2023
1 parent 7281f78 commit 148b975
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,12 @@ abstract class EntityClass<ID : Comparable<ID>, out T : Entity<ID>>(
* Can be useful when references target the same entities. That will prevent from loading them multiple times (per each reference row) and will require
* less memory/bandwidth for "heavy" entities (with a lot of columns or columns with huge data in it)
*/
fun <SID : Comparable<SID>> warmUpLinkedReferences(references: List<EntityID<SID>>, linkTable: Table, forUpdate: Boolean? = null, optimizedLoad: Boolean = false): List<T> {
fun <SID : Comparable<SID>> warmUpLinkedReferences(
references: List<EntityID<SID>>,
linkTable: Table,
forUpdate: Boolean? = null,
optimizedLoad: Boolean = false
): List<T> {
if (references.isEmpty()) return emptyList()

val sourceRefColumn = linkTable.columns.singleOrNull { it.referee == references.first().table.id } as? Column<EntityID<SID>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ private fun assertEqualFractionalPart(nano1: Int, nano2: Int) {
// accurate to 100 nanoseconds
is SQLServerDialect -> assertEquals(roundTo100Nanos(nano1), roundTo100Nanos(nano2), "Failed on 1/10th microseconds ${currentDialectTest.name}")
// microseconds
is H2Dialect, is MariaDBDialect, is PostgreSQLDialect, is PostgreSQLNGDialect -> assertEquals(roundToMicro(nano1), roundToMicro(nano2), "Failed on microseconds ${currentDialectTest.name}")
is H2Dialect, is MariaDBDialect, is PostgreSQLDialect, is PostgreSQLNGDialect ->
assertEquals(roundToMicro(nano1), roundToMicro(nano2), "Failed on microseconds ${currentDialectTest.name}")
is MysqlDialect ->
if ((currentDialectTest as? MysqlDialect)?.isFractionDateTimeSupported() == true) {
// this should be uncommented, but mysql has different microseconds between save & read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("MaximumLineLength")

package org.jetbrains.exposed

import org.jetbrains.exposed.sql.*
Expand Down Expand Up @@ -1240,7 +1242,7 @@ class MiscTableTest : DatabaseTestsBase() {
exec("INSERT IGNORE INTO `zerodatetimetable` (dt1,dt2,ts1,ts2) VALUES ('0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00');")
val row = ZeroDateTimeTable.selectAll().first()

for (c in listOf(ZeroDateTimeTable.dt1, ZeroDateTimeTable.dt2, ZeroDateTimeTable.ts1, ZeroDateTimeTable.ts2)) {
listOf(ZeroDateTimeTable.dt1, ZeroDateTimeTable.dt2, ZeroDateTimeTable.ts1, ZeroDateTimeTable.ts2).forEach { c ->
val actual = row[c]
assertNull(actual, "$c expected null but was $actual")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("MaximumLineLength")

package org.jetbrains.exposed

import org.jetbrains.exposed.sql.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ private fun assertEqualFractionalPart(nano1: Int, nano2: Int) {
// accurate to 100 nanoseconds
is SQLServerDialect -> assertEquals(roundTo100Nanos(nano1), roundTo100Nanos(nano2), "Failed on 1/10th microseconds ${currentDialectTest.name}")
// microseconds
is H2Dialect, is MariaDBDialect, is PostgreSQLDialect, is PostgreSQLNGDialect -> assertEquals(roundToMicro(nano1), roundToMicro(nano2), "Failed on microseconds ${currentDialectTest.name}")
is H2Dialect, is MariaDBDialect, is PostgreSQLDialect, is PostgreSQLNGDialect ->
assertEquals(roundToMicro(nano1), roundToMicro(nano2), "Failed on microseconds ${currentDialectTest.name}")
is MysqlDialect ->
if ((currentDialectTest as? MysqlDialect)?.isFractionDateTimeSupported() == true) {
// this should be uncommented, but mysql has different microseconds between save & read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@file:OptIn(ExperimentalTime::class)
@file:Suppress("MaximumLineLength")

package org.jetbrains.exposed.sql.kotlin.datetime

Expand Down Expand Up @@ -1241,7 +1242,7 @@ class MiscTableTest : DatabaseTestsBase() {
exec("INSERT IGNORE INTO `zerodatetimetable` (dt1,dt2,ts1,ts2) VALUES ('0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00');")
val row = ZeroDateTimeTable.selectAll().first()

for (c in listOf(ZeroDateTimeTable.dt1, ZeroDateTimeTable.dt2, ZeroDateTimeTable.ts1, ZeroDateTimeTable.ts2)) {
listOf(ZeroDateTimeTable.dt1, ZeroDateTimeTable.dt2, ZeroDateTimeTable.ts1, ZeroDateTimeTable.ts2).forEach { c ->
val actual = row[c]
assertNull(actual, "$c expected null but was $actual")
}
Expand Down

0 comments on commit 148b975

Please sign in to comment.