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 revive unused-parameter check and fix findings #3040

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ linters-settings:
disabled: true # TODO: Investigate if it should be enabled. Disabled for now due to many findings.
- name: superfluous-else
- name: unused-parameter
disabled: true # TODO: Investigate if it should be enabled. Disabled for now due to many findings.
- name: unreachable-code
- name: redefines-builtin-id
#
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/external/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (p *createAPISubcommand) InjectResource(*resource.Resource) error {
return nil
}

func (p *createAPISubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
func (p *createAPISubcommand) UpdateMetadata(_ plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
setExternalPluginMetadata("api", p.Path, subcmdMeta)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/external/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type editSubcommand struct {
Args []string
}

func (p *editSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
func (p *editSubcommand) UpdateMetadata(_ plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
setExternalPluginMetadata("edit", p.Path, subcmdMeta)
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/plugins/external/external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type mockInValidOutputGetter struct{}

var _ ExecOutputGetter = &mockValidOutputGetter{}

func (m *mockValidOutputGetter) GetExecOutput(request []byte, path string) ([]byte, error) {
func (m *mockValidOutputGetter) GetExecOutput(_ []byte, _ string) ([]byte, error) {
return []byte(`{
"command": "init",
"error": false,
Expand All @@ -55,7 +55,7 @@ func (m *mockValidOutputGetter) GetExecOutput(request []byte, path string) ([]by

var _ ExecOutputGetter = &mockInValidOutputGetter{}

func (m *mockInValidOutputGetter) GetExecOutput(request []byte, path string) ([]byte, error) {
func (m *mockInValidOutputGetter) GetExecOutput(_ []byte, _ string) ([]byte, error) {
return nil, fmt.Errorf("error getting exec command output")
}

Expand All @@ -77,7 +77,7 @@ func (m *mockInValidOsWdGetter) GetCurrentDir() (string, error) {

type mockValidFlagOutputGetter struct{}

func (m *mockValidFlagOutputGetter) GetExecOutput(req []byte, path string) ([]byte, error) {
func (m *mockValidFlagOutputGetter) GetExecOutput(_ []byte, _ string) ([]byte, error) {
response := external.PluginResponse{
Command: "flag",
Error: false,
Expand All @@ -89,7 +89,7 @@ func (m *mockValidFlagOutputGetter) GetExecOutput(req []byte, path string) ([]by

type mockValidMEOutputGetter struct{}

func (m *mockValidMEOutputGetter) GetExecOutput(req []byte, path string) ([]byte, error) {
func (m *mockValidMEOutputGetter) GetExecOutput(_ []byte, _ string) ([]byte, error) {
response := external.PluginResponse{
Command: "metadata",
Error: false,
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/external/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type initSubcommand struct {
Args []string
}

func (p *initSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
func (p *initSubcommand) UpdateMetadata(_ plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
setExternalPluginMetadata("init", p.Path, subcmdMeta)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/external/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (p *createWebhookSubcommand) InjectResource(*resource.Resource) error {
return nil
}

func (p *createWebhookSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
func (p *createWebhookSubcommand) UpdateMetadata(_ plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) {
setExternalPluginMetadata("webhook", p.Path, subcmdMeta)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/declarative/v1/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (p *initSubcommand) InjectConfig(c config.Config) error {
return nil
}

func (p *initSubcommand) Scaffold(fs machinery.Filesystem) error {
func (p *initSubcommand) Scaffold(_ machinery.Filesystem) error {
err := updateDockerfile()
if err != nil {
return err
Expand Down