palantir / godel

Go tool for formatting, checking, building, distributing and publishing projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

check filter docs incorrect

gdearment opened this issue · comments

commented

As far as I can tell, the docs on how to add filters for golint are wrong. My check-plugin.yml:

checks:
  novendor:
    filters:
    - value: github.com/stretchr/objx
  golint:
    filters:
      - type: "path"
        value: "main.go"

The output of godelw:

➜  k8s-resource-gc git:(develop) ✗ ./godelw check golint
Error: unrecognized filter type name
➜  k8s-resource-gc git:(develop) ✗ ./godelw check golint
Error: unrecognized filter type path
➜  k8s-resource-gc git:(develop) ✗

Replaced "path" with "name" in the first run of it obviously.

Docs i'm referencing: https://github.com/palantir/godel/wiki/Check#more

Am I doing something wrong?

Nope, you're totally correct -- the docs are out of date. I'll fix them now.

In order to be more consistent with other configuration and provide more flexibility, the checks have an exclude configuration that allows users to specify names or paths to exclude. The configuration for what you're trying to do would be:

checks:
  golint:
    exclude:
      paths:
        - main.go

Will fix the documentation to reflect this and close this issue when that is done.