-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (45 loc) · 1.13 KB
/
Makefile
File metadata and controls
52 lines (45 loc) · 1.13 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
LUA_VERSION = 5.1
DEPS_DIR = deps
TEST_DIR = tests
ROCKSPEC = $(shell ls copy_with_context-*.rockspec | head -1)
BUSTED = $(DEPS_DIR)/bin/busted
LUACHECK = $(DEPS_DIR)/bin/luacheck
.PHONY: install-stylua
install-stylua:
@echo "Installing stylua..."
@if ! command -v stylua > /dev/null; then \
cargo install stylua; \
echo "stylua installed."; \
else \
echo "stylua already installed."; \
fi
.PHONY: deps
deps:
@echo "Installing dependencies from rockspec..."
@luarocks --tree=$(DEPS_DIR) make $(ROCKSPEC)
@echo "Installing dev dependencies..."
@luarocks --tree=$(DEPS_DIR) install busted
@luarocks --tree=$(DEPS_DIR) install luacheck
@echo "Dependencies installed."
.PHONY: test
test: deps
@echo "Running tests..."
@$(BUSTED) $(TEST_DIR)
.PHONY: fmt
fmt:
@echo "Formatting Lua files with stylua..."
@stylua lua tests plugin
.PHONY: fmt
fmt-check:
@echo "Checking Lua files with stylua..."
@stylua --check lua tests plugin
.PHONY: lint
lint:
@echo "Linting Lua files with luacheck..."
@$(LUACHECK) lua tests plugin
# Clean generated files
.PHONY: clean
clean:
@echo "Cleaning up..."
@rm -rf $(DEPS_DIR)
@echo "Cleanup complete."