Skip to content

Commit 50fd498

Browse files
committed
Other corrections
1 parent c1b5a68 commit 50fd498

File tree

9 files changed

+21
-33
lines changed

9 files changed

+21
-33
lines changed

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/channels/GTestLogChannelImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GTestLogChannelImpl(project: Project): LogChannelImpl(project) {
1414
override val name: String = "GTest Log"
1515
override val logLevel: String = "TestLogLevel"
1616

17-
override val console: UTBotConsole = project.service<OutputProvider>().gtestOutputChannel.outputConsole
17+
override val console: UTBotConsole = project.service<OutputProvider>().gTestOutputChannel.outputConsole
1818

1919
override suspend fun open(stub: TestsGenServiceGrpcKt.TestsGenServiceCoroutineStub): Flow<Testgen.LogEntry> =
2020
stub.openGTestChannel(getLogChannelGrpcRequest(logLevel))

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/coverage/UTBotCoverageFileProvider.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ import com.intellij.coverage.CoverageFileProvider
88
* don't need this class but for compatibility with api this class must be implemented.
99
*/
1010
class UTBotCoverageFileProvider : CoverageFileProvider {
11-
override fun getCoverageDataFilePath(): String? {
12-
return null
13-
}
11+
override fun getCoverageDataFilePath(): String? = null
1412

15-
override fun ensureFileExists(): Boolean {
16-
return true
17-
}
13+
override fun ensureFileExists(): Boolean = true
1814

19-
override fun isValid(): Boolean {
20-
return true
21-
}
15+
override fun isValid(): Boolean = true
2216
}

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/coverage/UTBotCoverageRunner.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,14 @@ class UTBotCoverageRunner : CoverageRunner() {
7070
return if (isAnyCoverage) projectData else null
7171
}
7272

73-
override fun getPresentableName(): String {
74-
return "UTBot: Coverage runner"
75-
}
73+
override fun getPresentableName(): String = "UTBot: Coverage runner"
7674

77-
override fun getId(): String {
78-
return "UTBotCoverageRunner"
79-
}
75+
override fun getId(): String = "UTBotCoverageRunner"
8076

8177
// actually no coverage file exists, but this method must be implemented, see UTBotCoverageFileProvider
82-
override fun getDataFileExtension(): String {
83-
return "txt"
84-
}
78+
override fun getDataFileExtension(): String = "txt"
8579

86-
override fun acceptsCoverageEngine(engine: CoverageEngine): Boolean {
87-
return engine is UTBotCoverageEngine
88-
}
80+
override fun acceptsCoverageEngine(engine: CoverageEngine): Boolean = engine is UTBotCoverageEngine
8981

9082
companion object {
9183
fun provideQualifiedNameForFile(absolutePath: String) = absolutePath

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/listeners/UTBotTestResultsReceivedListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import testsgen.Testgen
66
fun interface UTBotTestResultsReceivedListener {
77
companion object {
88
val TOPIC = Topic.create(
9-
"UTBot settings changed",
9+
"UTBot test results received",
1010
UTBotTestResultsReceivedListener::class.java
1111
)
1212
}

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/settings/UTBotAllProjectSettings.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UTBotAllProjectSettings(val project: Project) {
2121

2222
var projectPath: String
2323
get() = storedSettings.projectPath ?: project.guessProjectDir()?.path
24-
?: error("Could not guess project path! Should be specified in settings by user")
24+
?: error("Could not guess project path! Should be specified manually in settings")
2525
set(value) {
2626
storedSettings.projectPath = value
2727
}
@@ -43,7 +43,7 @@ class UTBotAllProjectSettings(val project: Project) {
4343

4444
/**
4545
* If this property returns true, plugin must convert path sent and returned from server.
46-
* @see [String.convertToRemotePathIfNeeded], [String.convertFromRemotePathIfNeeded]
46+
* @see [String.convertToRemotePathIfNeeded] and [String.convertFromRemotePathIfNeeded]
4747
*
4848
* If we are on Windows, this is not a server, so it is always a remote scenario.
4949
*/
@@ -67,7 +67,7 @@ class UTBotAllProjectSettings(val project: Project) {
6767
try {
6868
storedSettings.testDirPath = Paths.get(projectPath, "tests").toString()
6969
} catch (e: IllegalStateException) {
70-
notifyWarning("Guessing settings failed: could not guess project path! Please specify project path in settings!")
70+
notifyWarning("Guessing settings failed: could not guess project path! Please specify it in settings!")
7171
}
7272

7373
val cmakeRunConfiguration = CMakeAppRunConfiguration.getSelectedConfigurationAndTarget(project)?.first

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/settings/UTBotConfigurable.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("UnstableApiUsage")
2+
13
package org.utbot.cpp.clion.plugin.settings
24

35
import com.intellij.openapi.diagnostic.Logger
@@ -22,7 +24,7 @@ import org.utbot.cpp.clion.plugin.utils.commandLineEditor
2224
import java.awt.Dimension
2325

2426
class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
25-
"Project Settings for Generating Tests"
27+
"Project Settings to generate tests"
2628
) {
2729
private val logger = Logger.getInstance("ProjectConfigurable")
2830
private val panel by lazy { createMainPanel() }
@@ -49,7 +51,7 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
4951
}
5052
}
5153

52-
fun createMainPanel(): DialogPanel {
54+
private fun createMainPanel(): DialogPanel {
5355
logger.trace("createPanel was called")
5456
return panel {
5557
group("Connection Settings") {
@@ -73,7 +75,7 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
7375
myProject,
7476
FileChooserDescriptorFactory.createSingleFileDescriptor()
7577
).bindText(
76-
getter = { myProject.settings.projectPath ?: "" },
78+
getter = { myProject.settings.projectPath },
7779
setter = { value -> myProject.settings.projectPath = value })
7880
.columns(COLUMNS_LARGE)
7981
}.rowComment(UTBot.message("settings.project.projectPath.info"))
@@ -110,7 +112,7 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
110112
myProject.settings.predictPaths()
111113
myProject.settings.fireUTBotSettingsChanged()
112114
}
113-
}.rowComment("Queries CMake configurations in order to get source paths, build path. Also predicts tests folder")
115+
}.rowComment("Queries CMake configurations to get source paths and build path. Also predicts tests folder")
114116
}
115117

116118
group("CMake") {

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/services/OutputProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import javax.swing.JPanel
2121
@Service
2222
class OutputProvider(val project: Project) : Disposable {
2323
val clientOutputChannel: OutputChannel by lazy { createOutputChannel(OutputType.CLIENT_LOG) }
24-
val gtestOutputChannel: OutputChannel by lazy { createOutputChannel(OutputType.GTEST_LOG) }
24+
val gTestOutputChannel: OutputChannel by lazy { createOutputChannel(OutputType.GTEST_LOG) }
2525
val serverOutputChannel: OutputChannel by lazy { createOutputChannel(OutputType.SERVER_LOG) }
2626

2727
data class OutputChannel(val uiComponent: Component, val outputConsole: UTBotConsole, val type: OutputType)

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/targetsToolWindow/UTBotTarget.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data class UTBotTarget(val path: String, val name: String, val description: Stri
1919
val autoTarget = UTBotTarget(
2020
path = "/utbot/auto/target/path",
2121
name = "UTBot: auto",
22-
description = "Finds any target that contains the code under testing"
22+
description = "Finds any target that contains the code under test"
2323
)
2424
}
2525
}

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/userLog/ConsoleToolWindow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ConsoleToolWindow(val project: Project) : SimpleToolWindowPanel(true, true
2929
val provider = project.service<OutputProvider>()
3030
for (channel in listOf(
3131
provider.clientOutputChannel,
32-
provider.gtestOutputChannel,
32+
provider.gTestOutputChannel,
3333
provider.serverOutputChannel
3434
)) {
3535
mainUI.addTab(channel.type.title, channel.uiComponent)

0 commit comments

Comments
 (0)