-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
base: main
Are you sure you want to change the base?
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 |
In both cases, the `err` is nil because of `if` checks before Reference: #30729
In both cases, the `err` is nil because of `if` checks before Reference: go-gitea#30729
This causes a number of annotations to show up on PRs that we should fix first before merging, otherwise it would be annoying having those show up on every PR. |
) Resolve all cases for `unused parameter` and `unnecessary type arguments` Related: #30729 --------- Co-authored-by: Giteabot <teabot@gitea.io>
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
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: