summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-10-30 09:43:59 -0300
committerLauris BH <lauris@nix.lv>2019-10-30 14:43:59 +0200
commitf9944c0e6929f1c314d0a6e8d38a5592ba6eee2c (patch)
tree8381e4df7ee7c2c9a25cec990a103b978cd4c04b /modules/setting
parentac6accef092ea5a983a4a8ee35282246fc3c6fc5 (diff)
downloadgitea-f9944c0e6929f1c314d0a6e8d38a5592ba6eee2c.tar.gz
gitea-f9944c0e6929f1c314d0a6e8d38a5592ba6eee2c.zip
Configurable close and reopen keywords for PRs (#8120)
* Add settings for CloseKeywords and ReopenKeywords * Fix and improve tests * Use sync.Once() for initialization * Fix unintended exported function
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/repository.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index 19c68d003f..3e183b6c98 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -59,6 +59,8 @@ var (
// Pull request settings
PullRequest struct {
WorkInProgressPrefixes []string
+ CloseKeywords []string
+ ReopenKeywords []string
} `ini:"repository.pull-request"`
// Issue Setting
@@ -122,8 +124,14 @@ var (
// Pull request settings
PullRequest: struct {
WorkInProgressPrefixes []string
+ CloseKeywords []string
+ ReopenKeywords []string
}{
WorkInProgressPrefixes: []string{"WIP:", "[WIP]"},
+ // Same as GitHub. See
+ // https://help.github.com/articles/closing-issues-via-commit-messages
+ CloseKeywords: strings.Split("close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved", ","),
+ ReopenKeywords: strings.Split("reopen,reopens,reopened", ","),
},
// Issue settings