Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
Better WIP detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Stig Lindqvist committed Oct 10, 2017
1 parent 47f799d commit 581494b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ type PullRequest struct {

func (p *PullRequest) isWIP() bool {
// Check for WIP in the title
if strings.Contains(p.Title, "[WIP]") || strings.Contains(p.Title, "WIP:") {
if strings.Index(p.Title, "[WIP]") == 0 {
return true
}

if strings.Index(p.Title, "WIP") == 0 {
return true
}

Expand Down Expand Up @@ -54,7 +58,7 @@ func (p *PullRequest) String() string {
title = strings.Replace(title, "<", "&lt;", -1)
title = strings.Replace(title, ">", "&gt;", -1)

output := fmt.Sprintf(" • <%s|PR #%d> %s - _%s_", p.WebLink, p.ID, title, p.Author)
output := fmt.Sprintf(" • <%s|PR #%d> %s - _%s_", p.WebLink, p.ID, title, p.Author)

if p.HasApprovedReview {
output += ", *APPROVED*"
Expand Down

0 comments on commit 581494b

Please sign in to comment.