From 66ef421232303b73c2f6979c66a66f5a500b7b90 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 19 Apr 2016 08:25:43 -0700 Subject: [PATCH] re-order rcfile parsing --- web/hook.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/hook.go b/web/hook.go index 14ad9d0..1378415 100644 --- a/web/hook.go +++ b/web/hook.go @@ -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 { @@ -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)