Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

blacklist of files #98

Closed
drewwells opened this issue Jan 13, 2015 · 7 comments
Closed

blacklist of files #98

drewwells opened this issue Jan 13, 2015 · 7 comments
Labels

Comments

@drewwells
Copy link

There's currently no way to exclude certain files from linting rules ie. lint a.go b.go, but skip c.go.

I tried getting around this by using go list, only to find that golint pkgA/file pkgB/file throws errors about mismatched packages. A filter similar to go test -run would very helpful for transitioning to the use of golint.

@dsymonds
Copy link
Contributor

Just use grep to filter the output if that's what you want. Golint does not force you to address every thing it flags (there will be false positives).

@drewwells
Copy link
Author

Grep will always return exit 0. Is golint always going to return 0?

@dsymonds
Copy link
Contributor

Most likely, though it's trivial enough to run (golint ... || true) to make sure.

@drewwells
Copy link
Author

We'd like our CI to fail on linting errors, grep masks that.

@dsymonds
Copy link
Contributor

That's not what golint is for. It does not produce errors, only
suggestions. Please read the README.

@zimmski
Copy link
Contributor

zimmski commented Jan 14, 2015

@drewwells: Static analysis tools like golint always produce suggestions. There can be a lot of false positives in there and there is often no way to flag them. However, I too like my CI to fail because I often forget to run all tools myself. You can have a look at the linting section here https://github.com/zimmski/tavor/blob/master/.travis.yml to get an idea on how you can accomplish the same.

@drewwells
Copy link
Author

That's a good idea, thanks! We can whitelist lint suggestions that we
definitely want to fail on.

On Wednesday, January 14, 2015, Markus Zimmermann [email protected]
wrote:

@drewwells https://github.com/drewwells: Static analysis tools like
golint always produce suggestions. There can be a lot of false positives in
there and there is often no way to flag them. However, I too like my CI to
fail because I often forget to run all tools myself. You can have a look at
the linting section here
https://github.com/zimmski/tavor/blob/master/.travis.yml to get an idea
on how you can accomplish the same.


Reply to this email directly or view it on GitHub
#98 (comment).

ruflin pushed a commit to elastic/beats that referenced this issue Apr 13, 2017
Unfortunately this is the best we can do between golint and reviewdog:

golang/lint#98 (comment)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants