diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bd59d5a..854a4b7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -68,4 +68,4 @@ jobs: run: brew install shfmt - name: Run shfmt - run: shfmt -d -i 2 -ci . + run: make fmt-check diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..194601e --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +SH_SRCFILES = $(shell git ls-files "bin/*") +SHFMT_BASE_FLAGS = -s -i 2 -ci + +fmt: + shfmt -w $(SHFMT_BASE_FLAGS) $(SH_SRCFILES) +.PHONY: fmt + +fmt-check: + shfmt -d $(SHFMT_BASE_FLAGS) $(SH_SRCFILES) +.PHONY: fmt-check + +lint: + shellcheck $(SH_SRCFILES) +.PHONY: lint