branch: externals/ellama
commit 2f08729a434c32a6a1caf47a0ccf6789da60bdb8
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Add format-elisp target
Added a new make target to format all Elisp files in the project and test
directory using Emacs. Updated the AGENTS.md documentation to include the
new
format-elisp step.
---
AGENTS.md | 3 ++-
Makefile | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
index 52e0a17524..40a8c6136e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -5,7 +5,8 @@
1. **Build**: `make build`
2. **Run unit tests** (ERT): `make test`
3. **Check native compilation warnings**: `make check-compile-warnings`
-4. **Export manual**: `make manual`
+4. **Format Elisp files**: `make format-elisp`
+5. **Export manual**: `make manual`
## Code Style Guidelines
diff --git a/Makefile b/Makefile
index 0d799e2f2e..13f03f9efa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Makefile for ellama project
-.PHONY: build test check-compile-warnings manual refill-news
+.PHONY: build test check-compile-warnings manual format-elisp refill-news
# This order is based on the packages dependency graph.
ELLAMA_COMPILE_ORDER = \
@@ -38,5 +38,8 @@ manual:
-l ellama-manual.el \
--eval "(ellama-manual-export)"
+format-elisp:
+ emacs -batch --eval "(let ((files (append (file-expand-wildcards
\"ellama*.el\") (file-expand-wildcards \"tests/*.el\")))) (package-initialize)
(require 'transient) (dolist (file files) (with-current-buffer
(find-file-noselect file) (emacs-lisp-mode) (indent-region (point-min)
(point-max)) (untabify (point-min) (point-max)) (delete-trailing-whitespace)
(save-buffer))))"
+
refill-news:
emacs -batch --eval "(with-current-buffer (find-file-noselect
\"./NEWS.org\") (setq fill-column 80) (fill-region (point-min) (point-max))
(save-buffer))"