branch: elpa/aidermacs commit cdf6098f7739f6554171d681e7f3caeaa2ed948c Author: Mingde (Matthew) Zeng <matthew...@posteo.net> Commit: Mingde (Matthew) Zeng <matthew...@posteo.net>
Fix linting Signed-off-by: Mingde (Matthew) Zeng <matthew...@posteo.net> --- Makefile | 30 ++++-------------------------- aidermacs-backend-comint.el | 2 ++ aidermacs-backends.el | 14 +++++++------- aidermacs-models.el | 2 ++ 4 files changed, 15 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index a4f7793d27..9300c54bef 100644 --- a/Makefile +++ b/Makefile @@ -3,31 +3,9 @@ EMACS ?= emacs BATCH = $(EMACS) -Q -batch -.PHONY: test compile clean +.PHONY: test # Main test target -test: compile lint-checkdoc - -# Compile all .el files to check for byte-compilation errors -compile: - @echo "Compiling Elisp files..." - $(BATCH) -L . --eval "(setq byte-compile-error-on-warn t)" \ - -f batch-byte-compile *.el - -# Run checkdoc to verify documentation standards -lint-checkdoc: - @echo "Running checkdoc..." - $(BATCH) --eval "(require 'checkdoc)" \ - --eval "(setq checkdoc-arguments-in-order-flag nil)" \ - --eval "(setq checkdoc-verb-check-experimental-flag nil)" \ - --eval "(setq sentence-end-double-space nil)" \ - --eval "(checkdoc-file \"aidermacs.el\")" \ - --eval "(checkdoc-file \"aidermacs-backends.el\")" \ - --eval "(checkdoc-file \"aidermacs-backend-comint.el\")" \ - --eval "(checkdoc-file \"aidermacs-backend-vterm.el\")" \ - --eval "(checkdoc-file \"aidermacs-models.el\")" - -# Clean compiled files -clean: - @echo "Cleaning compiled files..." - rm -f *.elc +test: + @echo "Testing aidermacs..." + $(BATCH) -L . --eval "(require 'aidermacs)" diff --git a/aidermacs-backend-comint.el b/aidermacs-backend-comint.el index d891d04e7f..3c4a347f30 100644 --- a/aidermacs-backend-comint.el +++ b/aidermacs-backend-comint.el @@ -24,6 +24,8 @@ ;;; Code: (require 'comint) +(require 'cl-seq) +(require 'map) ;; Forward declarations (declare-function aidermacs--prepare-for-code-edit "aidermacs") diff --git a/aidermacs-backends.el b/aidermacs-backends.el index 9f37f4da0d..7087441507 100644 --- a/aidermacs-backends.el +++ b/aidermacs-backends.el @@ -97,34 +97,34 @@ This is used to avoid having to run /ls repeatedly.") (cond ;; Applied edit to <filename> ((string-match "Applied edit to \\(\\./\\)?\\(.+\\)" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (add-to-list 'aidermacs--tracked-files file))) ;; Added <filename> to the chat. ((string-match "Added \\(\\./\\)?\\(.+\\) to the chat" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (add-to-list 'aidermacs--tracked-files file))) ;; Removed <filename> from the chat (with or without ./ prefix) ((string-match "Removed \\(\\./\\)?\\(.+\\) from the chat" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (setq aidermacs--tracked-files (delete file aidermacs--tracked-files)))) ;; Added <filename> to read-only files. ((string-match "Added \\(\\./\\)?\\(.+\\) to read-only files" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (add-to-list 'aidermacs--tracked-files (concat file " (read-only)")))) ;; Moved <file> from editable to read-only files in the chat ((string-match "Moved \\(\\./\\)?\\(.+\\) from editable to read-only files in the chat" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (let ((editable-file (replace-regexp-in-string " (read-only)$" "" file))) (setq aidermacs--tracked-files (delete editable-file aidermacs--tracked-files)) (add-to-list 'aidermacs--tracked-files (concat file " (read-only)"))))) ;; Moved <file> from read-only to editable files in the chat ((string-match "Moved \\(\\./\\)?\\(.+\\) from read-only to editable files in the chat" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (let ((read-only-file (concat file " (read-only)"))) (setq aidermacs--tracked-files (delete read-only-file aidermacs--tracked-files)) (add-to-list 'aidermacs--tracked-files file)))) @@ -136,7 +136,7 @@ This is used to avoid having to run /ls repeatedly.") ;; <file> is already in the chat as an editable file ((string-match "\\(\\./\\)?\\(.+\\) is already in the chat as an editable file" line) - (when-let ((file (match-string 2 line))) + (when-let* ((file (match-string 2 line))) (add-to-list 'aidermacs--tracked-files file))) ;; Handle udiff format diff --git a/aidermacs-models.el b/aidermacs-models.el index 60f4db8305..a48157424a 100644 --- a/aidermacs-models.el +++ b/aidermacs-models.el @@ -32,6 +32,8 @@ (declare-function aidermacs-buffer-name "aidermacs" ()) (declare-function aidermacs-exit "aidermacs" ()) +(defvar aidermacs--current-output) + (defgroup aidermacs-models nil "Model selection for Aidermacs." :group 'aidermacs)