Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshlha committed Feb 16, 2024
1 parent ed660d3 commit ed70f5d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 62 deletions.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ spotless {
formatAnnotations()
}
kotlin {
ktlint()
ktlint().editorConfigOverride(
mapOf("multiline-expression-wrapping" to "disabled"),
)
}
kotlinGradle {
ktlint()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ class CacheView(private val path: Path) : ToolPanel() {
title = name,
body = errors.ifEmpty { listOf("No errors associated with this schema.") },
details =
mapOf(
"ID" to id.toString(),
),
mapOf(
"ID" to id.toString(),
),
)
}

Expand Down Expand Up @@ -267,9 +267,9 @@ class CacheView(private val path: Path) : ToolPanel() {
Detail(
title = TRANSACTION_GROUP_DATA,
body =
map { row ->
(row as Array<*>).contentToString()
},
map { row ->
(row as Array<*>).contentToString()
},
)
} else {
Detail(
Expand Down Expand Up @@ -304,27 +304,27 @@ class CacheView(private val path: Path) : ToolPanel() {
return Detail(
title = this::class.java.simpleName,
body =
this.map { historicalTagValue ->
buildString {
append(historicalTagValue.source.toStringFull())
append(", ")
append(historicalTagValue.typeClass.name)
append(", ")
append(historicalTagValue.value)
append(", ")
append(historicalTagValue.interpolationMode.name)
append(", ")
append(historicalTagValue.timestampSource.name)
}
},
this.map { historicalTagValue ->
buildString {
append(historicalTagValue.source.toStringFull())
append(", ")
append(historicalTagValue.typeClass.name)
append(", ")
append(historicalTagValue.value)
append(", ")
append(historicalTagValue.interpolationMode.name)
append(", ")
append(historicalTagValue.timestampSource.name)
}
},
details =
mapOf(
"gatewayName" to gatewayName,
"provider" to providerName,
"setName" to setName,
"execRate" to execRate.toString(),
"execTime" to executionTime.time.toString(),
),
mapOf(
"gatewayName" to gatewayName,
"provider" to providerName,
"setName" to setName,
"execRate" to execRate.toString(),
"execTime" to executionTime.time.toString(),
),
)
}

Expand All @@ -333,18 +333,18 @@ class CacheView(private val path: Path) : ToolPanel() {
title = "BasicHistoricalRecord",
message = "INSERT INTO $tablename",
body =
columns.map { column ->
buildString {
append(column.name).append(": ")
(0..dataCount).joinTo(buffer = this, prefix = "(", postfix = ")") { row ->
column.getValue(row).toString()
}
columns.map { column ->
buildString {
append(column.name).append(": ")
(0..dataCount).joinTo(buffer = this, prefix = "(", postfix = ")") { row ->
column.getValue(row).toString()
}
},
}
},
details =
mapOf(
"quoteColumnNames" to quoteColumnNames().toString(),
),
mapOf(
"quoteColumnNames" to quoteColumnNames().toString(),
),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,22 @@ class GenericView(connection: Connection) : ToolPanel("ins 0, fill, hidemode 3")
name = tableName,
_parent = { sortableTree.root },
columns =
connection
.executeQuery("""PRAGMA table_xinfo("$tableName");""")
.toList { resultSet ->
Column(
name = resultSet["name"],
type = resultSet["type"],
notNull = resultSet["notnull"],
defaultValue = resultSet["dflt_value"],
primaryKey = resultSet["pk"],
hidden = resultSet["hidden"],
_parent = { sortableTree.root.getChildAt(i) },
)
},
connection
.executeQuery("""PRAGMA table_xinfo("$tableName");""")
.toList { resultSet ->
Column(
name = resultSet["name"],
type = resultSet["type"],
notNull = resultSet["notnull"],
defaultValue = resultSet["dflt_value"],
primaryKey = resultSet["pk"],
hidden = resultSet["hidden"],
_parent = { sortableTree.root.getChildAt(i) },
)
},
size =
connection
.executeQuery("""SELECT SUM("pgsize") FROM "dbstat" WHERE name='$tableName'""")[1],
connection
.executeQuery("""SELECT SUM("pgsize") FROM "dbstat" WHERE name='$tableName'""")[1],
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import io.github.inductiveautomation.kindling.utils.jFrame
import io.github.inductiveautomation.kindling.utils.style
import io.github.inductiveautomation.kindling.utils.tag
import io.github.inductiveautomation.kindling.utils.toBodyLine
import net.miginfocom.swing.MigLayout
import org.jdesktop.swingx.JXTaskPane
import org.jdesktop.swingx.JXTaskPaneContainer
import java.awt.Color
import java.awt.Font
import java.awt.event.ItemEvent
Expand All @@ -42,9 +45,6 @@ import javax.swing.event.HyperlinkEvent
import kotlin.math.max
import kotlin.math.min
import kotlin.properties.Delegates
import net.miginfocom.swing.MigLayout
import org.jdesktop.swingx.JXTaskPane
import org.jdesktop.swingx.JXTaskPaneContainer

class ThreadComparisonPane(
totalThreadDumps: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package io.github.inductiveautomation.kindling.utils

import io.github.inductiveautomation.kindling.core.Kindling.Preferences.UI.Theme
import io.github.inductiveautomation.kindling.core.Theme.Companion.theme
import net.miginfocom.swing.MigLayout
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
import org.fife.ui.rtextarea.RTextScrollPane
import java.awt.Color
import java.awt.Font
import java.awt.event.ItemEvent
Expand All @@ -11,9 +14,6 @@ import javax.swing.JScrollPane
import javax.swing.JTextArea
import javax.swing.JToggleButton
import javax.swing.SwingUtilities
import net.miginfocom.swing.MigLayout
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
import org.fife.ui.rtextarea.RTextScrollPane

class DiffView<T>(
pre: List<T>,
Expand Down Expand Up @@ -201,7 +201,7 @@ class DiffView<T>(
}

private val additionDeletionLabel = JLabel(
"Showing ${diffData.additions.size} Additions and ${diffData.deletions.size} Deletions"
"Showing ${diffData.additions.size} Additions and ${diffData.deletions.size} Deletions",
).apply {
font = font.deriveFont(Font.BOLD, 14F)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package io.github.inductiveautomation.kindling.utils
import com.formdev.flatlaf.extras.FlatSVGIcon
import com.github.weisj.jsvg.SVGDocument
import com.github.weisj.jsvg.attributes.ViewBox
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.swing.Swing
import java.awt.Color
import java.awt.Component
import java.awt.Container
Expand All @@ -21,9 +24,6 @@ import javax.swing.SwingUtilities
import javax.swing.event.EventListenerList
import javax.swing.text.DefaultHighlighter
import javax.swing.text.Document
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.swing.Swing

/**
* A common CoroutineScope bound to the event dispatch thread (see [Dispatchers.Swing]).
Expand Down

0 comments on commit ed70f5d

Please sign in to comment.