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

Commit

Permalink
re-order rcfile parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Apr 19, 2016
1 parent 9cc16ed commit 66ef421
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions web/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ func Hook(c *gin.Context) {
return
}

rcfile, _ := remote.GetContents(c, user, repo, ".lgtm")
config, err := model.ParseConfig(rcfile)
if err != nil {
log.Errorf("Error parsing .lgtm file for %s. %s", repo.Slug, err)
c.String(500, "Error parsing .lgtm file. %s.", err)
return
}

// THIS IS COMPLETELY DUPLICATED IN THE API SECTION. NOT IDEAL
file, err := remote.GetContents(c, user, repo, "MAINTAINERS")
if err != nil {
Expand All @@ -62,14 +70,6 @@ func Hook(c *gin.Context) {
return
}

rcfile, _ := remote.GetContents(c, user, repo, ".lgtm")
config, err := model.ParseConfig(rcfile)
if err != nil {
log.Errorf("Error parsing .lgtm file for %s. %s", repo.Slug, err)
c.String(500, "Error parsing .lgtm file. %s.", err)
return
}

comments, err := remote.GetComments(c, user, repo, hook.Issue.Number)
if err != nil {
log.Errorf("Error retrieving comments for %s pr %d. %s", repo.Slug, hook.Issue.Number, err)
Expand Down

0 comments on commit 66ef421

Please sign in to comment.