Skip to content

Commit

Permalink
chore: added make targets for lint (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfaizanse authored Mar 12, 2024
1 parent 90bda4e commit 1d321df
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

bin
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@

LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

# =============================================================================
# Lint
# =============================================================================

GOLANG_CI_LINT_VERSION ?= v1.55.2
.PHONY: golangci-lint
golangci-lint:
test -s $(LOCALBIN)/golangci-lint && $(LOCALBIN)/golangci-lint version | grep -q $(GOLANG_CI_LINT_VERSION) || \
GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANG_CI_LINT_VERSION)

.PHONY: lint
lint: golangci-lint## Check lint issues using `golangci-lint`
$(LOCALBIN)/golangci-lint run --timeout 5m

.PHONY: lint-compact
lint-compact: golangci-lint## Check lint issues using `golangci-lint` in compact result format
$(LOCALBIN)/golangci-lint run --timeout 5m --print-issued-lines=false

.PHONY: lint-fix
lint-fix: golangci-lint## Check and fix lint issues using `golangci-lint`
$(LOCALBIN)/golangci-lint run --fix --timeout 5m


# =============================================================================
# Loadtest
# =============================================================================
Expand Down

0 comments on commit 1d321df

Please sign in to comment.