-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (44 loc) · 2.09 KB
/
Copy pathMakefile
File metadata and controls
56 lines (44 loc) · 2.09 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
SHELL := /usr/bin/env bash
ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
STYLUAC := $(ROOT)/.stylua.toml
SELENEC := $(ROOT)/selene.toml
.PHONY: all check format format-check lint test benchmark contrib contrib-verify install-hooks help
all: format lint contrib
check: format-check lint test contrib-verify
test:
@cache_dir="$$(mktemp -d)"; trap 'rm -rf "$$cache_dir"' EXIT; \
cd "$(ROOT)" && XDG_CACHE_HOME="$$cache_dir" nvim --headless -u NONE -l "tests/headless.lua"
benchmark:
@cache_dir="$$(mktemp -d)"; trap 'rm -rf "$$cache_dir"' EXIT; \
cd "$(ROOT)" && XDG_CACHE_HOME="$$cache_dir" nvim --headless -u NONE -l "tests/benchmark.lua"
# Install git hooks
install-hooks:
@git -C "$(ROOT)" config core.hooksPath .githooks
# Format all Lua files according to .stylua.toml
format:
@stylua --config-path "$(STYLUAC)" "$(ROOT)"
# Check Lua formatting without changing files
format-check:
@stylua --check --config-path "$(STYLUAC)" "$(ROOT)"
# Lint Lua files (scripts/ excluded: plain LuaJIT, no vim globals)
lint:
@selene --config "$(SELENEC)" "$(ROOT)/lua" "$(ROOT)/colors" "$(ROOT)/plugin"
# Generate contrib/ theme files for external tools
contrib:
@cd "$(ROOT)" && luajit scripts/gen_contrib.lua
# Verify contrib/ files are up to date
contrib-verify:
@cd "$(ROOT)" && luajit scripts/gen_contrib.lua --verify
# Display available targets
help:
@echo "Available targets:"
@echo " all - Format, lint, and generate contrib files"
@echo " check - Check formatting, lint, tests, and contrib files"
@echo " format - Format Lua files with stylua"
@echo " format-check - Check Lua formatting with stylua"
@echo " lint - Lint Lua files with selene"
@echo " test - Run dependency-free headless runtime and generator tests"
@echo " benchmark - Report dynamic and compiled reload medians, group counts, and cache sizes"
@echo " contrib - Generate contrib/ theme files"
@echo " contrib-verify - Check contrib/ files are up to date"
@echo " install-hooks - Enable git pre-commit hook"