Update gometalinter, and disable gas (#371)

* Update gometalinter

* Disable gas linter

According to the gas github page:

> Gas is still in alpha and accepting feedback from early adopters. We do not
> consider it production ready at this time.

Generally it seems to shout about a lot of things which aren't very errory,
like executing subprocesses with anything other than a hardcoded commandline,
and creating directories with anything other than 700 perms.
This commit is contained in:
Richard van der Hoff 2017-12-08 19:13:17 +00:00 committed by Erik Johnston
parent 16f593f786
commit c3cb6f8767
67 changed files with 2865 additions and 901 deletions

View file

@ -5,6 +5,7 @@ import (
"go/ast"
"go/parser"
"go/token"
"os"
"sort"
"strings"
"sync"
@ -67,11 +68,12 @@ func newDirectiveParser() *directiveParser {
// IsIgnored returns true if the given linter issue is ignored by a linter directive.
func (d *directiveParser) IsIgnored(issue *Issue) bool {
d.lock.Lock()
ranges, ok := d.files[issue.Path]
path := issue.Path.Relative()
ranges, ok := d.files[path]
if !ok {
ranges = d.parseFile(issue.Path)
ranges = d.parseFile(path)
sort.Sort(ranges)
d.files[issue.Path] = ranges
d.files[path] = ranges
}
d.lock.Unlock()
for _, r := range ranges {
@ -204,10 +206,16 @@ func filterIssuesViaDirectives(directives *directiveParser, issues chan *Issue)
func warnOnUnusedDirective(directives *directiveParser) []*Issue {
out := []*Issue{}
cwd, err := os.Getwd()
if err != nil {
warning("failed to get working directory %s", err)
}
for path, ranges := range directives.Unmatched() {
for _, ignore := range ranges {
issue, _ := NewIssue("nolint", config.formatTemplate)
issue.Path = path
issue.Path = newIssuePath(cwd, path)
issue.Line = ignore.start
issue.Col = ignore.col
issue.Message = "nolint directive did not match any issue"