aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: cdf964728f0b4b182c540b398b7b46d6ce88e1c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: check format check-luacheck check-format

LUA_FILES := $(shell find -name "*.lua" -not -path "./json.lua")

TEST_FILES := $(shell find -name "*_test.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 lf in $(LUA_FILES); do diff $$lf <(lua-format $$lf) >/dev/null; done

format:
	lua-format -i $(LUA_FILES)

test:
	for tf in $(TEST_FILES); do $$tf; done