branch: externals/elpa
commit e514f9e1ed290a5f4457509859d61ee535294413
Author: Tobias Rittweiler <[email protected]>
Commit: GitHub <[email protected]>
Close #461: make CI fail if byte compiler warns
The environment variable ERROR_ON_WARN controls this.
Co-authored-by: João Távora <[email protected]>
* Makefile: Set `byte-compile-error-on-warn' to $(ERROR_ON_WARN) so
one can decide about the desired strictness at the command line.
* .travis.yml: Compile eglot.el with `ERROR_ON_WARN' true. Do not do
the same for eglot-tests.el because some tests (`eglot-dcase'
and `eglot-strict-interfaces') produce byte compile warning
purposedly.
* eglot-tests.el: Replace `seq-contains` with `cl-find` because
`seq-contains' was obsoleted by `seq-contains-p' in Emacs 27.1 and
produces a warning.
---
.travis.yml | 3 +++
Makefile | 10 ++++++++--
eglot-tests.el | 6 +++---
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 47db13a..1c04ef5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,9 @@ install:
- tar -C eclipse.jdt.ls -xzf eclipse.tar.gz
- export CLASSPATH=$(pwd)/$(find eclipse.jdt.ls/ -regex
eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_.*.jar):${CLASSPATH}
+before_script:
+ - make eglot.elc ERROR_ON_WARN=t
+
script:
- make check
diff --git a/Makefile b/Makefile
index 02259ed..63db244 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
#
EMACS=emacs
SELECTOR=t
+ERROR_ON_WARN=nil
LOAD_PATH=-L .
@@ -19,12 +20,17 @@ ELPADEPS ?=--eval '(package-initialize)'
\
(cadr (assoc (quote flymake) \
package-archive-contents)))'
+BYTECOMP_ERROR_ON_WARN := \
+ --eval '(setq byte-compile-error-on-warn $(ERROR_ON_WARN))'
+
all: compile
-# Compilation
+# Compilation. Note BYTECOMP_ERROR_ON_WARN after ELPADEPS
+# so deps can still warn on compilation.
#
%.elc: %.el
- $(EMACS) -Q $(ELPADEPS) $(LOAD_PATH) --batch -f batch-byte-compile $<
+ $(EMACS) -Q $(ELPADEPS) $(BYTECOMP_ERROR_ON_WARN) $(LOAD_PATH) \
+ --batch -f batch-byte-compile $<
compile: $(ELCFILES)
diff --git a/eglot-tests.el b/eglot-tests.el
index 48c3bfd..14e79a9 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -301,9 +301,9 @@ Pass TIMEOUT to `eglot--with-timeout'."
:workspaceFolders))
(default-directory root))
(and
- (seq-contains folders (eglot--path-to-uri "project/"))
- (seq-contains folders (eglot--path-to-uri "project/sub1/"))
- (seq-contains folders (eglot--path-to-uri "project/sub2/"))
+ (cl-find (eglot--path-to-uri "project/") folders :test
#'equal)
+ (cl-find (eglot--path-to-uri "project/sub1/") folders :test
#'equal)
+ (cl-find (eglot--path-to-uri "project/sub2/") folders :test
#'equal)
(= 3 (length folders)))))))))))
(ert-deftest auto-detect-running-server ()