Skip to content

Commit

Permalink
Merge pull request #24 from praveenkumar/master
Browse files Browse the repository at this point in the history
Misc fixes around golangci-lint
  • Loading branch information
gbraad authored Oct 18, 2021
2 parents 5126763 + 6288800 commit 0231dc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ linters:
- gocritic
- deadcode
- misspell
- golint
- revive
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GOPATH ?= $(shell go env GOPATH)

BINARY_NAME := crc-admin-helper
RELEASE_DIR ?= release
GOLANGCI_LINT_VERSION = v1.41.1

LDFLAGS := -X github.com/code-ready/admin-helper/pkg/constants.Version=$(VERSION) -extldflags='-static' -s -w $(GO_LDFLAGS)

Expand All @@ -27,6 +28,12 @@ clean:
rm -fr release
rm -fr crc-admin-helper.spec

.PHONY: golangci-lint
golangci-lint:
@if $(GOPATH)/bin/golangci-lint version 2>&1 | grep -vq $(GOLANGCI_LINT_VERSION); then\
pushd /tmp && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) && popd; \
fi

$(BUILD_DIR)/macos-amd64/$(BINARY_NAME):
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/macos-amd64/$(BINARY_NAME) $(GO_BUILDFLAGS) ./cmd/admin-helper/

Expand All @@ -52,8 +59,8 @@ build:
CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BINARY_NAME) $(GO_BUILDFLAGS) ./cmd/admin-helper/

.PHONY: lint
lint:
golangci-lint run
lint: golangci-lint
$(GOPATH)/bin/golangci-lint run

.PHONY: test
test:
Expand Down

0 comments on commit 0231dc9

Please sign in to comment.