-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 1.66 KB
/
Makefile
File metadata and controls
44 lines (35 loc) · 1.66 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
SHELL := /bin/sh
PLUGIN_ROOT := $(shell pwd)
BIN_SCRIPTS := $(wildcard bin/check-* bin/validate-* bin/session-start) bin/archcore
LIB_SCRIPTS := bin/lib/normalize-stdin.sh
ALL_SCRIPTS := $(BIN_SCRIPTS) $(LIB_SCRIPTS)
JSON_FILES := .claude-plugin/plugin.json .claude-plugin/marketplace.json \
.cursor-plugin/plugin.json .cursor-plugin/marketplace.json \
hooks/hooks.json hooks/cursor.hooks.json .mcp.json
.PHONY: test lint check-json check-perms verify all
all: check-json check-perms lint test
test:
@command -v bats >/dev/null 2>&1 || { echo "bats-core not found. Install: brew install bats-core"; exit 1; }
@PLUGIN_ROOT=$(PLUGIN_ROOT) bats test/unit/ test/structure/
test-unit:
@command -v bats >/dev/null 2>&1 || { echo "bats-core not found. Install: brew install bats-core"; exit 1; }
@PLUGIN_ROOT=$(PLUGIN_ROOT) bats test/unit/
test-structure:
@command -v bats >/dev/null 2>&1 || { echo "bats-core not found. Install: brew install bats-core"; exit 1; }
@PLUGIN_ROOT=$(PLUGIN_ROOT) bats test/structure/
lint:
@command -v shellcheck >/dev/null 2>&1 || { echo "shellcheck not found, skipping"; exit 0; }
@cd $(PLUGIN_ROOT)/bin && shellcheck -s sh -x $(addprefix $(PLUGIN_ROOT)/,$(ALL_SCRIPTS))
@echo "ShellCheck: all clean"
check-json:
@fail=0; for f in $(JSON_FILES); do \
jq . < "$$f" > /dev/null 2>&1 || { echo "FAIL: $$f is not valid JSON"; fail=1; }; \
done; \
[ $$fail -eq 0 ] && echo "JSON: all valid" || exit 1
check-perms:
@fail=0; for f in $(BIN_SCRIPTS); do \
[ -x "$$f" ] || { echo "FAIL: $$f not executable"; fail=1; }; \
done; \
[ $$fail -eq 0 ] && echo "Permissions: all OK" || exit 1
verify: all
@echo "All checks passed"