Skip to content

Commit 481ca48

Browse files
authored
Use Eldev (#669)
Closes #666
1 parent 525fc1b commit 481ca48

13 files changed

+162
-160
lines changed

.circleci/config.yml

+113-38
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,131 @@
11
version: 2.1
22

3-
# Default actions to perform on each Emacs version
4-
default: &default-steps
5-
steps:
6-
- checkout
7-
- run: apt-get update && apt-get install make
8-
- run: make elpa
9-
- run: emacs --version
10-
- run: make test
11-
# Make sure to run test-checks before test-bytecomp, as test-bytecomp autogenerates
12-
# files which won't pass test-checks.
13-
- run: make test-checks
14-
- run: make test-bytecomp
3+
orbs:
4+
win: circleci/[email protected]
5+
6+
commands:
7+
setup:
8+
steps:
9+
- checkout
10+
- run:
11+
name: Install Eldev
12+
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh
13+
14+
setup-macos:
15+
steps:
16+
- checkout
17+
- run:
18+
name: Install Emacs latest
19+
command: |
20+
brew install homebrew/cask/emacs
21+
- run:
22+
name: Install Eldev
23+
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh
24+
25+
setup-windows:
26+
steps:
27+
- checkout
28+
- run:
29+
name: Install Eldev
30+
command: |
31+
# Remove expired DST Root CA X3 certificate. Workaround
32+
# for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038
33+
# bug on Emacs 27.2.
34+
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
35+
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
36+
(iwr https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev.ps1).Content | powershell -command -
37+
test:
38+
steps:
39+
- run:
40+
name: Run regression tests
41+
command: eldev -dtT -p test
42+
lint:
43+
steps:
44+
- run:
45+
name: Lint
46+
command: eldev lint -c
47+
compile:
48+
steps:
49+
- run:
50+
name: Check for byte-compilation errors
51+
command: eldev -dtT compile --warnings-as-errors
1552

16-
# Enumerated list of Emacs versions
1753
jobs:
18-
test-emacs-25:
54+
test-ubuntu-emacs-26:
1955
docker:
20-
- image: silex/emacs:25-ci-cask
56+
- image: silex/emacs:26-ci
2157
entrypoint: bash
22-
<<: *default-steps
23-
24-
test-emacs-26:
58+
steps:
59+
- setup
60+
- test
61+
- lint
62+
- compile
63+
test-ubuntu-emacs-27:
2564
docker:
26-
- image: silex/emacs:26-ci-cask
65+
- image: silex/emacs:27-ci
2766
entrypoint: bash
28-
<<: *default-steps
29-
30-
test-emacs-27:
67+
steps:
68+
- setup
69+
- test
70+
- lint
71+
- compile
72+
test-ubuntu-emacs-28:
3173
docker:
32-
- image: silex/emacs:27-ci-cask
74+
- image: silex/emacs:28-ci
3375
entrypoint: bash
34-
<<: *default-steps
35-
36-
test-emacs-28:
76+
steps:
77+
- setup
78+
- test
79+
- lint
80+
- compile
81+
test-ubuntu-emacs-29:
3782
docker:
38-
- image: silex/emacs:28-ci-cask
83+
- image: silex/emacs:29-ci
3984
entrypoint: bash
40-
<<: *default-steps
41-
42-
test-emacs-master:
85+
steps:
86+
- setup
87+
- test
88+
- lint
89+
- compile
90+
test-ubuntu-emacs-master:
4391
docker:
44-
- image: silex/emacs:master-ci-cask
92+
- image: silex/emacs:master-ci
4593
entrypoint: bash
46-
<<: *default-steps
94+
steps:
95+
- setup
96+
- test
97+
- lint
98+
- compile
99+
test-macos-emacs-latest:
100+
macos:
101+
xcode: "14.2.0"
102+
steps:
103+
- setup-macos
104+
- test
105+
- lint
106+
- compile
107+
test-windows-emacs-latest:
108+
executor: win/default
109+
steps:
110+
- run:
111+
name: Install Emacs latest
112+
command: |
113+
choco install emacs
114+
- setup-windows
115+
- test
116+
- lint
117+
- compile
47118

48119
workflows:
49-
version: 2
120+
version: 2.1
50121
ci-test-matrix:
51122
jobs:
52-
- test-emacs-25
53-
- test-emacs-26
54-
- test-emacs-27
55-
- test-emacs-28
56-
- test-emacs-master
123+
- test-ubuntu-emacs-26
124+
- test-ubuntu-emacs-27
125+
- test-ubuntu-emacs-28
126+
- test-ubuntu-emacs-29
127+
- test-ubuntu-emacs-master
128+
- test-windows-emacs-latest
129+
- test-macos-emacs-latest:
130+
requires:
131+
- test-ubuntu-emacs-29

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
elpa*
1010
/clojure-mode-autoloads.el
1111
/clojure-mode-pkg.el
12+
13+
/.eldev
14+
/Eldev-local

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ and description in grammatically correct, complete sentences.
3939
## Development setup
4040

4141
1. Fork and clone the repository.
42-
1. Install [Cask][7].
43-
1. Run `cask install` in the repository folder.
42+
1. Install [Eldev][7].
43+
1. Run `eldev build` in the repository folder.
4444
1. Run tests with `make test`.
4545

4646
**Note:** macOS users should make sure that the `emacs` command resolves the version of Emacs they've installed
@@ -53,5 +53,5 @@ See [this article][8] for more details.
5353
[4]: https://help.github.com/articles/using-pull-requests
5454
[5]: https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
5555
[6]: https://github.com/clojure-emacs/clojure-mode/blob/master/CHANGELOG.md
56-
[7]: https://github.com/cask/cask
56+
[7]: https://github.com/emacs-eldev/eldev
5757
[8]: https://emacsredux.com/blog/2015/05/09/emacs-on-os-x/

Cask

-9
This file was deleted.

Eldev

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; -*- mode: emacs-lisp; lexical-binding: t -*-
2+
3+
(eldev-require-version "1.6")
4+
5+
(eldev-use-package-archive 'gnu-elpa)
6+
(eldev-use-package-archive 'nongnu-elpa)
7+
(eldev-use-package-archive 'melpa)
8+
9+
(eldev-use-plugin 'autoloads)
10+
11+
(eldev-add-extra-dependencies 'test 'paredit 's 'buttercup)
12+
13+
(setq byte-compile-docstring-max-column 240)
14+
(setq checkdoc-force-docstrings-flag nil)
15+
(setq checkdoc-permit-comma-termination-flag t)
16+
(setq checkdoc--interactive-docstring-flag nil)
17+
18+
(setf eldev-lint-default '(elisp))
19+
20+
(with-eval-after-load 'elisp-lint
21+
;; We will byte-compile with Eldev.
22+
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile" "checkdoc")
23+
enable-local-variables :safe
24+
elisp-lint-indent-specs '((define-clojure-indent . 0))))
25+
26+
(setq eldev-project-main-file "clojure-mode.el")

Makefile

+11-36
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,17 @@
1-
CASK = cask
2-
export EMACS ?= emacs
3-
EMACSFLAGS =
4-
5-
PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)
6-
7-
SRCS = $(wildcard *.el)
8-
OBJS = $(SRCS:.el=.elc)
9-
10-
.PHONY: compile test clean elpa
11-
12-
all: compile
13-
14-
elpa-$(EMACS):
15-
$(CASK) install
16-
$(CASK) update
17-
touch $@
18-
19-
elpa: elpa-$(EMACS)
20-
21-
elpaclean:
22-
rm -f elpa*
23-
rm -rf .cask # Clean packages installed for development
24-
25-
compile: elpa
26-
$(CASK) build
1+
.PHONY: clean compile lint test all
2+
.DEFAULT_GOAL := all
273

284
clean:
29-
rm -f $(OBJS) clojure-mode-autoloads.el
5+
eldev clean
306

31-
test: $(PKGDIR)
32-
$(CASK) exec buttercup
7+
lint: clean
8+
eldev lint -c
339

34-
test-checks:
35-
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \
36-
-l test/test-checks.el ./
10+
# Checks for byte-compilation warnings.
11+
compile: clean
12+
eldev -dtT compile --warnings-as-errors
3713

38-
test-bytecomp: $(SRCS:.el=.elc-test)
14+
test: clean
15+
eldev -dtT -p test
3916

40-
%.elc-test: %.el elpa
41-
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \
42-
-l test/clojure-mode-bytecomp-warnings.el $<
17+
all: clean compile lint test

clojure-mode.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -3129,7 +3129,7 @@ Assumes cursor is at beginning of function."
31293129
"Add an arity to a function.
31303130
31313131
Assumes cursor is at beginning of function."
3132-
(let ((beg-line (what-line))
3132+
(let ((beg-line (line-number-at-pos))
31333133
(end (save-excursion (forward-sexp)
31343134
(point))))
31353135
(down-list 2)
@@ -3141,7 +3141,7 @@ Assumes cursor is at beginning of function."
31413141
(insert "[")
31423142
(save-excursion (insert "])\n(")))
31433143
((looking-back "\\[" 1) ;; single-arity fn
3144-
(let* ((same-line (string= beg-line (what-line)))
3144+
(let* ((same-line (= beg-line (line-number-at-pos)))
31453145
(new-arity-text (concat (when same-line "\n") "([")))
31463146
(save-excursion
31473147
(goto-char end)

test/clojure-mode-bytecomp-warnings.el

-40
This file was deleted.

test/clojure-mode-convert-collection-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
(require 'clojure-mode)
2929
(require 'buttercup)
30+
(require 'test-helper "test/utils/test-helper")
3031

3132
(describe "clojure-convert-collection-to-map"
3233
(when-refactoring-it "should convert a list to a map"

test/clojure-mode-refactor-add-arity-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
(require 'clojure-mode)
2626
(require 'buttercup)
27+
(require 'test-helper "test/utils/test-helper")
2728

2829
(describe "clojure-add-arity"
2930

test/clojure-mode-util-test.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
(bb-edn-src (expand-file-name "src" temp-dir)))
4747
(write-region "{}" nil bb-edn)
4848
(make-directory bb-edn-src)
49-
(expect (clojure-project-dir bb-edn-src)
49+
(expect (expand-file-name (clojure-project-dir bb-edn-src))
5050
:to-equal (file-name-as-directory temp-dir))))))
5151

5252
(describe "clojure-project-relative-path"

0 commit comments

Comments
 (0)