Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 lint update #1036

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ $(CONTROLLER_GEN): $(BINGO_DIR)/controller-gen.mod
@echo "(re)installing $(GOBIN)/controller-gen-v0.15.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=controller-gen.mod -o=$(GOBIN)/controller-gen-v0.15.0 "sigs.k8s.io/controller-tools/cmd/controller-gen"

GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.57.2
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.59.1
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.57.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.57.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v1.59.1"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.59.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"

GORELEASER := $(GOBIN)/goreleaser-v1.16.2
$(GORELEASER): $(BINGO_DIR)/goreleaser.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ go 1.21

toolchain go1.22.2

require github.com/golangci/golangci-lint v1.57.2 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.59.1 // cmd/golangci-lint
106 changes: 106 additions & 0 deletions .bingo/golangci-lint.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BINGO="${GOBIN}/bingo-v0.8.0"

CONTROLLER_GEN="${GOBIN}/controller-gen-v0.15.0"

GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.57.2"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.59.1"

GORELEASER="${GOBIN}/goreleaser-v1.16.2"

Expand Down
5 changes: 1 addition & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ linters-settings:
- dot
- default
- prefix(github.com/operator-framework)

# TODO: change this to `localmodule` when golangci-lint
# is updated to 1.58+
- prefix(github.com/operator-framework/operator-controller)
- localmodule
custom-order: true

errorlint:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ verify: tidy fmt vet generate manifests #HELP Verify all generated code is up-to
git diff --exit-code

.PHONY: fmt
fmt: #EXHELP Run go fmt against code.
go fmt ./...
fmt: $(GOLANGCI_LINT) #EXHELP Formats code
go fmt ./... && $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_ARGS)

.PHONY: vet
vet: #EXHELP Run go vet against code.
Expand Down
2 changes: 1 addition & 1 deletion internal/catalogmetadata/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (fsc *filesystemCache) FetchCatalogContents(ctx context.Context, catalog *c
if err := os.MkdirAll(filepath.Dir(metaPath), os.ModePerm); err != nil {
return fmt.Errorf("error creating directory for catalog metadata: %v", err)
}
if err := os.WriteFile(metaPath, meta.Blob, os.ModePerm); err != nil {
if err := os.WriteFile(metaPath, meta.Blob, 0600); err != nil {
return fmt.Errorf("error writing catalog metadata to file: %v", err)
}
return nil
Expand Down
Loading