Skip to content

Commit 9045367

Browse files
Combine Lint action
1 parent 599c532 commit 9045367

File tree

9 files changed

+8
-141
lines changed

9 files changed

+8
-141
lines changed

.github/workflows/catalogd-sanity.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.golangci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ run:
1616
# Default timeout is 1m, up to give more room
1717
timeout: 4m
1818

19-
issues:
20-
exclude-dirs:
21-
- '.*catalogd/.*'
22-
2319
linters:
2420
enable:
2521
- asciicheck

catalogd/.golangci.yaml

Lines changed: 0 additions & 77 deletions
This file was deleted.

catalogd/Makefile

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,6 @@ generate: $(CONTROLLER_GEN) ## Generate code and manifests.
8080
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
8181
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac output:webhook:artifacts:config=config/base/manager/webhook/
8282

83-
.PHONY: fmt
84-
fmt: ## Run go fmt against code.
85-
go fmt ./...
86-
87-
.PHONY: vet
88-
vet: ## Run go vet against code.
89-
go vet -tags '$(GO_BUILD_TAGS)' ./...
90-
9183
.PHONY: bingo-upgrade
9284
bingo-upgrade: $(BINGO) #EXHELP Upgrade tools
9385
@for pkg in $$($(BINGO) list | awk '{ print $$1 }' | tail -n +3); do \
@@ -120,15 +112,6 @@ e2e: run image-registry test-e2e kind-cluster-cleanup ## Run e2e test suite on l
120112
image-registry: ## Setup in-cluster image registry
121113
./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME)
122114

123-
.PHONY: tidy
124-
tidy: ## Update dependencies
125-
# Force tidy to use the version already in go.mod
126-
go mod tidy -go=$(GOLANG_VERSION)
127-
128-
.PHONY: verify
129-
verify: tidy fmt vet generate ## Verify the current code generation and lint
130-
git diff --exit-code
131-
132115
.PHONY: verify-crd-compatibility
133116
CRD_DIFF_ORIGINAL_REF := main
134117
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
@@ -141,9 +124,6 @@ verify-crd-compatibility: $(CRD_DIFF)
141124
echo "Skipping CRD diff: CRD does not exist in ${CRD_DIFF_ORIGINAL_REF}"; \
142125
fi
143126

144-
.PHONY: lint
145-
lint: $(GOLANGCI_LINT) ## Run golangci linter.
146-
$(GOLANGCI_LINT) run --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
147127

148128
## image-registry target has to come after run-latest-release,
149129
## because the image-registry depends on the olm-ca issuer.
@@ -196,7 +176,7 @@ export GO_BUILD_TAGS := containers_image_openpgp
196176
BUILDCMD = go build -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN)/$(notdir $@) ./cmd/$(notdir $@)
197177

198178
.PHONY: build-deps
199-
build-deps: generate fmt vet
179+
build-deps: generate
200180

201181
.PHONY: build go-build-local $(BINARIES)
202182
build: build-deps go-build-local ## Build binaries for current GOOS and GOARCH.

catalogd/Tiltfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
if not os.path.exists('../tilt-support'):
2-
fail('Please clone https://github.com/operator-framework/tilt-support to ../tilt-support')
3-
4-
load('../tilt-support/Tiltfile', 'deploy_repo')
1+
load('../.tilt-support', 'deploy_repo')
52

63
catalogd = {
74
'image': 'quay.io/operator-framework/catalogd',

catalogd/internal/controllers/core/clustercatalog_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ func TestCatalogdControllerReconcile(t *testing.T) {
758758
assert.Equal(t, ctrl.Result{}, res)
759759
// errors are aggregated/wrapped
760760
if tt.expectedError == nil {
761-
assert.Nil(t, err)
761+
require.NoError(t, err)
762762
} else {
763-
assert.NotNil(t, err)
763+
require.Error(t, err)
764764
assert.Equal(t, tt.expectedError.Error(), err.Error())
765765
}
766766
diff := cmp.Diff(tt.expectedCatalog, tt.catalog,

catalogd/internal/garbagecollection/garbage_collector_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestRunGarbageCollection(t *testing.T) {
7777

7878
_, err := runGarbageCollection(ctx, cachePath, metaClient)
7979
if !tt.wantErr {
80-
assert.NoError(t, err)
80+
require.NoError(t, err)
8181
entries, err := os.ReadDir(cachePath)
8282
require.NoError(t, err)
8383
assert.Len(t, entries, len(tt.existCatalogs))

catalogd/internal/source/containers_image_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ func TestImageRegistry(t *testing.T) {
410410
assert.False(t, rs.UnpackTime.IsZero())
411411
}
412412
} else {
413-
assert.Error(t, err)
413+
require.Error(t, err)
414414
isTerminal := errors.Is(err, reconcile.TerminalError(nil))
415415
assert.Equal(t, tt.terminal, isTerminal, "expected terminal %v, got %v", tt.terminal, isTerminal)
416416
}

catalogd/internal/webhook/cluster_catalog_webhook_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/stretchr/testify/assert"
8+
"github.com/stretchr/testify/require"
89
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
910
"k8s.io/apimachinery/pkg/runtime"
1011

@@ -91,7 +92,7 @@ func TestClusterCatalogDefaulting(t *testing.T) {
9192

9293
// Assert
9394
if tc.expectError {
94-
assert.Error(t, err)
95+
require.Error(t, err)
9596
assert.Contains(t, err.Error(), tc.errorMessage)
9697
} else {
9798
assert.NoError(t, err)

0 commit comments

Comments
 (0)