-
-
Notifications
You must be signed in to change notification settings - Fork 645
/
Eldev
70 lines (57 loc) · 3.2 KB
/
Eldev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; -*- mode: emacs-lisp; lexical-binding: t -*-
(eldev-require-version "1.8.2")
(eldev-use-package-archive 'gnu)
;; For compatibility; e.g. with MELPA Stable one test fails.
(eldev-use-package-archive 'melpa-unstable)
(eldev-use-plugin 'autoloads)
(eldev-add-loading-roots 'test "test/utils")
(eldev-add-extra-dependencies 'runtime '(:package logview :optional t))
(eldev-add-extra-dependencies 'runtime '(:package clojure-ts-mode :optional t))
;; slightly increase the maximum (applies to checkdoc and the byte compiler alike)
(setq byte-compile-docstring-max-column 100)
;; allow commas to indicate that the first sentence continues, which enables longer first sentences
(setq checkdoc-permit-comma-termination-flag t)
(defvar cider-test-type 'main)
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes
;; Avoid including files in test "projects".
(eldev-pcase-exhaustive cider-test-type
(`main "./test/*/")
(`integration '("./test/" "!./test/integration"))
(`enrich '("./test/" "!./test/enrich"))
(`clojure-ts-mode '("./test/*/" "!./test/clojure-ts-mode"))
(`all '("./test/*/" "!./test/integration")))
"test/integration/projects"
;; This file is _supposed_ to be excluded
;; from automated testing.
"test/cider-tests--no-auto.el"))
(eldev-defoption cider-test-selection (type)
"Select tests to run; type can be `main', `integration', `enrich', `clojure-ts-mode' or `all'"
:options (-T --test-type)
:for-command test
:value TYPE
:default-value cider-test-type
(unless (memq (intern type) '(main integration enrich clojure-ts-mode all))
(signal 'eldev-wrong-option-usage `("unknown test type `%s'" ,type)))
(setf cider-test-type (intern type)))
(add-hook 'eldev-load-dependencies-hook
(lambda (type additional-sets)
(when (and (eq cider-test-type 'clojure-ts-mode)
(member 'runtime additional-sets))
(message "Installing tree-sitter grammars")
(require 'clojure-ts-mode)
(clojure-ts--ensure-grammars))))
(add-hook 'eldev-test-hook
(lambda ()
(eldev-verbose "Using cider tests of type `%s'" cider-test-type)))
(add-hook 'eldev-executing-command-hook
(lambda (command)
(unless (eq command 'test)
;; So that e.g. byte-compilation works on all tests.
(setf cider-test-type 'all))))
;; CIDER cannot be compiled otherwise.
(setf eldev-build-load-before-byte-compiling t)
(setf eldev-lint-default '(elisp))
(with-eval-after-load 'elisp-lint
;; We will byte-compile with Eldev.
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile")
enable-local-variables :safe))