From 92cff24d4a19f2d37eb8e2525b23b92d78b1eee0 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 20 Mar 2021 12:31:21 +0100 Subject: add Makefile and lua-format style definition --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c43eeda --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: check format check-luacheck check-format + +LUA_FILES = $(wildcard *.lua) + +# bash's process substitution is used for check-format +SHELL := /bin/bash + +check: check-luacheck check-format + +check-luacheck: + luacheck --globals=vis -- $(LUA_FILES) + +check-format: + for f in $(LUA_FILES); do diff $$f <(lua-format $$f) >/dev/null; done + +format: + lua-format -i $(LUA_FILES) -- cgit