Skip to content

Commit c12a16c

Browse files
committed
Snazz up the build code a little bit
* Add help target - woot * Rename make check to make pass - It was originally this way and it was better. I immediately regretted changing it. * Rename make typecheck to make check - yeah hopefully not too confusing. Probably nobody uses this but me anyways.
1 parent 38733b8 commit c12a16c

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
mv nvim-treesitter $HOME/.local/share/nvim/lazy/
3232
nvim --headless --noplugin -u tests/minimal_init.lua -c "TSInstall! python rust haskell" -c "quit"
3333
34-
- name: Run luacheck type check
34+
- name: Run luacheck type check / linter
3535
run: |
3636
sudo apt-get install lua-check -y --no-install-recommends
37-
make typecheck
37+
make check
3838
3939
- name: Check for errant util calls
4040
run: make no-utils

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Thank you for contributing to Treewalker!
1010
## Things to know
1111

1212
* See the Makefile for tasks
13-
* `make check` will run everything you need to be sure things are healthy
13+
* `make pass` will run everything you need to be sure things are healthy
1414
* in your lazy config, set dir = "<the plugin's dir>"
1515
* use util.R in init.lua for the plugin to hot reload in your current dev environment
1616
* use `util.log` to print to the fs, and `tail -f ~/.local/share/nvim/treewalker/debug.log` to read from it

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@ MINIMAL_INIT=tests/minimal_init.lua
22
TESTS_DIR=tests
33
NO_UTIL_SPEC=checks
44

5-
test:
5+
.PHONY: test
6+
7+
test: ## Run the whole test suite
68
@nvim \
79
--headless \
810
--noplugin \
911
-u ${MINIMAL_INIT} \
1012
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${MINIMAL_INIT}' }"
1113

12-
test-watch:
14+
test-watch: ## Watching for changes to lua files
1315
nodemon -e lua -x "$(MAKE) test || exit 1"
1416

15-
typecheck:
16-
luacheck . --globals vim it describe before_each --exclude-files tests/fixtures --max-comment-line-length 140
17+
check: ## Run luacheck on the project
18+
luacheck . --globals vim it describe before_each after_each --exclude-files tests/fixtures --max-comment-line-length 140
1719

18-
no-utils:
20+
no-utils: ## Make sure there are no errant utils hanging around
1921
@nvim \
2022
--headless \
2123
--noplugin \
2224
-u ${MINIMAL_INIT} \
2325
-c "PlenaryBustedDirectory ${NO_UTIL_SPEC} { minimal_init = '${MINIMAL_INIT}' }"
2426

25-
# Run this to be sure all's well
26-
check: test typecheck no-utils
27+
pass: test no-utils check ## Run everything, if it's a 0 code, everything's good
28+
29+
help: ## Displays this information.
30+
@printf '%s\n' "Usage: make <command>"
31+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
32+
@printf '\n'
33+

0 commit comments

Comments
 (0)