Skip to content

Commit

Permalink
Simplify func names (srvaroa#63)
Browse files Browse the repository at this point in the history
Signed-off-by: Galo Navarro <[email protected]>
  • Loading branch information
srvaroa authored Feb 19, 2023
1 parent 97a5647 commit 0194603
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/condition_author.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
)

func NewAuthorCondition() Condition {
func AuthorCondition() Condition {
return Condition{
GetName: func() string {
return "Author matches"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_basebranch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
)

func NewBaseBranchCondition() Condition {
func BaseBranchCondition() Condition {
return Condition{
GetName: func() string {
return "Base branch matches regex"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
)

func NewBodyCondition() Condition {
func BodyCondition() Condition {
return Condition{
GetName: func() string {
return "Body matches regex"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
)

func NewBranchCondition() Condition {
func BranchCondition() Condition {
return Condition{
GetName: func() string {
return "Branch matches regex"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/waigani/diffparser"
)

func NewFilesCondition(l *Labeler) Condition {
func FilesCondition(l *Labeler) Condition {
prFiles := []string{}

return Condition{
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_isdraft.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
)

func NewIsDraftCondition() Condition {
func IsDraftCondition() Condition {
return Condition{
GetName: func() string {
return "Pull Request is draft"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_ismergeable.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
)

func NewIsMergeableCondition() Condition {
func IsMergeableCondition() Condition {
return Condition{
GetName: func() string {
return "Pull Request is mergeable"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_size.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
)

func NewSizeCondition() Condition {
func SizeCondition() Condition {
return Condition{
GetName: func() string {
return "Pull Request contains a number of changes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/condition_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
)

func NewTitleCondition() Condition {
func TitleCondition() Condition {
return Condition{
GetName: func() string {
return "Title matches regex"
Expand Down
18 changes: 9 additions & 9 deletions pkg/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ func (l *Labeler) findMatches(target *Target, config *LabelerConfigV1) (LabelUpd
set: map[string]bool{},
}
conditions := []Condition{
NewTitleCondition(),
NewBranchCondition(),
NewBaseBranchCondition(),
NewIsMergeableCondition(),
NewIsDraftCondition(),
NewSizeCondition(),
NewBodyCondition(),
NewFilesCondition(l),
NewAuthorCondition(),
TitleCondition(),
BranchCondition(),
BaseBranchCondition(),
IsMergeableCondition(),
IsDraftCondition(),
SizeCondition(),
BodyCondition(),
FilesCondition(l),
AuthorCondition(),
}

for _, matcher := range config.Labels {
Expand Down

0 comments on commit 0194603

Please sign in to comment.