aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 17 insertions, 0 deletions
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)