-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 1.27 KB
/
Makefile
File metadata and controls
38 lines (29 loc) · 1.27 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
MINIMAL_INIT=tests/minimal_init.lua
TESTS_DIR=tests
NO_UTIL_SPEC=checks
.PHONY: test fmt check-fmt
test: ## Run the whole test suite
@nvim \
--headless \
--noplugin \
-u ${MINIMAL_INIT} \
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${MINIMAL_INIT}' }"
test-watch: ## Watching for changes to lua files
@nodemon -e lua -x "$(MAKE) test || exit 1"
check: ## Run luacheck on the project (lua type checker)
@luacheck . --globals vim it describe before_each after_each --exclude-files tests/fixtures --max-comment-line-length 140
no-utils: ## Make sure there are no errant utils hanging around
@nvim \
--headless \
--noplugin \
-u ${MINIMAL_INIT} \
-c "PlenaryBustedDirectory ${NO_UTIL_SPEC} { minimal_init = '${MINIMAL_INIT}' }"
pass: test no-utils check check-fmt ## Run everything, if it's a 0 code, everything's good
fmt: ## Run stylua on the project (lua code style linter), including automatic changes
stylua lua/
check-fmt: ## Check stylua on the project, only emitting errors, not modifying project at all
stylua --check lua/
help: ## Displays this information.
@printf '%s\n' "Usage: make <command>"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@printf '\n'