Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

govet: allow analyzers suite configuration #696

Closed
ernado opened this issue Sep 14, 2019 · 0 comments · Fixed by #697
Closed

govet: allow analyzers suite configuration #696

ernado opened this issue Sep 14, 2019 · 0 comments · Fixed by #697
Labels
area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement

Comments

@ernado
Copy link
Member

ernado commented Sep 14, 2019

Enabling or disabling go vet plug-ins would be very cool.
Seems like implementation is pretty straight-forward:

func NewGovet(cfg *config.GovetSettings) *goanalysis.Linter {
analyzers := []*analysis.Analyzer{
// the traditional vet suite:
asmdecl.Analyzer,
assign.Analyzer,
atomic.Analyzer,
bools.Analyzer,
buildtag.Analyzer,
cgocall.Analyzer,
composite.Analyzer,
copylock.Analyzer,
errorsas.Analyzer,
httpresponse.Analyzer,
loopclosure.Analyzer,
lostcancel.Analyzer,
nilfunc.Analyzer,
printf.Analyzer,
shift.Analyzer,
stdmethods.Analyzer,
structtag.Analyzer,
tests.Analyzer,
unmarshal.Analyzer,
unreachable.Analyzer,
unsafeptr.Analyzer,
unusedresult.Analyzer,
}

We can filter analyzers in NewGovet function, but I'm not sure about config.
I think that there should be something like we have for linters section:

linters:
  enable:
    - megacheck
    - govet
  enable-all: false
  disable:
    - maligned
    - prealloc
  disable-all: false

But in linters-settings.govet.

Rel: #446

@tpounds tpounds added area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement labels Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants