Skip to content

Commit 52871f3

Browse files
committed
tidy up
1 parent 6ec9398 commit 52871f3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

resources/META-INF/plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<postStartupActivity implementation="limitedwip.autorevert.components.AutoRevertComponentStartup"/>
5454
<postStartupActivity implementation="limitedwip.tcr.components.TcrComponentStartup"/>
5555

56-
<projectConfigurable instance="limitedwip.common.settings.LimitedWipConfigurable"/>
56+
<projectConfigurable instance="limitedwip.common.settings.LimitedWipConfigurable" displayName="Limited WIP"/>
5757
<projectService serviceImplementation="limitedwip.common.settings.LimitedWipSettings"/>
5858
<checkinHandlerFactory implementation="limitedwip.common.vcs.SuccessfulCheckin"/>
5959
<checkinHandlerFactory implementation="limitedwip.common.vcs.AllowCommit"/>

src/limitedwip/common/settings/LimitedWipConfigurable.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ class LimitedWipConfigurable(val project: Project): SearchableConfigurable {
1818
settingsForm.applyChanges()
1919
}
2020

21-
override fun reset() {
22-
settingsForm.resetChanges()
23-
}
21+
override fun reset() = settingsForm.resetChanges()
2422

2523
override fun isModified() = settingsForm.isModified()
2624

2725
override fun getDisplayName() = pluginDisplayName
2826

29-
override fun getId(): String = pluginId
27+
override fun getId() = pluginId
3028
}

src/limitedwip/common/vcs/SuccessfulCheckin.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ import com.intellij.openapi.vcs.checkin.CheckinHandler
88
import com.intellij.openapi.vcs.checkin.CheckinHandlerFactory
99
import limitedwip.common.pluginId
1010

11-
class SuccessfulCheckin: CheckinHandlerFactory() {
11+
class SuccessfulCheckin : CheckinHandlerFactory() {
1212

13-
override fun createHandler(panel: CheckinProjectPanel, commitContext: CommitContext): CheckinHandler {
14-
return object: CheckinHandler() {
13+
override fun createHandler(panel: CheckinProjectPanel, commitContext: CommitContext) =
14+
object : CheckinHandler() {
1515
override fun checkinSuccessful() {
1616
val changeList = panel.project.defaultChangeList() ?: return
1717
val uncommittedFileCount = changeList.changes.size - panel.selectedChanges.size
1818
notifySettingsListeners(allChangesAreCommitted = uncommittedFileCount == 0)
1919
}
2020
}
21-
}
2221

2322
private fun notifySettingsListeners(allChangesAreCommitted: Boolean) {
2423
Extensions.getRootArea().getExtensionPoint<Listener>(extensionPointName).extensions.forEach { listener ->

0 commit comments

Comments
 (0)