-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (49 loc) · 1.81 KB
/
Makefile
File metadata and controls
56 lines (49 loc) · 1.81 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
.PHONY: lint lint-fix hooks setup test test-coverage deps
# Install dependencies
deps:
@echo "Installing development dependencies..."
@command -v luarocks >/dev/null 2>&1 || { echo >&2 "luarocks not found. Please install Lua and LuaRocks first."; exit 1; }
@echo "Installing luacheck..."
@luarocks install luacheck
@echo "Installing busted testing framework..."
@luarocks install busted
@echo "Installing luacov for code coverage..."
@luarocks install luacov
@luarocks install luacov-reporter-lcov
@echo "Dependencies installed successfully."
@asdf reshim lua 2>/dev/null || true
# Run luacheck for linting
lint:
@echo "Running luacheck..."
@command -v luacheck >/dev/null 2>&1 || { echo >&2 "luacheck not found. Install with 'make deps'"; exit 1; }
@luacheck lua/
# Run stylua for formatting if available
lint-fix:
@echo "Running stylua (if available)..."
@if command -v stylua >/dev/null 2>&1; then \
stylua lua/; \
else \
echo "stylua not found. Install with 'cargo install stylua'"; \
fi
# Install git hooks
hooks:
@echo "Installing git hooks..."
@mkdir -p .git/hooks
@cp -f scripts/pre-commit .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Git hooks installed successfully"
# Run tests
test:
@echo "Running tests..."
@command -v busted >/dev/null 2>&1 || { echo >&2 "busted not found. Install with 'make deps'"; exit 1; }
@./scripts/run-tests.sh -v
# Run tests with coverage
test-coverage:
@echo "Running tests with coverage..."
@command -v busted >/dev/null 2>&1 || { echo >&2 "busted not found. Install with 'make deps'"; exit 1; }
@command -v luacov >/dev/null 2>&1 || { echo >&2 "luacov not found. Install with 'make deps'"; exit 1; }
@./scripts/run-tests.sh -c && luacov
# Setup development environment
setup: hooks deps
@echo "Setting up development environment..."
@echo "Setup complete"