-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.27 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
# Makefile for a Neovim plugin.
# Variables
NAME = genie
NVIM = nvim
TEST_DIR = ./test
PLUGINS_DIR = ./test/plenary
MODEL = gpt-4-1106-preview
PROMPT = "\
INSTRUCTION:\
Convert the above vim plugin help file to direct *raw* markdown.\
Do not generate a table of contents.\
Have an empty line after markdown headers.\
Only generate the raw markdown, not any enclosure or commentary.\
"
-include .env
all: test/.last README.md
.PHONY: all test manual helptags continous helpdoc
# Test target
test: test/.last
test/.last: test/*.lua test/plenary/* lua/$(NAME)/* Makefile
@$(NVIM) \
--headless \
-c "PlenaryBustedDirectory $(TEST_DIR)/ {minimal_init = '$(PLUGINS_DIR)/minimal_init.vim'}" \
-c "qa!"
@touch test/.last
manual:
@$(NVIM) \
-c "PlenaryBustedDirectory $(TEST_DIR)/ {minimal_init = '$(PLUGINS_DIR)/minimal_init.vim'}"
continuous:
@while true; do make -s; sleep 2; done
helptags:
@$(NVIM) \
--headless \
-c "helptags doc" \
-c "qa!"
# doc/$(NAME).txt: lua/$(NAME)/init.lua lua test/$(NAME)_spec.lua lua
# Not depenency checking because we don't want it automated
helpdoc:
@doc/gendoc.sh "$(NAME)"
README.md: doc/$(NAME).txt Makefile
@openai api chat.completions.create -m "$(MODEL)" \
-g user "`cat doc/$(NAME).txt` `echo $(PROMPT)`" \
> README.md