-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
74 lines (61 loc) · 2.7 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Download lua-language-server addon for luassert and busted
.PHONY: lua-lsp-addon
lsp-addon:
@mkdir -p vendor/addons/
@if test ! -d ./vendor/luassert-addon; then git clone [email protected]:LuaCATS/luassert.git ./vendor/addons/luassert-addon/; fi
@if test ! -d ./vendor/busted-addon; then git clone [email protected]:LuaCATS/busted.git ./vendor/addons/busted-addon/; fi
.PHONY: update-lsp-addon
update-lsp-addon:
@cd ./vendor/addons/luassert-addon && git pull && cd ../..
@cd ./vendor/addons/busted-addon && git pull && cd ../..
.PHONY: ensure-test-deps
ensure-test-deps:
@mkdir -p vendor
@if test ! -d ./vendor/plenary.nvim; then git clone [email protected]:nvim-lua/plenary.nvim.git ./vendor/plenary.nvim/; fi
@if test ! -d ./vendor/luassert; then git clone [email protected]:Olivine-Labs/luassert.git ./vendor/luassert/; fi
@if test ! -d ./vendor/sqlite; then git clone [email protected]:kkharji/sqlite.lua.git ./vendor/sqlite/; fi
.PHONY: update-test-deps
update-test-deps: ensure-test-deps
@cd ./vendor/plenary.nvim/ && git pull && cd ..
@cd ./vendor/luassert/ && git pull && cd ..
@cd ./vendor/sqlite/ && git pull && cd ..
.PHONY: ensure-doc-deps
ensure-doc-deps:
@mkdir -p vendor
@if test ! -d ./vendor/ts-vimdoc.nvim; then git clone [email protected]:ibhagwan/ts-vimdoc.nvim.git ./vendor/ts-vimdoc.nvim/; fi
@if test ! -d ./vendor/nvim-treesitter; then git clone [email protected]:nvim-treesitter/nvim-treesitter.git ./vendor/nvim-treesitter/; fi
.PHONY: update-doc-deps
update-doc-deps: ensure-doc-deps
@echo "Updating ts-vimdoc.nvim..."
@cd ./vendor/ts-vimdoc.nvim/ && git pull && cd ..
@echo "updating nvim-treesitter..."
@cd ./vendor/nvim-treesitter/ && git pull && cd ..
.PHONY: gen-vimdoc
gen-vimdoc: update-doc-deps
@echo 'Installing Treesitter parsers...'
@nvim --headless -u ./vimdocrc.lua -c 'TSUpdateSync markdown' -c 'TSUpdateSync markdown_inline' -c 'qa'
@echo 'Generating vimdocs...'
@nvim --headless -u ./vimdocrc.lua -c 'luafile ./vimdoc-gen.lua' -c 'qa'
@nvim --headless -u ./vimdocrc.lua -c 'helptags doc' -c 'qa'
.PHONY: test
test: ensure-test-deps
nvim --headless --noplugin -u tests/testrc.lua -c "PlenaryBustedDirectory tests/ { minimal_init = 'tests/testrc.lua' }"
.PHONY: check-luacheck
check-luacheck:
@echo "Running \`luacheck\`..."
@luacheck lua/legendary/ tests/
@echo ""
.PHONY: check-stylua # stylua gets run through a separate GitHub Action in CI
check-stylua:
@if test -z "$$CI"; then echo "Running \`stylua\`..." && stylua lua/ && stylua tests/ && echo "No stylua errors found."; fi
.PHONY: check
check: check-luacheck check-stylua
.PHONY: api-docs
api-docs:
./gen-api-docs.bash
.PHONY: gen-api-docs-ci
gen-api-docs-ci:
./gen-api-docs.bash ci
.PHONY: init
init:
git config core.hooksPath .githooks