Skip to content

Commit

Permalink
Noref/bump linter (#2765)
Browse files Browse the repository at this point in the history
* bump linter

* apply new linter rules

* fix test

* whoops - didn't mean to make that an error
  • Loading branch information
samoddball authored Aug 15, 2024
1 parent e95beb7 commit 66ff087
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
)$
- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.60.1
hooks:
- id: golangci-lint-full
name: Lint go files
Expand Down
4 changes: 1 addition & 3 deletions pkg/appvalidation/business_case_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ func (s *AppValidateTestSuite) TestBusinessCaseForUpdate() {
err := BusinessCaseForUpdate(&businessCase)
s.Error(err)
s.IsType(&apperrors.ValidationError{}, err)
expectedErrMessage := fmt.Sprintf("Could not validate *models.BusinessCaseWithCosts " + id.String() +
": {\"LifecycleCostPhase\":\"cannot have multiple costs for the same phase, solution, and year\"}",
)
expectedErrMessage := fmt.Sprintf(`Could not validate *models.BusinessCaseWithCosts %s: {"LifecycleCostPhase":"cannot have multiple costs for the same phase, solution, and year"}`, id.String())
s.Equal(expectedErrMessage, err.Error())
})
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cedar/core/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func (c *Client) addRoles(ctx context.Context, cedarSystemID string, newRoles []

if resp.Payload.Result == "error" {
if len(resp.Payload.Message) > 0 {
return fmt.Errorf(resp.Payload.Message[0]) // message from CEDAR should be "Role assignment(s) could not be found"
return errors.New(resp.Payload.Message[0]) // message from CEDAR should be "Role assignment(s) could not be found"
}
return fmt.Errorf("unknown error")
}
Expand Down Expand Up @@ -469,7 +469,7 @@ func (c *Client) deleteRoles(ctx context.Context, roleIDsToDelete []string) erro

if resp.Payload.Result == "error" {
if len(resp.Payload.Message) > 0 {
return fmt.Errorf(resp.Payload.Message[0]) // should be "Role assignment(s) could not be found"
return errors.New(resp.Payload.Message[0]) // should be "Role assignment(s) could not be found"
}
return fmt.Errorf("unknown error")
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/graph/resolvers/system_intake_status_requester.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package resolvers

import (
"errors"
"fmt"
"time"

Expand All @@ -13,7 +14,7 @@ const noDecisionInvalidStateErrMsg = "issue calculating the requester intake sta
// based on the intake's current step, the state of that step, and the overall intake state (open/closed)
func CalculateSystemIntakeRequesterStatus(intake *models.SystemIntake, currentTime time.Time) (models.SystemIntakeStatusRequester, error) {
if intake.Step == models.SystemIntakeStepDECISION && intake.DecisionState == models.SIDSNoDecision {
return "", fmt.Errorf(noDecisionInvalidStateErrMsg)
return "", errors.New(noDecisionInvalidStateErrMsg)
}

if intake.State == models.SystemIntakeStateClosed && intake.DecisionState == models.SIDSNoDecision {
Expand Down Expand Up @@ -115,7 +116,7 @@ func calcSystemIntakeDecisionStatusRequester(decisionState models.SystemIntakeDe
case models.SIDSNoDecision:
// we shouldn't hit this case, it should be caught by the check at the start of CalculateSystemIntakeRequesterStatus(),
// but it's repeated here for clarity and to make sure we handle all possible values of decisionState in this function
return "", fmt.Errorf(noDecisionInvalidStateErrMsg)
return "", errors.New(noDecisionInvalidStateErrMsg)
}

return "", fmt.Errorf("issue calculating the requester intake status, no valid decisionState")
Expand Down

0 comments on commit 66ff087

Please sign in to comment.