Skip to content

Commit fbc7284

Browse files
authored
Bump detekt to 1.23.5 (#4105)
1 parent 3bd5d23 commit fbc7284

File tree

12 files changed

+236
-208
lines changed

12 files changed

+236
-208
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ assertJ = "3.20.2" # Upgrading leads to SAM errors: https://youtrack.jetbrains.c
44
# match with <root>/settings.gradle.kts
55
awsSdk = "2.20.111"
66
commonmark = "0.17.1"
7-
detekt = "1.23.0"
7+
detekt = "1.23.5"
88
intellijGradle = "1.13.2"
99
intellijRemoteRobot = "0.11.21"
1010
jackson = "2.15.1"

jetbrains-core/src/software/aws/toolkits/jetbrains/core/gettingstarted/editor/GettingStartedTelemetryUtils.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ fun getEnabledConnectionsForTelemetry(project: Project): Set<AuthFormId> {
2020
if (explorerConnection !is ActiveConnection.NotConnected) {
2121
if (explorerConnection.connectionType == ActiveConnectionType.IAM_IDC) {
2222
enabledConnections.add(AuthFormId.IDENTITYCENTER_EXPLORER)
23-
} else enabledConnections.add(
24-
AuthFormId.IAMCREDENTIALS_EXPLORER
25-
)
23+
} else {
24+
enabledConnections.add(
25+
AuthFormId.IAMCREDENTIALS_EXPLORER
26+
)
27+
}
2628
}
2729
val codeCatalystConnection = checkBearerConnectionValidity(project, BearerTokenFeatureSet.CODECATALYST) // Currently this will always be builder id
2830
if (codeCatalystConnection !is ActiveConnection.NotConnected) enabledConnections.add(AuthFormId.BUILDERID_CODECATALYST)
@@ -31,9 +33,11 @@ fun getEnabledConnectionsForTelemetry(project: Project): Set<AuthFormId> {
3133
if (codeWhispererConnection !is ActiveConnection.NotConnected) {
3234
if (codeWhispererConnection.connectionType == ActiveConnectionType.IAM_IDC) {
3335
enabledConnections.add(AuthFormId.IDENTITYCENTER_CODEWHISPERER)
34-
} else enabledConnections.add(
35-
AuthFormId.BUILDERID_CODEWHISPERER
36-
)
36+
} else {
37+
enabledConnections.add(
38+
AuthFormId.BUILDERID_CODEWHISPERER
39+
)
40+
}
3741
}
3842
return enabledConnections
3943
}

jetbrains-core/src/software/aws/toolkits/jetbrains/services/codemodernizer/panels/managers/BuildProgressSplitterPanelManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ class BuildProgressSplitterPanelManager(private val project: Project) :
185185
currentState.removeAll { it.id == ProgressStepId.PLAN_STEP }
186186
if (transformationPlanStepsMayAdded.isNullOrEmpty()) {
187187
currentState
188-
} else currentState + transformationPlanStepsMayAdded
188+
} else {
189+
currentState + transformationPlanStepsMayAdded
190+
}
189191
} else {
190192
currentState
191193
}

jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/codescan/listeners/CodeWhispererCodeScanEditorMouseMotionListener.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ class CodeWhispererCodeScanEditorMouseMotionListener(private val project: Projec
115115
|${issue.suggestedFixes[0].code}
116116
|```
117117
|
118-
|${if (isFixDescriptionAvailable) "|### ${message("codewhisperer.codescan.suggested_fix_description")}\n${issue.suggestedFixes[0].description}" else ""}
118+
|${if (isFixDescriptionAvailable) {
119+
"|### ${message(
120+
"codewhisperer.codescan.suggested_fix_description"
121+
)}\n${issue.suggestedFixes[0].description}"
122+
} else {
123+
""
124+
}}
119125
""".trimMargin()
120126
} else {
121127
""

jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/telemetry/CodeWhispererTelemetryService.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ class CodeWhispererTelemetryService {
446446

447447
return if (isEmpty) {
448448
CodewhispererPreviousSuggestionState.Empty
449-
} else CodewhispererPreviousSuggestionState.Discard
449+
} else {
450+
CodewhispererPreviousSuggestionState.Discard
451+
}
450452
}
451453

452454
fun sendPerceivedLatencyEvent(

jetbrains-core/src/software/aws/toolkits/jetbrains/settings/DynamicResourcesConfigurable.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ class DynamicResourcesConfigurable : BoundConfigurable(message("aws.settings.dyn
112112
}
113113

114114
private fun CheckBoxList<*>.toggleAll(state: Boolean) {
115-
(0 until model.size).forEach { idx ->
115+
for (idx in 0..model.size - 1) {
116116
checkboxStateHandler(idx, state)
117117
}
118+
118119
updateCheckboxList()
119120
}
120121

jetbrains-core/tst/software/aws/toolkits/jetbrains/core/tools/ToolManagerTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,11 @@ class ToolManagerTest {
440440
}
441441

442442
val type = createManagedToolMock(toolId) {
443-
on { determineLatestVersion() } doAnswer Answer<Version> { latch.countDown(); postCheckLatch.await(); version }
443+
on { determineLatestVersion() } doAnswer Answer<Version> {
444+
latch.countDown()
445+
postCheckLatch.await()
446+
version
447+
}
444448
on { toTool(eq(installPath)) } doReturn Tool(this.mock, toolBinary)
445449
}
446450

jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/importadder/CodeWhispererJavaImportAdderTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ class CodeWhispererJavaImportAdderTest : CodeWhispererImportAdderTestBase(
132132
}
133133

134134
override fun assertSameImport(import1: PsiElement, import2: PsiElement) {
135-
import1 as PsiImportStatementBase; import2 as PsiImportStatementBase
135+
import1 as PsiImportStatementBase
136+
import2 as PsiImportStatementBase
136137
assertThat(import1.text).isEqualTo(import1.text)
137138
}
138139
}

jetbrains-core/tst/software/aws/toolkits/jetbrains/services/codewhisperer/importadder/CodeWhispererPythonImportAdderTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,14 @@ class CodeWhispererPythonImportAdderTest : CodeWhispererImportAdderTestBase(
308308
}
309309

310310
override fun assertSameImport(import1: PsiElement, import2: PsiElement) {
311-
import1 as PyImportStatementBase; import2 as PyImportStatementBase
311+
import1 as PyImportStatementBase
312+
import2 as PyImportStatementBase
312313
assertThat(import1::class.java).isEqualTo(import2::class.java)
313314
if (import1 is PyImportStatement) {
314315
import2 as PyImportStatement
315316
} else {
316-
import1 as PyFromImportStatement; import2 as PyFromImportStatement
317+
import1 as PyFromImportStatement
318+
import2 as PyFromImportStatement
317319
assertThat(import1.importSourceQName.toString()).isEqualTo(import2.importSourceQName.toString())
318320
}
319321
assertThat(import1.fullyQualifiedObjectNames.toString()).isEqualTo(import2.fullyQualifiedObjectNames.toString())

jetbrains-core/tst/software/aws/toolkits/jetbrains/utils/ui/UiUtilsTest.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class UiUtilsTest {
2525
component.addQuickSelect(checkbox, runnable)
2626

2727
val click = MouseEvent(component, MouseEvent.BUTTON1, 0, 0, 100, 100, 1, false)
28-
component.mouseListeners.forEach { it.mousePressed(click); it.mouseReleased(click) }
28+
component.mouseListeners.forEach {
29+
it.mousePressed(click)
30+
it.mouseReleased(click)
31+
}
2932
assertThat(checkbox.isSelected).isTrue()
3033
verify(runnable).run()
3134
}

0 commit comments

Comments
 (0)