Skip to content

Commit

Permalink
fix: do not install golangci-lint (#54)
Browse files Browse the repository at this point in the history
* fix: do not install golangci-lint

* fix: do not use goimports

* fix: do not lint
  • Loading branch information
belitre authored Mar 24, 2022
1 parent 14453d3 commit d1efae2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
go-version: ${{ env.GOLANG_VERSION }}

- name: build and test
run: make build test
run: make build test test-checker-cli package-checker-cli

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ covhtml: test

.PHONY: test-checker-cli
test-checker-cli:
$(MAKE) -C cli bootstrap test lint
$(MAKE) -C cli test

.PHONY: package-checker-cli
package-checker-cli:
Expand Down
23 changes: 15 additions & 8 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT_TAG := $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")

TMP_VERSION := $(GIT_SHORT_COMMIT)

HAS_GOX := $(shell command -v gox;)

ifndef VERSION
ifeq ($(GIT_DIRTY), clean)
Expand Down Expand Up @@ -37,36 +37,43 @@ vendor: tidy
@go mod vendor

.PHONY: test
test: fmt lint
test: fmt
@echo "test target..."
@go test ./... -v -count=1

.PHONY: lint
lint: bootstrap
lint: bootstrap-lint
@echo "lint target..."
@golangci-lint run --enable-all --disable lll,godox,wsl,funlen,gochecknoglobals,gochecknoinits ./...

.PHONY: bootstrap
bootstrap:
@echo "bootstrap target..."
.PHONY: bootstrap-lint
bootstrap-lint:
@echo "bootstrap-lint target..."
ifndef HAS_GOLANCI_LINT
@GOPROXY=direct GOSUMDB=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
endif

.PHONY: fmt
fmt:
@echo "fmt target..."
@find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
@gofmt -l -w -s $(SRC)

.PHONY: build
build: build-cross

# usage: make clean build-cross dist VERSION=v0.2-alpha
.PHONY: build-cross
build-cross: LDFLAGS += -extldflags "-static"
build-cross:
build-cross: bootstrap-gox
CGO_ENABLED=0 gox -parallel=3 -output="_dist/{{.OS}}-{{.Arch}}/avro-kedavro-checker" -osarch='$(TARGETS)' -ldflags '$(LDFLAGS)' $(BUILD_PATH)

.PHONY: bootstrap-gox
bootstrap-gox:
@echo "bootstrap-gox target..."
ifndef HAS_GOX
@go get -u github.com/mitchellh/gox
endif

.PHONY: dist
dist: build
ls
Expand Down

0 comments on commit d1efae2

Please sign in to comment.