generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new `PrepushReviewAction` class to handle pre-push code review. This action is triggered when the user initiates a push operation. It retrieves the selected changes and performs a code review using the `doReviewWithChanges` method. The `doReviewWithChanges` method takes the project, commit details, selected changes, and associated stories as parameters and prompts the user for a commit message. If there are no commit details, the commit message prompt is skipped. The changes are then displayed, and the user is prompted to review the code. The code review is performed using the `doCodeReview` method, which renders a code review template and displays it to the user.
- Loading branch information
Showing
4 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/cc/unitmesh/devti/actions/vcs/PrepushReviewAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cc.unitmesh.devti.actions.vcs | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.vcs.VcsDataKeys | ||
|
||
class PrepushReviewAction : CodeReviewAction() { | ||
override fun actionPerformed(event: AnActionEvent) { | ||
val project = event.project ?: return | ||
|
||
val selectList = event.getData(VcsDataKeys.CHANGES) ?: return | ||
|
||
doReviewWithChanges(project, listOf(), selectList, listOf()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters