-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add lint-go-gopls
#30729
Add lint-go-gopls
#30729
Conversation
The |
Suggested by logs in #30729 - Remove `math/rand.Seed` `rand.Seed is deprecated: As of Go 1.20 there is no reason to call Seed with a random value.` - Replace `math/rand.Read` `rand.Read is deprecated: For almost all use cases, [crypto/rand.Read] is more appropriate.` - Replace `math/rand` with `math/rand/v2`, which is available since Go 1.22
This reverts commit f7b0d9a.
Lint script added which performs error detection and error counting. It should now fail the CI like this and also be much less verbose with module downloads which it apparently does:
|
Output and failure detection looks good now. I will add |
Will post an update later on the outstanding issues. I think we should only merge this after all issues have been fixed. |
49 errors left, #30735 will fix a few. |
It seems gopls has no support for gitea/modules/graceful/manager_windows.go Lines 44 to 45 in a21ca9b
|
It seems all deprecations that are warned here already have |
As discovered by #30729. --------- Co-authored-by: Giteabot <teabot@gitea.io>
As discovered by go-gitea/gitea#30729. --------- Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit 610802df85933e7a190a705bc3f7800da87ce868) Conflicts: tests/integration/git_test.go trivial conflict because of https://codeberg.org/forgejo/forgejo/pulls/2834
This is ready now. I fixed all non-deprecation errors and one golang deprecation as well. For reference, here are the remaining
|
* giteaofficial/main: Add `lint-go-gopls` (go-gitea#30729) Make blockquote attention recognize more syntaxes (go-gitea#31240) Fix admin oauth2 custom URL settings (go-gitea#31246) Replace `gt-word-break` with `tw-break-anywhere` (go-gitea#31183) Make pasted "img" tag has the same behavior as markdown image (go-gitea#31235) Remove .segment from .project-column (go-gitea#31204) Fix overflow on push notification (go-gitea#31179) Fix NuGet Package API for $filter with Id equality (go-gitea#31188) Fix overflow on notifications (go-gitea#31178) Update chroma to v2.14.0 (go-gitea#31177) Update air package path (go-gitea#31233) Bump `@github/relative-time-element` to v4.4.1 (go-gitea#31232)
* origin/main: (231 commits) Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (go-gitea#31211) Add `MAX_ROWS` option for CSV rendering (go-gitea#30268) Update `golang.org/x/net` (go-gitea#31260) Add replacement module for `mholt/archiver` (go-gitea#31267) Fix Activity Page Contributors dropdown (go-gitea#31264) Optimize runner-tags layout to enhance visual experience (go-gitea#31258) fix: allow actions artifacts storage migration to complete succesfully (go-gitea#31251) Add `lint-go-gopls` (go-gitea#30729) Make blockquote attention recognize more syntaxes (go-gitea#31240) Fix admin oauth2 custom URL settings (go-gitea#31246) Replace `gt-word-break` with `tw-break-anywhere` (go-gitea#31183) Make pasted "img" tag has the same behavior as markdown image (go-gitea#31235) Remove .segment from .project-column (go-gitea#31204) Fix overflow on push notification (go-gitea#31179) Fix NuGet Package API for $filter with Id equality (go-gitea#31188) Fix overflow on notifications (go-gitea#31178) Update chroma to v2.14.0 (go-gitea#31177) Update air package path (go-gitea#31233) Bump `@github/relative-time-element` to v4.4.1 (go-gitea#31232) Add option for mailer to override mail headers (go-gitea#27860) ...
Uses
gopls check <files>
as a linter. Tested locally and brings up 149 errors currently for me. I don't think I want to fix them in this PR, but I would like at least to get this analysis running on CI.List of errors: