-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 2.43 KB
/
Copy pathMakefile
File metadata and controls
59 lines (47 loc) · 2.43 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
57
58
59
DETECT_SECRETS_SPEC := git+https://github.com/ibm/detect-secrets.git@076672a9a01abdfc7ecee2e7d14f08cdccb73976
PLUGIN_DIR := $(firstword $(wildcard plugins/python/$(PLUGIN) plugins/rust/python-package/$(PLUGIN)))
.PHONY: help plugins-list plugins-validate plugin-test plugin-mutants plugin-mutants-list plugin-scaffold plugin-scaffold-help detect-secrets-scan detect-secrets-audit detect-secrets-check
help:
@printf "plugins-list\nplugins-validate\nplugin-test PLUGIN=<slug>\nplugin-mutants PLUGIN=<slug>\nplugin-mutants-list PLUGIN=<slug>\nplugin-scaffold\nplugin-scaffold-help\ndetect-secrets-scan\ndetect-secrets-audit\ndetect-secrets-check\n"
plugins-list:
@python3 tools/plugin_catalog.py list .
plugins-validate:
@python3 tools/plugin_catalog.py validate .
@python3 -m unittest tests/test_plugin_catalog.py tests/test_install_built_wheel.py
detect-secrets-scan: ## Regenerate secrets baseline
@uv tool run $(DETECT_SECRETS_SPEC) scan \
--update .secrets.baseline \
--use-all-plugins
detect-secrets-audit: ## Audit secrets baseline interactively
@test -f .secrets.baseline || (echo "Run make detect-secrets-scan first" && exit 1)
@uv tool run $(DETECT_SECRETS_SPEC) audit .secrets.baseline
detect-secrets-check: ## Verify no unaudited secrets (CI equivalent)
@pre-commit run detect-secrets --all-files
plugin-test:
@test -n "$(PLUGIN)" || (echo "Set PLUGIN=<slug>" && exit 1)
@case "$(PLUGIN)" in (*[!a-z0-9_]*|'') echo "Unknown plugin $(PLUGIN)"; exit 1;; esac
@test -n "$(PLUGIN_DIR)" || (echo "Unknown plugin $(PLUGIN)" && exit 1)
@cd $(PLUGIN_DIR) && make sync && make ci
plugin-mutants:
@test -n "$(PLUGIN)" || (echo "Set PLUGIN=<slug>" && exit 1)
cargo mutants -p "$(PLUGIN)"
plugin-mutants-list:
@test -n "$(PLUGIN)" || (echo "Set PLUGIN=<slug>" && exit 1)
cargo mutants --list -p "$(PLUGIN)"
plugin-scaffold:
@python3 -m pip install --quiet jinja2 2>/dev/null || pip install --quiet jinja2 2>/dev/null || true
@python3 tools/scaffold_plugin.py
plugin-scaffold-help:
@echo "Usage: make plugin-scaffold"
@echo ""
@echo "Interactively scaffold a new CPEX plugin with:"
@echo " - Rust + Python (PyO3/maturin) structure"
@echo " - Standard Makefile targets"
@echo " - Test scaffolding"
@echo " - Optional benchmark setup"
@echo ""
@echo "Non-interactive mode:"
@echo " python3 tools/scaffold_plugin.py --non-interactive --name my_plugin"
@echo ""
@echo "For more options:"
@echo " python3 tools/scaffold_plugin.py --help"