Skip to content

Commit 5d73106

Browse files
committed
Run package-lint, checkdoc, and docquotes in CI
The Makefile's lint target chains byte-compile, package-lint, checkdoc, and docquotes, but CI was only invoking byte-compile. Lint regressions landed only when running 'make all' locally. Adds a single lint job (Emacs 29.4) that installs package-lint from NonGNU ELPA and runs the three remaining sub-targets directly. The existing matrix byte-compile job is unchanged. evil-ghostel's Package-Requires lists "(ghostel "0.8.0")" but ghostel isn't on any ELPA, so package-install-file lisp/ghostel.el seeds package-alist before lint runs — package-lint accepts either package-archive-contents or package-alist membership.
1 parent 8e3135f commit 5d73106

3 files changed

Lines changed: 51 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,30 @@ jobs:
2929
lisp/ghostel.el lisp/ghostel-compile.el \
3030
lisp/ghostel-debug.el lisp/ghostel-eshell.el
3131
32+
lint:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: purcell/setup-emacs@master
37+
with:
38+
version: '29.4'
39+
40+
- name: Install lint deps
41+
# `package-lint' resolves cross-package deps via
42+
# `package-archive-contents' and `package-alist'. Installing
43+
# ghostel from the local checkout adds it to `package-alist' so
44+
# evil-ghostel's `(ghostel "0.8.0")' Package-Require resolves —
45+
# ghostel itself isn't on any ELPA.
46+
run: |
47+
emacs --batch -Q \
48+
--eval "(package-initialize)" \
49+
--eval "(package-refresh-contents)" \
50+
--eval "(package-install 'package-lint)" \
51+
--eval "(package-install-file (expand-file-name \"lisp/ghostel.el\"))"
52+
53+
- name: Run package-lint, checkdoc, docquotes
54+
run: make package-lint checkdoc docquotes
55+
3256
test:
3357
runs-on: ubuntu-latest
3458
strategy:

lisp/ghostel.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@ stripped so the copied text matches the original terminal content."
18481848
"Keymap for clickable hyperlinks in ghostel buffers.")
18491849

18501850
(defun ghostel--native-link-help-echo (window _ pos)
1851-
"help-echo handler for OSC8 hyperlinks. Retrieves native URI from libghostty."
1851+
"Return the native OSC8 URI for the link at POS in WINDOW.
1852+
Used as the `help-echo' handler for OSC8 hyperlinks; retrieves the
1853+
URI from libghostty."
18521854
(with-current-buffer (window-buffer window)
18531855
(ghostel--native-uri-at-pos pos)))
18541856

test/ghostel-test.el

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
;;; Commentary:
44

5-
;; Run with:
6-
;; `emacs --batch -Q -L lisp -l ert -l test/ghostel-test.el -f ghostel-test-run'
7-
;;
8-
;; Pure Elisp tests only (no native module):
9-
;; `emacs --batch -Q -L lisp -l ert -l test/ghostel-test.el -f ghostel-test-run-elisp'
5+
;; Run via `make test' (pure Elisp, no native module required) or
6+
;; `make test-native' (requires the built native module). See the
7+
;; Makefile for the underlying Emacs invocation.
108

119
;;; Code:
1210

@@ -556,11 +554,11 @@ scrolling libghostty's viewport."
556554
(kill-buffer buf))))
557555

558556
(ert-deftest ghostel-test-scrollback-eviction-chunked ()
559-
"Scrollback eviction works when writing happens in little chunks with
560-
renders in between. Writes a small batch, renders, then writes a large
561-
batch across many small writes interspersed with renders. The accumulated
562-
scrollback from the second phase must evict the first phase from the
563-
Emacs buffer."
557+
"Scrollback eviction works for chunked writes with interleaved renders.
558+
Writes a small batch, renders, then writes a large batch across many
559+
small writes interspersed with renders. The accumulated scrollback
560+
from the second phase must evict the first phase from the Emacs
561+
buffer."
564562
(let ((buf (generate-new-buffer " *ghostel-test-sb-evict*")))
565563
(unwind-protect
566564
(with-current-buffer buf
@@ -581,11 +579,10 @@ Emacs buffer."
581579
(kill-buffer buf))))
582580

583581
(ert-deftest ghostel-test-scrollback-eviction-bulk ()
584-
"Scrollback eviction works when a single large write pushes all rows
585-
out of libghostty's scrollback cap at once. Writes a small batch,
586-
renders, then writes a massive amount in one go that gets evicted in
587-
one fell swoop. The second redraw must evict the first-batch rows from
588-
the Emacs buffer."
582+
"Scrollback eviction works for a single large bulk write.
583+
Writes a small batch, renders, then writes a massive amount in one go
584+
that pushes all rows out of libghostty's scrollback cap at once. The
585+
second redraw must evict the first-batch rows from the Emacs buffer."
589586
(let ((buf (generate-new-buffer " *ghostel-test-sb-evict*")))
590587
(unwind-protect
591588
(with-current-buffer buf
@@ -605,8 +602,10 @@ the Emacs buffer."
605602
(kill-buffer buf))))
606603

607604
(ert-deftest ghostel-test-no-stale-lines-in-scrollback ()
608-
"Rows that have been materialized in a previous render and are then modified
609-
and scrolled out in a single write should not scroll out the stale row."
605+
"Rows modified and scrolled out in one write must not leak stale text.
606+
A row that has been materialized in a previous render and is then
607+
modified and scrolled out in a single write should not scroll out the
608+
stale row."
610609
(let ((buf (generate-new-buffer " *ghostel-test-sb-buffer*")))
611610
(unwind-protect
612611
(with-current-buffer buf
@@ -1239,7 +1238,7 @@ Mirrors the real zsh case where the directory still contains a
12391238
;; -----------------------------------------------------------------------
12401239

12411240
(ert-deftest ghostel-test-fish-auto-inject-loads-integration ()
1242-
"Fish auto-inject shim must chain to etc/shell/ghostel.fish and clean XDG_DATA_DIRS.
1241+
"Fish auto-inject shim chains to ghostel.fish and cleans XDG_DATA_DIRS.
12431242
Regression test: the vendor_conf.d shim previously (a) inlined a
12441243
partial copy of the integration and silently dropped the outbound
12451244
\\='ssh' wrapper, and (b) used a temp variable name (\\='xdg_data_dirs')
@@ -3925,7 +3924,7 @@ declare that variable buffer-locally so the live buffer qualifies."
39253924
;; -----------------------------------------------------------------------
39263925

39273926
(ert-deftest ghostel-test-resize-redraw-alt-screen ()
3928-
"After resize on alt screen, the app's SIGWINCH-triggered redraw renders correctly.
3927+
"Resize on alt screen: SIGWINCH-triggered redraw renders correctly.
39293928
Simulates: alt-screen TUI fills screen → window resize → app redraws
39303929
for new size inside BSU/ESU → verify buffer shows new content."
39313930
(let ((buf (generate-new-buffer " *ghostel-test-resize-redraw*")))
@@ -6539,7 +6538,7 @@ rather than the selected window's buffer."
65396538
(should (lookup-key ghostel-mode-map (kbd "C-@"))))
65406539

65416540
(ert-deftest ghostel-test-c-g-binding ()
6542-
"The quit key is bound to `ghostel-send-C-g' in `ghostel-mode-map'."
6541+
"`ghostel-mode-map' binds the quit key to a dedicated send handler."
65436542
(should (eq (lookup-key ghostel-mode-map (kbd "C-g"))
65446543
#'ghostel-send-C-g)))
65456544

@@ -6559,7 +6558,7 @@ rather than the selected window's buffer."
65596558
(kill-buffer buf))))
65606559

65616560
(ert-deftest ghostel-test-c-g-deactivates-mark ()
6562-
"`ghostel-send-C-g' should clear an active region and `quit-flag'.
6561+
"The quit-key send handler clears an active region and `quit-flag'.
65636562
`keyboard-quit' is bypassed because `inhibit-quit' is set, so both
65646563
side effects have to happen explicitly inside the command."
65656564
(let ((buf (generate-new-buffer " *ghostel-test-c-g-mark*"))
@@ -7662,9 +7661,10 @@ printf '\\033[H\\033[2J'; exec %s"
76627661
(kill-buffer buf)))))
76637662

76647663
(ert-deftest ghostel-test-sigwinch-via-ghostel-resize-handler ()
7665-
"SIGWINCH reaches child processes via `ghostel--window-adjust-process-window-size'.
7666-
This is the full path Emacs takes: call the adjust-window-size-function,
7667-
get (width . height), then call `set-process-window-size'."
7664+
"SIGWINCH reaches child processes via the resize handler.
7665+
Exercises `ghostel--window-adjust-process-window-size', the full
7666+
path Emacs takes: call the adjust-window-size-function, get
7667+
\(width . height), then call `set-process-window-size'."
76687668
(skip-unless (not (eq system-type 'windows-nt)))
76697669
(skip-unless (file-executable-p "/bin/sh"))
76707670
(let* ((buf (generate-new-buffer " *sigwinch-gh-handler*"))

0 commit comments

Comments
 (0)