Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Commit

Permalink
Use env var to overload default selfApprovalOff
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Kernec'h committed May 16, 2016
1 parent b0531cf commit 629ebcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions model/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
approvals = envflag.Int("LGTM_APPROVALS", 2, "")
pattern = envflag.String("LGTM_PATTERN", "(?i)LGTM", "")
team = envflag.String("LGTM_TEAM", "MAINTAINERS", "")
selfApprovalOff = envflag.Bool("LGTM_SELF_APPROVAL_OFF", false, "")
)

// ParseConfig parses a projects .lgtm file
Expand All @@ -43,6 +44,9 @@ func ParseConfigStr(data string) (*Config, error) {
if len(c.Team) == 0 {
c.Team = *team
}
if c.SelfApprovalOff == false {
c.SelfApprovalOff = *selfApprovalOff
}

c.re, err = regexp.Compile(c.Pattern)
return c, err
Expand Down

0 comments on commit 629ebcc

Please sign in to comment.