-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 2.14 KB
/
Makefile
File metadata and controls
69 lines (55 loc) · 2.14 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
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
################################################################################
# DEFINES
.DEFAULT_GOAL:=help
SHELL:=/usr/bin/env bash
PROJECT_NAME:=presenting.nvim
COMMIT:=$(shell git rev-parse --short HEAD)
################################################################################
##@ Maintenance
.PHONY: all
all: update-readmes fmt lint docs pre-commit ## Runs all the targets
.PHONY: docs
docs: deps ## generates the docs.
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua require('mini.doc').generate()" -c "qa!"
.PHONY: lint
lint: deps ## run the linter.
luacheck lua/
.PHONY: fmt
fmt: deps ## run the formatter.
stylua .
.PHONY: update-readmes
update-readmes: README.org README.adoc ## Update READMEs from README.md
.PHONY: pre-commit
pre-commit: ## Run pre-commit on all
pre-commit run --all
.PHONY: test
test: deps ## Runs all tests
echo "TODO: implement tests"
# nvim --version | head -n 1 && echo ''
# nvim --headless --noplugin -u ./scripts/minimal_init.lua \
# -c "lua require('mini.test').setup()" \
# -c "lua MiniTest.run({ execute = { reporter = MiniTest.gen_reporter.stdout({ group_depth = 1 }) } })"
.PHONY: examples
examples: ## Generate animated examples
vhs presentation.tape
################################################################################
deps: ## installs `mini.nvim`, used for both the tests and documentation.
@mkdir -p deps
git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim
README.org: README.md
pandoc -f markdown -t org -o $@ $^
README.adoc: README.md
pandoc -f markdown -t asciidoc -o $@ $^
################################################################################
##@ Helpers
.PHONY: clean
clean: ## Cleanup the project folders
rm -rf deps
rm -rf docs
.PHONY: help
help: ## Display this help
@echo "Welcome to $$(tput bold)${PROJECT_NAME}$$(tput sgr0) 🥳📈🎉"
@echo ""
@echo "To get started:"
@echo " >>> $$(tput bold)make all$$(tput sgr0)"
@awk 'BEGIN {FS = ":.*##"; printf "\033[36m\033[0m"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)