-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (34 loc) · 1.04 KB
/
Makefile
File metadata and controls
41 lines (34 loc) · 1.04 KB
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
HELP_FILE := ./doc/pin.txt
CMD_NVIM := nvim --headless --noplugin
ECHASNOVSKI_GH_BASE_URL := https://raw.githubusercontent.com/echasnovski
CMD_MINI_DOC_GENERATE := @$(CMD_NVIM) -u ./scripts/testdocs_init.lua && echo ''
MINI_DOC_GIT_HASH := 28d1d8172a463460131c3ae929498abe78937382
STYLUA_VERSION := $(shell grep stylua .tool-versions | awk '{ print $$2 }')
STYLUA := $(HOME)/.asdf/installs/stylua/$(STYLUA_VERSION)/bin/stylua
# Check formatting.
.PHONY: testmft
testfmt: $(STYLUA)
stylua --check lua/ scripts/
# Check docs are up to date.
.PHONY: testdocs
testdocs: deps/lua/doc.lua
git checkout $(HELP_FILE)
@$(CMD_MINI_DOC_GENERATE)
git diff --exit-code $(HELP_FILE)
# Run CI tests.
.PHONY: testci
testci: testfmt testdocs
# Format.
.PHONY: fmt
fmt: $(STYLUA)
stylua lua/bufpin/init.lua scripts/
# Update docs.
.PHONY: docs
docs: deps/lua/doc.lua
$(CMD_MINI_DOC_GENERATE)
deps/lua/doc.lua:
@mkdir -p deps/lua
curl $(ECHASNOVSKI_GH_BASE_URL)/mini.doc/$(MINI_DOC_GIT_HASH)/lua/mini/doc.lua -o $@
$(STYLUA):
asdf plugin add stylua
asdf install stylua