Skip to content

Commit

Permalink
feat: update Makefile to improve dev experience. (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterC500 authored Sep 25, 2023
1 parent 8a29068 commit 89cdece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ GOLANGCI_LINT_VERSION ?= v1.53.2
# Arguments for getting directories & executing commands against them
# PKG_RECEIVER_DIRS = $(shell find ./pkg/receiver/* -type f -name "go.mod" -print -exec dirname {} \; | sort | uniq)
PKG_RECEIVER_DIRS = $(shell find ./pkg/receiver/* -type f -name '*go.mod*' | sed -r 's|/[^/]+$$||' |sort | uniq )
CHECKS = prep lint-all genqlient-all metagen-all test-all tidy-all fmt-all

# set ARCH var based on output
ifeq ($(ARCH),x86_64)
Expand Down Expand Up @@ -99,3 +100,13 @@ tidy-all:
.PHONY: fmt-all
fmt-all:
$(MAKE) -j 4 -C $(PKG_RECEIVER_DIRS) fmt

.PHONY: checks
checks:
$(MAKE) -j 4 $(CHECKS)
@if [ -n "$$(git diff --name-only -- $(GENQLIENT_DIRS))" ] || [ -n "$$(git diff --name-only -- $(METAGEN_DIRS))"] || [ -n "$$(git diff --name-only -- go.mod go.sum)"]; then \
echo "Some files have changed. Please commit them."; \
exit 1; \
else \
echo "completed successfully."; \
fi
1 change: 1 addition & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ endif

#GENQLIENT_DIRS = $(shell find . -type f -name 'genqlient.yaml' -exec dirname {} \;)
GENQLIENT_DIRS = $(shell find . -type f -name 'genqlient.yaml' -exec dirname {} \;)
METAGEN_DIRS = $(shell find . -type f -name 'documentation.md' -exec dirname {} \;)

# SRC_ROOT is the top of the source tree.
SRC_ROOT := $(shell git rev-parse --show-toplevel)
Expand Down

0 comments on commit 89cdece

Please sign in to comment.