Skip to content

Commit ca2c128

Browse files
committed
fix format error
1 parent 9cf1786 commit ca2c128

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,20 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
9393
}
9494
val final = session.testGenerationJobGroupName
9595

96-
if(session.iteration == 1){
96+
if (session.iteration == 1) {
9797
codeTestChatHelper.updateUI(
9898
promptInputDisabledState = true,
9999
promptInputProgress = testGenProgressField(0),
100100
)
101-
}else{
101+
} else {
102102
codeTestChatHelper.updateUI(
103103
promptInputDisabledState = true,
104104
promptInputProgress = buildAndExecuteProgrogressField,
105-
)
105+
)
106106
}
107107

108108
// Set the Progress bar to "Generating unit tests..."
109109

110-
111110
val codeTestResponseContext = createUploadUrl(codeTestChatHelper, previousIterationContext)
112111
session.srcPayloadSize = codeTestResponseContext.payloadContext.srcPayloadSize
113112
session.srcZipFileSize = codeTestResponseContext.payloadContext.srcZipFileSize
@@ -272,12 +271,12 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
272271
messageIdOverride = codeTestResponseContext.testSummaryMessageId
273272
)
274273
}
275-
if(session.iteration == 1){
274+
if (session.iteration == 1) {
276275
codeTestChatHelper.updateUI(
277276
promptInputDisabledState = true,
278277
promptInputProgress = testGenProgressField(0),
279278
)
280-
}else{
279+
} else {
281280
codeTestChatHelper.updateUI(
282281
promptInputDisabledState = true,
283282
promptInputProgress = buildAndExecuteProgrogressField,
@@ -589,7 +588,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
589588
canBeVoted = false
590589
)
591590
)
592-
if(session.iteration == 1){
591+
if (session.iteration == 1) {
593592
AmazonqTelemetry.utgGenerateTests(
594593
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
595594
hasUserPromptSupplied = session.hasUserPromptSupplied,
@@ -608,8 +607,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
608607
buildZipFileBytes = session.srcZipFileSize,
609608
requestId = session.startTestGenerationRequestId
610609
)
611-
612-
}else{
610+
} else {
613611
AmazonqTelemetry.unitTestGeneration(
614612
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
615613
hasUserPromptSupplied = session.hasUserPromptSupplied,
@@ -628,7 +626,6 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
628626
)
629627
}
630628

631-
632629
session.isGeneratingTests = false
633630
} finally {
634631
// Reset the flow if there is any error

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ class CodeTestChatController(
667667

668668
UiTelemetry.click(null as Project?, "unitTestGeneration_acceptDiff")
669669

670-
if(session.iteration == 1){
670+
if (session.iteration == 1) {
671671
AmazonqTelemetry.utgGenerateTests(
672672
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
673673
hasUserPromptSupplied = session.hasUserPromptSupplied,
@@ -690,7 +690,7 @@ class CodeTestChatController(
690690
buildZipFileBytes = session.srcZipFileSize,
691691
requestId = session.startTestGenerationRequestId
692692
)
693-
}else{
693+
} else {
694694
AmazonqTelemetry.unitTestGeneration(
695695
count = session.iteration.toLong() - 1,
696696
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
@@ -705,10 +705,10 @@ class CodeTestChatController(
705705
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
706706
acceptedCharactersCount = session.charsOfCodeGenerated?.toLong(),
707707
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
708-
result = if(buildResult){
709-
MetricResult.Succeeded
710-
}else{
711-
MetricResult.Failed
708+
result = if (buildResult) {
709+
MetricResult.Succeeded
710+
} else {
711+
MetricResult.Failed
712712
},
713713
perfClientLatency = session.latencyOfTestGeneration,
714714
isCodeBlockSelected = session.isCodeBlockSelected,
@@ -719,7 +719,6 @@ class CodeTestChatController(
719719
)
720720
}
721721

722-
723722
codeTestChatHelper.addAnswer(
724723
CodeTestChatMessageContent(
725724
message = message("testgen.message.success"),
@@ -894,7 +893,7 @@ class CodeTestChatController(
894893
}
895894

896895
UiTelemetry.click(null as Project?, "unitTestGeneration_rejectDiff")
897-
if(session.iteration == 1){
896+
if (session.iteration == 1) {
898897
AmazonqTelemetry.utgGenerateTests(
899898
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
900899
hasUserPromptSupplied = session.hasUserPromptSupplied,
@@ -917,7 +916,7 @@ class CodeTestChatController(
917916
buildZipFileBytes = session.srcZipFileSize,
918917
requestId = session.startTestGenerationRequestId
919918
)
920-
}else{
919+
} else {
921920
AmazonqTelemetry.unitTestGeneration(
922921
count = session.iteration.toLong() - 1,
923922
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
@@ -932,9 +931,9 @@ class CodeTestChatController(
932931
generatedLinesCount = session.linesOfCodeGenerated?.toLong(),
933932
acceptedCharactersCount = 0,
934933
generatedCharactersCount = session.charsOfCodeGenerated?.toLong(),
935-
result = if(buildResult){
934+
result = if (buildResult) {
936935
MetricResult.Succeeded
937-
}else{
936+
} else {
938937
MetricResult.Failed
939938
},
940939
perfClientLatency = session.latencyOfTestGeneration,
@@ -983,7 +982,14 @@ class CodeTestChatController(
983982
"tmpFile for build logs:\n ${buildLogsFile.path}"
984983
}
985984

986-
runBuildOrTestCommand(taskContext.buildCommand, buildLogsFile, context.project, isBuildCommand = true, taskContext, session.testFileRelativePathToProjectRoot)
985+
runBuildOrTestCommand(
986+
taskContext.buildCommand,
987+
buildLogsFile,
988+
context.project,
989+
isBuildCommand = true,
990+
taskContext,
991+
session.testFileRelativePathToProjectRoot
992+
)
987993
while (taskContext.buildExitCode < 0) {
988994
// wait until build command finished
989995
delay(1000)

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/session/Session.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data class Session(val tabId: String) {
3333
var srcPayloadSize: Long = 0
3434
var srcZipFileSize: Long = 0
3535
var artifactUploadDuration: Long = 0
36-
var updateBuildCommands : Boolean = false
36+
var updateBuildCommands: Boolean = false
3737

3838
// First iteration will have a value of 1
3939
var userPrompt: String = ""

0 commit comments

Comments
 (0)