зеркало из https://github.com/golang/build.git
cmd/gopherbot: rename a function to be more descriptive
labelChangeDisallowed is closer to what this function is meant for. Change-Id: I64b143263df2d3dca018f9daecd73c2be59e84c9 Reviewed-on: https://go-review.googlesource.com/c/build/+/260417 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Родитель
4e08f9c626
Коммит
d1ab7ac8e2
|
@ -1802,22 +1802,22 @@ func mutationsFromCommands(cmds []labelCommand) (add, remove []string) {
|
|||
}
|
||||
|
||||
for l := range toAdd {
|
||||
if toAdd[l] && !labelChangeBlacklisted(l, "add") {
|
||||
if toAdd[l] && !labelChangeDisallowed(l, "add") {
|
||||
add = append(add, l)
|
||||
}
|
||||
}
|
||||
|
||||
for l := range toRemove {
|
||||
if toRemove[l] && !labelChangeBlacklisted(l, "remove") {
|
||||
if toRemove[l] && !labelChangeDisallowed(l, "remove") {
|
||||
remove = append(remove, l)
|
||||
}
|
||||
}
|
||||
return add, remove
|
||||
}
|
||||
|
||||
// labelChangeBlacklisted returns true if an action on the given label is
|
||||
// labelChangeDisallowed reports whether an action on the given label is
|
||||
// forbidden via gopherbot.
|
||||
func labelChangeBlacklisted(label, action string) bool {
|
||||
func labelChangeDisallowed(label, action string) bool {
|
||||
if action == "remove" && label == "Security" {
|
||||
return true
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче