-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (45 loc) · 3.01 KB
/
Makefile
File metadata and controls
62 lines (45 loc) · 3.01 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
60
61
62
# Makefile for enkan-repl
EMACS ?= emacs
BATCH = $(EMACS) --batch -Q
.PHONY: help test test-docs test-all compile checkdoc lint check clean install-deps format docs extract-api generate-template
help: ## Show this help message
@echo "enkan-repl Quality Check Commands"
@echo "========================================"
@echo ""
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Setup (run once):"
@echo " make install-deps"
@echo ""
@echo "Quick start:"
@echo " make install-deps && make check"
install-deps: ## Install required dependencies (package-lint)
$(BATCH) --eval "(progn (require 'package) (add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\")) (package-refresh-contents) (package-install 'package-lint))"
test: ## Run ERT tests
$(BATCH) --eval "(add-to-list 'load-path \".\")" -l scripts/load-all-tests.el
test-docs: ## Run generate-docs tests
$(BATCH) --eval "(add-to-list 'load-path \".\")" -l scripts/load-all-tests.el
test-all: test test-docs ## Run all tests (core package and development tools)
compile: ## Byte compile with warnings as errors
$(BATCH) --eval "(setq byte-compile-error-on-warn t)" --eval "(byte-compile-file \"enkan-repl.el\")"
checkdoc: ## Check documentation format
$(BATCH) --eval "(checkdoc-file \"enkan-repl.el\")"
lint: ## Run package-lint checks
$(BATCH) --eval "(progn (package-initialize) (require 'package-lint) (with-temp-buffer (insert-file-contents \"enkan-repl.el\") (emacs-lisp-mode) (package-lint-current-buffer)))"
format: ## Auto-format elisp files using built-in indent-region (spaces only)
$(BATCH) --eval "(progn (find-file \"enkan-repl.el\") (setq-local indent-tabs-mode nil) (untabify (point-min) (point-max)) (mark-whole-buffer) (indent-region (point-min) (point-max)) (save-buffer))"
$(BATCH) --eval "(progn (find-file \"test/enkan-repl-test.el\") (setq-local indent-tabs-mode nil) (untabify (point-min) (point-max)) (mark-whole-buffer) (indent-region (point-min) (point-max)) (save-buffer))"
check: test compile checkdoc lint format clean ## Run all quality checks including formatting
check-ci: test compile checkdoc format clean ## Run quality checks for CI (without package-lint)
clean: ## Remove compiled files
find . -path ./.git -prune -o -name '*.elc' -type f -exec rm -f {} +
extract-api: ## Extract public API documentation as org file
$(BATCH) -l scripts/generate-docs.el --eval "(extract-public-api)"
generate-template: ## Generate default template file
$(BATCH) -l scripts/generate-docs.el --eval "(generate-default-template)"
generate-constants: ## Generate precompiled constants for cheat-sheet performance
$(BATCH) -l scripts/generate-constants.el --eval "(generate-cheat-sheet-constants)"
docs: ## Generate all documentation files (constants first, then docs)
$(BATCH) -l scripts/generate-constants.el --eval "(generate-cheat-sheet-constants)"
$(BATCH) -l scripts/generate-docs.el --eval "(generate-all-docs)"