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

x/tools/gopls: set non-zero exit code on check command when there are errors #67078

Open
silverwind opened this issue Apr 27, 2024 · 0 comments
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@silverwind
Copy link

silverwind commented Apr 27, 2024

Proposal Details

gopls check is useful to lint code, but it currently always sets exit code 0 which is not ideal when one wants to run it for example on a CI:

$ gopls check internal/cmd/check.go; echo $?
main.go:10:24: unused parameter: file
0

I suggest to either always set exit code to non-zero when there are errors, or introduce a new --exit-code option to do the same.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Apr 27, 2024
@gopherbot gopherbot added this to the Unreleased milestone Apr 27, 2024
@silverwind silverwind changed the title x/tools/gopls: set non-zero exit code on check command when there are errors proposal: x/tools/gopls: set non-zero exit code on check command when there are errors Apr 27, 2024
@silverwind silverwind changed the title proposal: x/tools/gopls: set non-zero exit code on check command when there are errors x/tools/gopls: set non-zero exit code on check command when there are errors Apr 27, 2024
@findleyr findleyr added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 30, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/backlog Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants