-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (25 loc) · 1003 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
set_lua_paths = eval $$(luarocks path --lua-version 5.1 --bin)
busted = $$(find /usr/local/lib/luarocks/*/busted/* -name busted)
set_luals_path = PATH="$$PATH:/home/yaro/.local/share/nvim/mason/bin/lua-language-server"
test_unit = busted --run=unit
test_nvim = nvim --headless -i NONE -n -u spec/minimal_init.lua -l $(busted) --run=unit
tag ?= wip
watch = '*.lua'
.PHONY: api_documentation luacheck stylua test
all: test luacheck stylua
api_documentation:
nvim -u scripts/make_api_documentation/init.lua -l scripts/make_api_documentation/main.lua
llscheck:
@$(set_luals_path) && llscheck --configpath .luarc.json .
luacheck:
luacheck lua spec scripts
stylua:
stylua --check lua scripts spec
test:
@$(set_lua_paths); $(test_unit)
watch:
@$(set_lua_paths); while sleep 0.1; do find . -name $(watch) | entr -d -c $(test_unit); done
watch_tag:
@$(set_lua_paths); while sleep 0.1; do find . -name $(watch) | entr -d -c $(test_unit) --tags=$(tag); done
test_nvim:
@$(test_nvim) spec/unit