Skip to content

Commit

Permalink
Fix new lint errors (#4203)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthchr authored Aug 21, 2024
1 parent fe24878 commit aa86061
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ linters:
- bugs
- unused
disable:
- scopelint # obsoleted by exportloopref
# Disabled as deprecation was announced in golanci-lint 1.49
- structcheck
- deadcode
- varcheck
# The below rules are disabled due to bug with go1.18 and generics: https://github.com/golangci/golangci-lint/issues/2859
- staticcheck
- gosimple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type servicePrincipalDetails struct {
// TODO: Hopefully we can revisit this in the future when they support other options.
func Test_RedHatOpenShift_OpenShiftCluster_CRUD(t *testing.T) {
t.Parallel()
t.Skip("flaky right now")

if *isLive {
t.Skip("ARO cluster test requires ServicePrincipal creation and referenced in the cluster object.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (r *azureDeploymentReconcilerInstance) MakeReadyConditionImpactingErrorFrom
}

// Stick errorDetails.Message into an error so that it will be displayed as the message on the condition
err = errors.Wrapf(cloudError, details.Message)
err = errors.Wrap(cloudError, details.Message)
reason := conditions.MakeReason(details.Code)
result := conditions.NewReadyConditionImpactingError(err, severity, reason)

Expand Down
2 changes: 1 addition & 1 deletion v2/internal/util/postgresql/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func addRoles(ctx context.Context, db *sql.DB, user SQLUser, roles set.Set[strin
errorStrings = append(errorStrings, err.Error())
}
if len(errorStrings) != 0 {
return fmt.Errorf(strings.Join(errorStrings, "\n"))
return errors.New(strings.Join(errorStrings, "\n"))
}
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func errorIfSpecStatusOverlap(statusDefinitions astmodel.TypeDefinitionSet, defi
}
}

return errors.Errorf(result.String())
return errors.New(result.String())
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func writeToBagItem(
addToBag := astbuilder.CallQualifiedFuncAsStmt(
conversionContext.PropertyBagName(),
"Add",
astbuilder.StringLiteralf(destinationEndpoint.Name()),
astbuilder.StringLiteral(destinationEndpoint.Name()),
expr)

return astbuilder.Statements(addToBag)
Expand All @@ -316,7 +316,7 @@ func writeToBagItem(
removeFromBag := astbuilder.CallQualifiedFuncAsStmt(
conversionContext.PropertyBagName(),
"Remove",
astbuilder.StringLiteralf(destinationEndpoint.Name()))
astbuilder.StringLiteral(destinationEndpoint.Name()))

// condition is a test to use to see whether we have a value to write to the property bag
// If we unilaterally write to the bag, this will be nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func addNodes(r *StructureReport, name string, count int) {

for i := 0; i < count; i++ {
n := fmt.Sprintf("%s.%d", name, i+1)
nested := r.Addf(n)
nested := r.Addf(n) //nolint:govet
addNodes(nested, n, count-i-1)
}
}

0 comments on commit aa86061

Please sign in to comment.