Skip to content

Commit

Permalink
Update project tooling (#52)
Browse files Browse the repository at this point in the history
Bump golangci-lint, goimports and controller-tools.
  • Loading branch information
afritzler authored Jul 1, 2024
1 parent 41f2739 commit 8300480
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57
version: v1.59
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ GOIMPORTS ?= $(LOCALBIN)/goimports-$(GOIMPORTS_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0
ENVTEST_VERSION ?= latest
GOLANGCI_LINT_VERSION ?= v1.57.2
GOIMPORTS_VERSION ?= v0.20.0
GOLANGCI_LINT_VERSION ?= v1.59.1
GOIMPORTS_VERSION ?= v0.22.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ import (
// Run e2e tests using the Ginkgo runner.
func TestE2E(t *testing.T) {
RegisterFailHandler(Fail)
fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n")
_, _ = fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n")
RunSpecs(t, "e2e suite")
}
10 changes: 7 additions & 3 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
)

func warnError(err error) {
fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
_, _ = fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
}

// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
Expand All @@ -52,12 +52,16 @@ func Run(cmd *exec.Cmd) ([]byte, error) {
cmd.Dir = dir

if err := os.Chdir(cmd.Dir); err != nil {
fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
if _, err := fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err); err != nil {
return nil, fmt.Errorf("%w", err)
}
}

cmd.Env = append(os.Environ(), "GO111MODULE=on")
command := strings.Join(cmd.Args, " ")
fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
if _, err := fmt.Fprintf(GinkgoWriter, "running: %s\n", command); err != nil {
return nil, fmt.Errorf("%w", err)
}
output, err := cmd.CombinedOutput()
if err != nil {
return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
Expand Down

0 comments on commit 8300480

Please sign in to comment.