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

lint: report golangci-lint problems #2706

Merged
merged 3 commits into from
Feb 11, 2020

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Feb 10, 2020

lint: update golangci-lint handling to report compiler problems
lint: add tests for golangci-lint problems
lint: specify which linter's messages are to be filtered

Specify which linter's messages are to be filtered in
s:metalinterautosavecomplete.

Fixes #2700

@bhcleek bhcleek added this to the vim-go 1.23 milestone Feb 10, 2020
Specify which linter's messages are to be filtered in
s:metalinterautosavecomplete.
Add tests to verify that compilation and other problems that can prevent
golangci-lint from completing correctly will show the problems in the
quickfix lists.
@orlangure
Copy link
Contributor

As discussed in the linked issue, neither using master nor this code resolves the issue where vim doesn't recognize location of files reported by golangci-lint. Sample output of golangci-lint if executed in command line:

go/src/dir/some_test.go:15:9: mnd: Magic number: 1, in <argument> detected (gomnd)
                g.Add(1)

golangci-lint version

golangci-lint has version v1.23.4-0.20200208200517-6436e9a757ad built from (unknown, mod sum: "h1:ZQIbuRc4WKsTViDsYeCY0eHR9+bgig7JQK8hoaYP9Bw=") on (unknown)

Vim treats the output as regular error messages and appends || on every line.

@bhcleek
Copy link
Collaborator Author

bhcleek commented Feb 10, 2020

The tests pass on master and the additional test in this PR are also passing (there's several tests to validate golangci-lint's output is handled correctly).

Since what you're seeing is happening on master, can you create a new issue that has clear reproduction steps? I'll need to know your relevant vim-go settings (e.g. g:go_metalinter_enabled) and some code that can be used to duplicate the problem. If the code to duplicate this is already in a publicly available repo, just point me to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

golangci-lint doesn't open quickfix or location lists?
2 participants