Skip to content

chore: enable unused-parameter from revive #1783

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 1 commit into from
Mar 23, 2025

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Jan 30, 2025

Description

unused-parameter: This rule warns on unused parameters. Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug.

@mmorel-35
Copy link
Contributor Author

@shirou ,
I just rebase and fixed MacOs and Windows platforms
I'm wondering if it would be pertinent to cover every GOOS and GOARCH platforms with golangci-lint by the way

@mmorel-35 mmorel-35 marked this pull request as draft February 21, 2025 08:38
@mmorel-35
Copy link
Contributor Author

mmorel-35 commented Feb 21, 2025

I have opened #1797 , I believe it's better to merge it first and then update this one.

@mmorel-35 mmorel-35 force-pushed the revive/unused-parameter branch 8 times, most recently from ca659f4 to 35e8062 Compare February 21, 2025 10:03
@mmorel-35 mmorel-35 force-pushed the revive/unused-parameter branch from 35e8062 to 37dd0eb Compare February 22, 2025 13:40
@mmorel-35 mmorel-35 marked this pull request as ready for review February 22, 2025 13:41
@mmorel-35 mmorel-35 force-pushed the revive/unused-parameter branch 5 times, most recently from 103801b to 1f43ea8 Compare February 25, 2025 06:20
@mmorel-35
Copy link
Contributor Author

mmorel-35 commented Mar 3, 2025

@shirou,
Would you mind having a look whenever you can find the time ?

@mmorel-35 mmorel-35 force-pushed the revive/unused-parameter branch 7 times, most recently from 9bfd195 to 86eaf27 Compare March 9, 2025 08:01
@mmorel-35
Copy link
Contributor Author

@shirou,
Is there anything left to merge here ?

@shirou
Copy link
Owner

shirou commented Mar 14, 2025

Your contribution is greatly appreciated. However, there have been many updates, and I am struggling to keep up with the review process. I apologize for the delay, and I kindly ask for your patience.

@shirou shirou requested a review from Copilot March 14, 2025 11:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the revive lint rule “unused-parameter” by updating several function signatures to replace unused parameters with an underscore.

  • Updated functions across docker, disk, and cpu packages consistently mark unused parameters.
  • Adjusted test functions and configuration files to support the new rule.

Reviewed Changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docker/docker_notlinux.go Unused context parameters marked as "_"
disk/disk_solaris.go Unused context and string parameters renamed
disk/disk_freebsd.go Updated unused context parameters
cpu/cpu_solaris.go Renamed unused context parameters
cpu/cpu_freebsd.go Unused context parameters renamed (multiple functions)
cpu/cpu_openbsd.go Updated unused context and logical parameters
cpu/cpu_dragonfly.go Replaced unused parameters with "_"
cpu/cpu_darwin.go Unused parameters updated appropriately
disk/disk_darwin.go Replaced unused parameters with "_"
cpu/cpu_netbsd.go Updated unused parameters for context and logical flag
docker/docker_linux_test.go Marked testing parameters as unused
cpu/cpu_plan9.go Renamed unused "percpu" parameter where applicable
cpu/cpu_windows.go Unused context parameter renamed
disk/disk_openbsd.go Updated unused parameters for disk functions
docker/main_test.go Updated testing parameters to "_"
disk/disk_windows.go Adjusted unused parameters in disk functions
disk/disk_netbsd.go Replaced unused parameters with "_"
disk/disk_fallback.go Updated unused context and other parameters appropriately
disk/disk_unix.go Updated unused context parameter in UsageWithContext
.golangci.yml Re-enabled the "unused-parameter" linter rule

@mmorel-35 mmorel-35 force-pushed the revive/unused-parameter branch from 86eaf27 to dc9b409 Compare March 15, 2025 08:32
@@ -6,7 +6,7 @@ import (
"testing"
)

func TestSysAdvancedDockerInfo(t *testing.T) {
func TestSysAdvancedDockerInfo(_ *testing.T) {
Copy link
Owner

@shirou shirou Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The t should be used for test. I will make a PR in another PR.

Copy link
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have finally completed the review of this PR. Thank you for making so many corrections. I have a comment, but I plan to change it in a another PR.

@shirou shirou merged commit 7b14b86 into shirou:master Mar 23, 2025
51 checks passed
@mmorel-35 mmorel-35 deleted the revive/unused-parameter branch March 23, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants