-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: parse golangci-lint errors when g:go_metalinter_command is customized #2708
Conversation
@orlangure I'm trying to decide whether this PR is needed. Can you see if it's still relevant for you on master in light of #2715 ? You should be able to configure your golangci-lint config file as you want and then use |
There are still errors. Because I don't want to report some errors detected by golint, such as missing documents (OK, I admit I will supplement these damn documents when appropriate). So I customized Then, vim-go does not recognize the errors output by golangci-lint. Here is my config:
|
@flw-cn are you talking about on master? If so, then you'll need to set |
Yes. I currently use the
|
@flw-cn that will be a separate issue on master, and isn't directly relevant to the question I'm asking @orlangure . To do what you want on master, we'll need a new PR that moves https://github.com/fatih/vim-go/blob/master/autoload/go/lint.vim#L321 to within the |
Ok. I thought there was no plan to solve it. I will wait patiently. |
@flw-cn feel free to create an issue. What you're asking for doesn't have one yet. |
@bhcleek my previous configuration doesn't work on master (when I use custom golangci-lint command). There are two missing things for me to start using configuration instead of a custom command:
Maybe a change in my workflow can allow me to use configs with autosave (meaning I'll never need to lint child packages since every change is checked), but answering your original question, this PR is still relevant. |
@orlangure If I understand correctly, the default GolangCI parameter is See also:
|
to @bhcleek: This PR still seems to have what I want. But it now conflicts with the master branch. Will it continue to be merged? I think the processing logic of this PR is correct: determine whether it is Although moving https://github.com/fatih/vim-go/blob/master/autoload/go/lint.vim#L321 into the if block at https://github.com/fatih/vim-go/blob/master/autoload/go/lint.vim#L323-L325 can also bypass my problem, it seems that this PR is more reasonable. Expect it to be merged eventually. |
@flw-cn I do not intend to merge, because the ultimate goals of this PR can be accomplished on master without additional changes and trying to support an arbitrary command is difficult and error prone.
golangci/golangci-lint#542 suggests that you can put |
Golangci-lint's configuration file is definitely needed because GolangCI not only needs to run when developing locally but also needs to run in the workflow of GitHub Actions. I don't think making vim-go support golangci-lint's configuration file is an excessive requirement, nor do I think parsing I still want to be able to merge the contents of this PR into master, after all, this is achievable and not complicated. |
Fully supporting golangci-lint config file is already done on master.
It's more error prone than it appears on its face. With the change that was made to master to support the golangci-lint config file and @orlangure 's confirmation that the changes on master work for them, I don't see a reason to support an arbitrary command. |
Fixes #2707