-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
0f0c11c
to
d41f983
Compare
ccce57b
to
f672dca
Compare
2689660
to
053af0b
Compare
c4715fe
to
051a2fe
Compare
@shirou , |
I have opened #1797 , I believe it's better to merge it first and then update this one. |
ca659f4
to
35e8062
Compare
35e8062
to
37dd0eb
Compare
103801b
to
1f43ea8
Compare
@shirou, |
9bfd195
to
86eaf27
Compare
@shirou, |
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. |
There was a problem hiding this 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 |
Signed-off-by: Matthieu MOREL <[email protected]>
86eaf27
to
dc9b409
Compare
@@ -6,7 +6,7 @@ import ( | |||
"testing" | |||
) | |||
|
|||
func TestSysAdvancedDockerInfo(t *testing.T) { | |||
func TestSysAdvancedDockerInfo(_ *testing.T) { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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.