Skip to content

Commit 3d8552a

Browse files
doublepbbatsov
authored andcommitted
Use Eldev
1 parent 2a0f25b commit 3d8552a

File tree

12 files changed

+80
-153
lines changed

12 files changed

+80
-153
lines changed

.circleci/config.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ commands:
55
setup:
66
steps:
77
- checkout
8-
- run: make elpa-key
9-
- run: make elpa
10-
- run: emacs --version
8+
- run:
9+
name: Install Eldev
10+
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh
1111
test:
1212
steps:
13-
- run: make test
13+
- run:
14+
name: Run regression tests
15+
command: eldev -dtT -p test
1416
lint:
1517
steps:
16-
- run: make lint
18+
- run:
19+
name: Run Elisp-lint
20+
command: eldev lint
21+
- run:
22+
name: Byte-compile `.el' files
23+
command: eldev -dtT compile --warnings-as-errors
1724

1825
jobs:
1926
test-emacs-25:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
*\#*\#
33
*.\#*
44
*.elc
5-
.cask
5+
/.eldev
6+
/Eldev-local
67
elpa*
78
.depend
89
TAGS

Cask

Lines changed: 0 additions & 11 deletions
This file was deleted.

Eldev

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
2+
3+
(eldev-require-version "0.6")
4+
5+
(eldev-use-package-archive 'gnu)
6+
;; For compatibility; e.g. with MELPA Stable one test fails.
7+
(eldev-use-package-archive 'melpa-unstable)
8+
9+
(eldev-use-plugin 'autoloads)
10+
11+
(eldev-add-loading-roots 'test "test/utils")
12+
13+
;; Otherwise `cider-test.el' will be considered a test file.
14+
(setf eldev-test-fileset "./test/")
15+
;; This file is _supposed_ to be excluded from automated testing. Since Eldev
16+
;; uses everything inside `test/' subdirectory, tell it to leave this file alone
17+
;; explicitly.
18+
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes "test/cider-tests--no-auto.el"))
19+
20+
;; CIDER cannot be compiled otherwise.
21+
(setf eldev-build-load-before-byte-compiling t)
22+
23+
(setf eldev-lint-default '(elisp))
24+
(with-eval-after-load 'elisp-lint
25+
;; We will byte-compile with Eldev.
26+
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile")
27+
enable-local-variables :safe))

Makefile

Lines changed: 0 additions & 111 deletions
This file was deleted.

cider-connection.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ REPL defaults to the current REPL."
536536
"Map active on REPL objects in sesman browser.")
537537

538538
(cl-defmethod sesman-session-info ((_system (eql CIDER)) session)
539-
(interactive "P")
540539
(list :objects (cdr session)
541540
:map cider-sesman-browser-map))
542541

doc/modules/ROOT/pages/contributing/hacking.adoc

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,42 @@ Alternatively you can simply load CIDER in your Emacs straight from its source
1717
repo (you'll have to manually install all the packages CIDER depends on
1818
in advance).
1919

20-
Additionally you will have to generate and require the
21-
https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html[autoloads],
22-
otherwise you'll keep getting errors about missing commands. That's done
23-
automatically when installing via `package.el` but you'll have to do it
24-
manually in this case:
20+
CIDER uses https://github.com/doublep/eldev[Eldev] for development, so
21+
you should install the tool first.
22+
23+
The easiest and "purest" way to run CIDER is to execute:
2524

2625
[source,shell]
2726
----
28-
make autoloads # generates cider-autoloads.el
27+
eldev emacs
2928
----
3029

31-
Then:
30+
This will start a separate Emacs process with CIDER and its
31+
dependencies available, but _without_ your normal packages installed.
32+
However, you can use `Eldev-local` to add some packages with
33+
`(eldev-add-extra-dependencies 'emacs ...)` forms. See Eldev
34+
documentation for details.
35+
36+
Alternatively, if you want to load CIDER from source code in the Emacs
37+
you use for editing:
38+
39+
. Generate autoloads file (that's done automatically when installing
40+
via `package.el` but you'll have to do it manually in this case):
41+
+
42+
[source,shell]
43+
----
44+
eldev build :autoloads
45+
----
3246

47+
. Add to your `.emacs`:
48+
+
3349
[source,lisp]
3450
----
3551
;; load CIDER from its source code
3652
(add-to-list 'load-path "~/projects/cider")
3753
(load "cider-autoloads" t t)
3854
----
3955

40-
If you want to compile *and* generate autoloads, just run `make`.
41-
4256
=== Changing the code
4357

4458
It's perfectly fine to load CIDER from `package.el` and then to start making
@@ -70,22 +84,20 @@ all the details.
7084

7185
If you prefer running all tests outside Emacs that's also an option.
7286

73-
Install https://github.com/cask/cask[cask] if you haven't
74-
already, then:
75-
76-
$ cd /path/to/cider
77-
$ cask
78-
7987
Run all tests with:
8088

81-
$ make test
89+
$ eldev test
8290

8391
NOTE: Tests may not run correctly inside Emacs' `shell-mode` buffers. Running
8492
them in a terminal is recommended.
8593

86-
You can also check for compliance with a variety of coding standards in batch mode (including docstrings and byte-compilation warnings):
94+
You can also check for compliance with a variety of coding standards in batch mode (including docstrings):
95+
96+
$ eldev lint
97+
98+
To check for byte-compilation warnings you can just compile the project with Eldev:
8799

88-
$ make lint
100+
$ eldev compile
89101

90102
==== Running the tests in CircleCI
91103

test/cider-connection-tests.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
;; follows type arguments
104104
(expect (cider-current-repl 'clj) :to-equal bb1)
105-
(message "%S" (seq-take (buffer-list) 10))
105+
;(message "%S" (seq-take (buffer-list) 10))
106106
(expect (cider-current-repl 'cljs) :to-equal bb2)
107107

108108
;; follows file type
@@ -211,7 +211,7 @@
211211
(expect (cider-current-repl) :to-equal bb2))
212212

213213
(switch-to-buffer b2)
214-
(message "%S" (sesman-sessions 'CIDER))
214+
;(message "%S" (sesman-sessions 'CIDER))
215215
(with-temp-buffer
216216
(expect (cider-current-repl) :to-equal b2))
217217
(with-temp-buffer
@@ -323,7 +323,7 @@
323323
(sesman-register 'CIDER session)
324324
(expect (cider-repls) :to-equal (list a b))
325325
(cider--close-connection b)
326-
(message "%S" sesman-links-alist)
326+
;(message "%S" sesman-links-alist)
327327
(expect (buffer-live-p b) :not :to-be-truthy)
328328
(expect (cider-repls) :to-equal (list a))
329329
(sesman-unregister 'CIDER session))))))

test/cider-debug-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
(expect (looking-back (rx "[]")) :to-be-truthy)
9595
(goto-char (point-min))
9696
(cider--debug-move-point '(4 ":b"))
97-
(message "%S" (point))
97+
;(message "%S" (point))
9898
(expect (thing-at-point 'symbol) :to-equal "2")))
9999

100100
(it "handles the syntax quote"

test/cider-interaction-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
(with-temp-buffer
8282
(clojure-mode)
8383
(setq buffer-file-name (make-temp-name "tmp.clj"))
84-
(expect (cider-load-buffer) :not :to-throw))))))
84+
(expect (let ((inhibit-message t)) (cider-load-buffer)) :not :to-throw))))))
8585

8686
(describe "cider-interactive-eval"
8787
(it "works as expected in empty Clojure buffers"

0 commit comments

Comments
 (0)