Skip to content

Commit

Permalink
chore: add linting target
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Bähler <[email protected]>
  • Loading branch information
oliverbaehler committed Nov 25, 2023
1 parent 1a6d7f8 commit fedd606
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BUILD_DATE ?= $(shell git log -1 --format="%at" | xargs -I{} sh -c 'if [ "$
IMG_BASE ?= $(REPOSITORY)
IMG ?= $(IMG_BASE):$(VERSION)
CAPSULE_IMG ?= $(REGISTRY)/$(IMG_BASE)
SRC_ROOT = $(shell git rev-parse --show-toplevel)

# Options for 'bundle-build'
ifneq ($(origin CHANNELS), undefined)
Expand All @@ -33,6 +34,11 @@ endif

all: manager

.PHONY: lint
lint: GOLANGCI_VERSION := v1.51.2
lint: docker
docker run -t --rm -v $(SRC_ROOT):/app -w /app golangci/golangci-lint:$(GOLANGCI_VERSION) golangci-lint run -v --timeout 5m --config /app/.golangci.yml

# Run tests
.PHONY: test
test: test-clean generate manifests test-clean
Expand Down Expand Up @@ -84,9 +90,6 @@ generate: controller-gen
apidoc: apidocs-gen
$(APIDOCS_GEN) crdoc --resources config/crd/bases --output docs/content/general/crds-apis.md --template docs/template/reference-cr.tmpl

# Helm
SRC_ROOT = $(shell git rev-parse --show-toplevel)

helm-controller-version:
$(eval VERSION := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}'))
$(eval KO_TAGS := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}'))
Expand Down
2 changes: 1 addition & 1 deletion controllers/tenant/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
TenantNameLabel = "kubernetes.io/metadata.name"
)

// Sets a label on the Tenant object with it's name
// Sets a label on the Tenant object with it's name.
func (r *Manager) ensureMetadata(ctx context.Context, tnt *capsulev1beta2.Tenant) (err error) {
tnt.SetLabels(map[string]string{
TenantNameLabel: tnt.Name,
Expand Down

0 comments on commit fedd606

Please sign in to comment.