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

Enable unparam linter #31277

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Enable unparam linter #31277

merged 6 commits into from
Jun 11, 2024

Conversation

silverwind
Copy link
Member

Enable unparam linter.

Often I could not tell the intention why param is unused, so I put //nolint for those cases like webhook request creation functions never using ctx.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 7, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 7, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/internal labels Jun 7, 2024
@silverwind silverwind added topic/code-linting type/refactoring Existing code has been cleaned up. There should be no new functionality. and removed modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/internal labels Jun 7, 2024
@silverwind silverwind changed the title Enable unparam linter Enable unparam linter Jun 7, 2024
@silverwind silverwind marked this pull request as draft June 7, 2024 00:30
@silverwind
Copy link
Member Author

Actually I think i will change many of these //nolint to _foo syntax so that the linter can stil lint the rest of the arguments which is valuable.

@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/internal labels Jun 10, 2024
@silverwind silverwind marked this pull request as ready for review June 10, 2024 21:21
@silverwind
Copy link
Member Author

Ready now, the only cases where underscore prop was applicable was in the webhook files. Other errors are more complex and many involve static return values or cases where a value is passed through a function unmodified.

services/webhook/dingtalk.go Outdated Show resolved Hide resolved
services/webhook/discord.go Outdated Show resolved Hide resolved
services/webhook/feishu.go Outdated Show resolved Hide resolved
services/webhook/matrix.go Outdated Show resolved Hide resolved
services/webhook/msteams.go Outdated Show resolved Hide resolved
services/webhook/packagist.go Outdated Show resolved Hide resolved
services/webhook/wechatwork.go Outdated Show resolved Hide resolved
services/webhook/telegram.go Outdated Show resolved Hide resolved
services/webhook/slack.go Outdated Show resolved Hide resolved
Co-authored-by: delvh <dev.lh@web.de>
models/dbfs/dbfile.go Outdated Show resolved Hide resolved
models/dbfs/dbfile.go Outdated Show resolved Hide resolved
@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 11, 2024
@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 11, 2024
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 11, 2024
@silverwind silverwind enabled auto-merge (squash) June 11, 2024 18:19
@silverwind silverwind merged commit fc2d75f into go-gitea:main Jun 11, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jun 11, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 11, 2024
@silverwind silverwind deleted the unparam branch June 11, 2024 20:01
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 12, 2024
* giteaofficial/main:
  Fix go-gitea#31185 try fix lfs download from bitbucket failed (go-gitea#31201)
  Enable `unparam` linter (go-gitea#31277)
  Make template `Iif` exactly match `if` (go-gitea#31322)
  update nix flake and add gofumpt (go-gitea#31320)
  code optimization (go-gitea#31315)
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/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/internal size/L Denotes a PR that changes 100-499 lines, ignoring generated files. topic/code-linting type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants