From f38384ddea3ff14a261f5178f34500c78c444704 Mon Sep 17 00:00:00 2001 From: Dima Golovinov Date: Thu, 18 Apr 2024 12:36:05 +0200 Subject: [PATCH 1/2] Update qodana linter version --- qodana.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qodana.yaml b/qodana.yaml index e6a7bb4..9980ffb 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,5 +1,5 @@ version: "1.0" -linter: jetbrains/qodana-jvm:2023.2 +linter: jetbrains/qodana-jvm:2024.1 projectJDK: "1.8" profile: name: qodana.recommended @@ -8,6 +8,4 @@ include: exclude: - name: All paths: - - sarif/src/test/resources/ -dependencyIgnores: - - name: "colormath-jvm" \ No newline at end of file + - sarif/src/test/resources/ \ No newline at end of file From 06db962d82fa05423fcffc11b820fba6d36ce26e Mon Sep 17 00:00:00 2001 From: Dima Golovinov Date: Thu, 18 Apr 2024 13:20:21 +0200 Subject: [PATCH 2/2] Apply suggested fix by the linter --- .../src/main/kotlin/CommandLineTable.kt | 20 ++++++++----------- qodana.yaml | 4 +++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/baseline-cli/src/main/kotlin/CommandLineTable.kt b/baseline-cli/src/main/kotlin/CommandLineTable.kt index 9143b6a..e47dd12 100644 --- a/baseline-cli/src/main/kotlin/CommandLineTable.kt +++ b/baseline-cli/src/main/kotlin/CommandLineTable.kt @@ -5,19 +5,15 @@ class CommandLineTable(private val header: List, private val rows: List< const val DEFAULT_COLUMN_SIZE = 50 } - private val columnSize: List - - init { - this.columnSize = columnSize.mapIndexed { ind, size -> - if (size != 0 || rows.isEmpty()) { - return@mapIndexed size - } - - max( - rows.maxOfOrNull { if (ind < it.size) it[ind].length else 0 } ?: DEFAULT_COLUMN_SIZE, - if (ind < header.size) header[ind].length else DEFAULT_COLUMN_SIZE - ) + private val columnSize: List = columnSize.mapIndexed { ind, size -> + if (size != 0 || rows.isEmpty()) { + return@mapIndexed size } + + max( + rows.maxOfOrNull { if (ind < it.size) it[ind].length else 0 } ?: DEFAULT_COLUMN_SIZE, + if (ind < header.size) header[ind].length else DEFAULT_COLUMN_SIZE + ) } fun buildTable(): String { diff --git a/qodana.yaml b/qodana.yaml index 9980ffb..2925eb4 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -5,7 +5,9 @@ profile: name: qodana.recommended include: - name: CheckDependencyLicenses +raiseLicenseProblems: true +enablePackageSearch: true exclude: - name: All paths: - - sarif/src/test/resources/ \ No newline at end of file + - sarif/src/test/resources/