alecthomas / gometalinter

DEPRECATED: Use https://github.com/golangci/golangci-lint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass an exclude to a linter package?

febbraro opened this issue · comments

The gosec package is flagging an error that I don't care to evaluate across my entire codebase.

gosec has a way to pass an exclude for a particular rule

# Run everything except for rule G303
$ gosec -exclude=G303 ./...

Is there a way to pass something like that down to the gosec package?

Yes, you can customize the command that is run from the config:

{
  "Linters": {
    "gosec": {"Command": "gosec -exclude=G303"}
  }
}

https://github.com/alecthomas/gometalinter#adding-custom-linters

@dnephin Thanks so much for that pointer. Works like a charm!