Skip to content

Commit

Permalink
Fix linter errors caused by newer linter version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell authored and webbnh committed Jan 7, 2025
1 parent e9b4204 commit 3c547da
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/builtinfunctions/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func getCeilFunction() schema.CallableFunction {
// Description based on documentation for math.Ceil
"Returns the least integer value greater than or equal to the input.\n"+
"For example `ceil(1.5)` outputs `2.0`, and `ceil(-1.5)` outputs `-1.0`"+
"Special cases are:\n"+ //nolint:goconst
"Special cases are:\n"+
" ceil(±0) = ±0.0"+
" ceil(±Inf) = ±Inf\n"+
" ceil(NaN) = NaN",
Expand Down
2 changes: 0 additions & 2 deletions internal/step/foreach/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,6 @@ func (r *runningStep) transitionStageWithOutput(
)
}

//nolint:unparam // Currently only gets state finished, but that's okay.
//nolint:nolintlint // Differing versions of the linter do or do not care.
func (r *runningStep) completeStep(currentStage StageID, state step.RunningStepState, outputID *string, previousStageOutput *any) {
r.lock.Lock()
previousStage := string(r.currentStage)
Expand Down
8 changes: 4 additions & 4 deletions internal/step/plugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ func (r *runningStep) ProvideStageInput(stage string, input map[string]any) erro
case string(StageIDRunning):
return nil
case string(StageIDCancelled):
return r.provideCancelledInput(input)
r.provideCancelledInput(input)
return nil
case string(StageIDClosed):
return nil
case string(StageIDDeployFailed):
Expand Down Expand Up @@ -909,17 +910,16 @@ func (r *runningStep) provideStartingInput(input map[string]any) error {
return nil
}

func (r *runningStep) provideCancelledInput(input map[string]any) error {
func (r *runningStep) provideCancelledInput(input map[string]any) {
// Note: The calling function must have the step mutex locked
// Cancel if the step field is present and isn't false
if input["stop_if"] == nil {
return nil
return
}
if input["stop_if"] != false {
r.cancelled = true
r.cancelStep()
}
return nil
}

func (r *runningStep) hasCancellationHandler() bool {
Expand Down
4 changes: 2 additions & 2 deletions loadfile/loadfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// disregard (not throw an error) files with a type it cannot read.
func Test_LoadContext(t *testing.T) {
testdir := filepath.Join(TestDir, "load-ctx")
assert.NoError(t, os.MkdirAll(testdir, os.ModePerm))
assert.NoError(t, os.MkdirAll(testdir, 0750))

// create a directory
dirPath, err := os.MkdirTemp(testdir, "mydir")
Expand Down Expand Up @@ -191,7 +191,7 @@ var TestDir = filepath.Join(os.TempDir(), "loadfile-tests")
func TestMain(m *testing.M) {
// cleanup directory even if it's there
_ = os.RemoveAll(TestDir)
err := os.MkdirAll(TestDir, os.ModePerm)
err := os.MkdirAll(TestDir, 0750)
if err != nil {
log.Fatalf("failed to make directory %s %v", TestDir, err)
}
Expand Down

0 comments on commit 3c547da

Please sign in to comment.