From c42553593e21175ad7b2b470cdc80a5630030ace Mon Sep 17 00:00:00 2001 From: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> Date: Tue, 23 Jun 2020 18:05:21 +0200 Subject: [PATCH] fix: remove unused variables from generated step coding (#1698) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove unused parameters from generated code * update steps * update steps * correct golden files Co-authored-by: Stephan Aßmus --- cmd/abapEnvironmentPullGitRepo_generated.go | 4 ++-- cmd/abapEnvironmentRunATCCheck_generated.go | 4 ++-- cmd/artifactPrepareVersion_generated.go | 4 ++-- cmd/checkmarxExecuteScan_generated.go | 4 ++-- cmd/cloudFoundryCreateServiceKey_generated.go | 4 ++-- cmd/cloudFoundryDeleteService_generated.go | 4 ++-- cmd/containerSaveImage_generated.go | 4 ++-- cmd/detectExecuteScan_generated.go | 4 ++-- cmd/fortifyExecuteScan_generated.go | 4 ++-- cmd/gctsCloneRepository_generated.go | 4 ++-- cmd/gctsCreateRepository_generated.go | 4 ++-- cmd/gctsDeploy_generated.go | 4 ++-- cmd/githubCreatePullRequest_generated.go | 4 ++-- cmd/githubPublishRelease_generated.go | 4 ++-- cmd/jsonApplyPatch_generated.go | 4 ++-- cmd/karmaExecuteTests_generated.go | 4 ++-- cmd/kubernetesDeploy_generated.go | 4 ++-- cmd/malwareExecuteScan_generated.go | 4 ++-- cmd/mavenBuild_generated.go | 4 ++-- cmd/mavenExecuteStaticCodeChecks_generated.go | 4 ++-- cmd/mavenExecute_generated.go | 4 ++-- cmd/mtaBuild_generated.go | 4 ++-- cmd/nexusUpload_generated.go | 4 ++-- cmd/npmExecuteLint_generated.go | 4 ++-- cmd/npmExecuteScripts_generated.go | 4 ++-- cmd/protecodeExecuteScan_generated.go | 4 ++-- cmd/sonarExecuteScan_generated.go | 4 ++-- cmd/xsDeploy_generated.go | 4 ++-- pkg/generator/helper/helper.go | 4 ++-- pkg/generator/helper/resources.go | 2 +- .../TestProcessMetaFiles/custom_step_code_generated.golden | 5 ++--- .../testdata/TestProcessMetaFiles/step_code_generated.golden | 5 ++--- 32 files changed, 63 insertions(+), 65 deletions(-) diff --git a/cmd/abapEnvironmentPullGitRepo_generated.go b/cmd/abapEnvironmentPullGitRepo_generated.go index 811d23f1e..1ac352ebc 100644 --- a/cmd/abapEnvironmentPullGitRepo_generated.go +++ b/cmd/abapEnvironmentPullGitRepo_generated.go @@ -42,7 +42,7 @@ Please provide either of the following options: * The host and credentials the Cloud Platform ABAP Environment system itself. The credentials must be configured for the Communication Scenario SAP_COM_0510. * The Cloud Foundry parameters (API endpoint, organization, space), credentials, the service instance for the ABAP service and the service key for the Communication Scenario SAP_COM_0510. * Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -65,7 +65,7 @@ Please provide either of the following options: return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/abapEnvironmentRunATCCheck_generated.go b/cmd/abapEnvironmentRunATCCheck_generated.go index 2a9e3655c..b6760a845 100644 --- a/cmd/abapEnvironmentRunATCCheck_generated.go +++ b/cmd/abapEnvironmentRunATCCheck_generated.go @@ -44,7 +44,7 @@ Please provide either of the following options: * Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority. Regardless of the option you chose, please make sure to provide the configuration for Software Components and Packages that you want to be checked analog to the examples listed on this page.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -65,7 +65,7 @@ Regardless of the option you chose, please make sure to provide the configuratio return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/artifactPrepareVersion_generated.go b/cmd/artifactPrepareVersion_generated.go index 642fadaa9..63e1ee393 100644 --- a/cmd/artifactPrepareVersion_generated.go +++ b/cmd/artifactPrepareVersion_generated.go @@ -145,7 +145,7 @@ Define ` + "`" + `buildTool: custom` + "`" + `, ` + "`" + `filePath: parameter is specified, this step will pull the latest commit available on the remote repository.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -57,7 +57,7 @@ func GctsDeployCommand() *cobra.Command { return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/githubCreatePullRequest_generated.go b/cmd/githubCreatePullRequest_generated.go index 1c5da8731..8b4816deb 100644 --- a/cmd/githubCreatePullRequest_generated.go +++ b/cmd/githubCreatePullRequest_generated.go @@ -41,7 +41,7 @@ func GithubCreatePullRequestCommand() *cobra.Command { Long: `This step allows you to create a pull request on Github. It can for example be used for GitOps scenarios or for scenarios where you want to have a manual confirmation step which is delegated to a GitHub pull request.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -63,7 +63,7 @@ It can for example be used for GitOps scenarios or for scenarios where you want return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/githubPublishRelease_generated.go b/cmd/githubPublishRelease_generated.go index 98df73cc4..da195cc97 100644 --- a/cmd/githubPublishRelease_generated.go +++ b/cmd/githubPublishRelease_generated.go @@ -52,7 +52,7 @@ The release can be filled with text plus additional information like: The result looks like ![Example release](../images/githubRelease.png)`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -74,7 +74,7 @@ The result looks like return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/jsonApplyPatch_generated.go b/cmd/jsonApplyPatch_generated.go index 98a1b40b1..948e93537 100644 --- a/cmd/jsonApplyPatch_generated.go +++ b/cmd/jsonApplyPatch_generated.go @@ -32,7 +32,7 @@ func JsonApplyPatchCommand() *cobra.Command { Short: "Patches a json with a patch file", Long: `This steps patches a json file with patch file using the json patch standard. This step can, e.g., be used if there is a json schema which needs to be patched.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -53,7 +53,7 @@ This step can, e.g., be used if there is a json schema which needs to be patched return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/karmaExecuteTests_generated.go b/cmd/karmaExecuteTests_generated.go index 0664baa1f..ea2e74fc9 100644 --- a/cmd/karmaExecuteTests_generated.go +++ b/cmd/karmaExecuteTests_generated.go @@ -41,7 +41,7 @@ In the Docker network, the containers can be referenced by the values provided i !!! note In a Kubernetes environment, the containers both need to be referenced with ` + "`" + `localhost` + "`" + `.`, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -62,7 +62,7 @@ In the Docker network, the containers can be referenced by the values provided i return nil }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { telemetryData := telemetry.CustomData{} telemetryData.ErrorCode = "1" handler := func() { diff --git a/cmd/kubernetesDeploy_generated.go b/cmd/kubernetesDeploy_generated.go index 0c11a228b..ff6e35a4d 100644 --- a/cmd/kubernetesDeploy_generated.go +++ b/cmd/kubernetesDeploy_generated.go @@ -64,7 +64,7 @@ helm upgrade --install --force --namespace --docker-username= --docker-password= --dry-run=true --output=json'` + "`" + ``, - PreRunE: func(cmd *cobra.Command, args []string) error { + PreRunE: func(cmd *cobra.Command, _ []string) error { startTime = time.Now() log.SetStepName(STEP_NAME) log.SetVerbose(GeneralConfig.Verbose) @@ -89,7 +89,7 @@ helm upgrade --install --force --namespace