From ba22e0cc3c81d85b3ee8aaa337d6a388627c3af2 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 05:11:55 -0500 Subject: test: cover wttrin-debug.el and expand lint to all source files I added 24 unit tests across six new files for wttrin-debug.el. They cover enable/disable, the debug-log writer, clear-log, show-log, and the mode-line diagnostic dump. That lifts wttrin-debug.el coverage from 27% to 95%, and overall coverage from 84% to 94%. Each function gets Normal / Boundary / Error categories where applicable. Globals like `wttrin-debug` and `wttrin--debug-log` are isolated per test with let-bindings. The dynamic-scope rebinding restores state cleanly at exit. I expanded the `lint` target to run on all three source files instead of just `wttrin.el`. Checkdoc and elisp-lint run on every file. Package-lint stays scoped to `wttrin.el` because the others aren't standalone packages. The tricky bit: `elisp-lint-file` re-runs package-lint internally as one of its validators. So the explicit guard alone wasn't enough. The fix binds `elisp-lint-ignored-validators` to include "package-lint" for the secondaries, which suppresses the re-run at the validator level. I also added `*-autoloads.el` to .gitignore. Eask generates `emacs-wttrin-autoloads.el` during install, and it shouldn't be tracked. I skipped one function: `wttrin--debug-mode-line-info` is a one-line dispatcher to `debug-wttrin-mode-line`. Testing it would assert the dispatch happened, which only tests Emacs. --- Makefile | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 846fdb5..f80a494 100644 --- a/Makefile +++ b/Makefile @@ -280,22 +280,29 @@ compile: @echo "[v] Compilation complete" lint: - @echo "Running linters on $(MAIN_FILE)..." - @$(EASK_EMACS) \ - --eval "(progn \ - (require 'checkdoc nil t) \ - (require 'package-lint nil t) \ - (require 'elisp-lint nil t) \ - (find-file \"$(MAIN_FILE)\") \ - (when (featurep 'checkdoc) \ - (message \"-- checkdoc --\") \ - (checkdoc-current-buffer t)) \ - (when (featurep 'package-lint) \ - (message \"-- package-lint --\") \ - (package-lint-current-buffer)) \ - (when (featurep 'elisp-lint) \ - (message \"-- elisp-lint --\") \ - (elisp-lint-file \"$(MAIN_FILE)\")))" || true + @echo "Running linters on source files..." + @for src in $(SOURCE_FILES); do \ + echo " Linting $$src..."; \ + $(EASK_EMACS) \ + --eval "(let ((src \"$$src\") (main \"$(MAIN_FILE)\")) \ + (require 'checkdoc nil t) \ + (require 'package-lint nil t) \ + (require 'elisp-lint nil t) \ + (find-file src) \ + (when (featurep 'checkdoc) \ + (message \"-- checkdoc on %s --\" src) \ + (checkdoc-current-buffer t)) \ + (when (and (featurep 'package-lint) (string= src main)) \ + (message \"-- package-lint on %s --\" src) \ + (package-lint-current-buffer)) \ + (when (featurep 'elisp-lint) \ + (message \"-- elisp-lint on %s --\" src) \ + (let ((elisp-lint-ignored-validators \ + (if (string= src main) \ + elisp-lint-ignored-validators \ + (cons \"package-lint\" elisp-lint-ignored-validators)))) \ + (elisp-lint-file src))))" || true; \ + done @echo "[i] Lint complete (informational)" # ============================================================================ -- cgit v1.2.3