Skip to content

Commit 823d38e

Browse files
committed
feat(intake): improve varible names readability
1 parent 0a1a702 commit 823d38e

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

internal/cmd/beta/intake/runner/delete/delete.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ import (
2222
)
2323

2424
const (
25-
runnerIdArg = "RUNNER_ID"
26-
forceFlag = "force"
25+
runnerIdArg = "RUNNER_ID"
26+
forceDeleteFlag = "force"
2727
)
2828

2929
// inputModel struct holds all the input parameters for the command
3030
type inputModel struct {
3131
*globalflags.GlobalFlagModel
32-
RunnerId string
33-
Force bool
32+
RunnerId string
33+
ForceDelete bool
3434
}
3535

3636
// NewCmd creates a new cobra command for deleting an Intake Runner
@@ -62,7 +62,7 @@ func NewCmd(p *types.CmdParams) *cobra.Command {
6262
}
6363

6464
prompt := fmt.Sprintf("Are you sure you want to delete Intake Runner %q?", model.RunnerId)
65-
if model.Force {
65+
if model.ForceDelete {
6666
prompt = fmt.Sprintf("%s This will also remove all Intakes and Intake Users that would stop the removal of the Intake", prompt)
6767
}
6868
err = p.Printer.PromptForConfirmation(prompt)
@@ -101,7 +101,7 @@ func NewCmd(p *types.CmdParams) *cobra.Command {
101101
}
102102

103103
func configureFlags(cmd *cobra.Command) {
104-
cmd.Flags().Bool(forceFlag, false, "When true, also removes all associated Intakes and Intake Users that would stop the removal of the Intake")
104+
cmd.Flags().Bool(forceDeleteFlag, false, "When true, also removes all associated Intakes and Intake Users that would stop the removal of the Intake")
105105
}
106106

107107
// parseInput parses the command arguments and flags into a standardized model
@@ -116,7 +116,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
116116
model := inputModel{
117117
GlobalFlagModel: globalFlags,
118118
RunnerId: runnerId,
119-
Force: flags.FlagToBoolValue(p, cmd, forceFlag),
119+
ForceDelete: flags.FlagToBoolValue(p, cmd, forceDeleteFlag),
120120
}
121121

122122
p.DebugInputModel(model)
@@ -126,7 +126,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
126126
// buildRequest creates the API request to delete an Intake Runner
127127
func buildRequest(ctx context.Context, model *inputModel, apiClient *intake.APIClient) intake.ApiDeleteIntakeRunnerRequest {
128128
req := apiClient.DefaultAPI.DeleteIntakeRunner(ctx, model.ProjectId, model.Region, model.RunnerId)
129-
if model.Force {
129+
if model.ForceDelete {
130130
return req.Force(true)
131131
}
132132
return req

internal/cmd/beta/intake/runner/delete/delete_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ func TestParseInput(t *testing.T) {
9898
description: "with force",
9999
argValues: fixtureArgValues(),
100100
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
101-
flagValues[forceFlag] = "true"
101+
flagValues[forceDeleteFlag] = "true"
102102
}),
103103
isValid: true,
104104
expectedModel: fixtureInputModel(func(model *inputModel) {
105-
model.Force = true
105+
model.ForceDelete = true
106106
}),
107107
},
108108
{
@@ -154,7 +154,7 @@ func TestBuildRequest(t *testing.T) {
154154
{
155155
description: "with force",
156156
model: fixtureInputModel(func(model *inputModel) {
157-
model.Force = true
157+
model.ForceDelete = true
158158
}),
159159
expectedRequest: fixtureRequest().Force(true),
160160
},

0 commit comments

Comments
 (0)