Skip to content

Upgrade gopls to v0.19.0, add make fix #34772

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

Merged
merged 12 commits into from
Jun 18, 2025
Merged

Upgrade gopls to v0.19.0, add make fix #34772

merged 12 commits into from
Jun 18, 2025

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Jun 18, 2025

Upgrade to v0.19.0 and fix issues. Runs with new warning serverity setting. This likely does less checks than before. Additionally, add make fix which runs modernize. This is also verified on CI.

For the record, here are the issues discoverd when running with info severity, in case we want to fix these:

tests/integration/repo_test.go:95:5-14: could use tagged switch on i
tests/integration/api_packages_generic_test.go:149:4-64: could use tagged switch on setting.Packages.Storage.Type
services/webhook/msteams_test.go:33:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:59:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:85:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:111:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:138:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:161:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:187:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:213:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:239:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:266:4-33: could use tagged switch on fact.Name
services/webhook/msteams_test.go:407:4-33: could use tagged switch on fact.Name
tests/integration/api_packages_conan_test.go:350:6-33: could use tagged switch on pf.Name
models/issues/tracked_time_test.go:98:3-18: could use tagged switch on user.ID
tests/integration/api_token_test.go:505:5-43: could use tagged switch on minRequiredLevel
services/gitdiff/gitdiff.go:220:33-46: method "getLineLegacy" is unused

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 18, 2025
@silverwind silverwind changed the title Upgrade gopls to v0.19.0 Upgrade gopls to v0.19.0 Jun 18, 2025
@silverwind silverwind changed the title Upgrade gopls to v0.19.0 Upgrade gopls to v0.19.0, integrate modernize into make fmt Jun 18, 2025
@silverwind
Copy link
Member Author

BTW the modernize fixer seems quite fast, make fmt completes in 10 seconds on my machine.

@silverwind
Copy link
Member Author

Oh and by the way I'm not completely sold that fmt should also perform code fixes. Maybe it's better to split this out into a make fix target or similar.

@silverwind silverwind changed the title Upgrade gopls to v0.19.0, integrate modernize into make fmt Upgrade gopls to v0.19.0, add make fix Jun 18, 2025
@silverwind
Copy link
Member Author

Decided to split into separate make fix target for automated code fixes.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 18, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 18, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 18, 2025
@lunny lunny enabled auto-merge (squash) June 18, 2025 18:40
@lunny lunny merged commit b18c047 into go-gitea:main Jun 18, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Jun 18, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/internal modifies/migrations topic/code-linting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants