Add Makefile

Signed-off-by: Sora Morimoto <sora@morimoto.io>
This commit is contained in:
Sora Morimoto
2021-01-23 10:36:33 +09:00
parent 8852866fd0
commit a76e758dfa
2 changed files with 15 additions and 1 deletions

View File

@@ -68,4 +68,4 @@ jobs:
run: brew install shfmt
- name: Run shfmt
run: shfmt -d -i 2 -ci .
run: make fmt-check

14
Makefile Normal file
View File

@@ -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